Open rhalbersma opened 5 years ago
Yeah initially it was wrong in both places, but then fixed in one but apparently not another.
There are some other improvements possible in bitboard.h. E.g. BitBoard::Mirror()
could use the compiler intrinsics _byteswap_uint64
(MSVC) or __builtin_bswap64
(gcc/clang). This should reduce the current 15 instructions to 1 on modern architectures.
And ReverseBitsInBytes
from mcts/node.cc could be moved to be a member function of BitBoard, and renamed MirrorVertical
e.g. (and Mirror
be renamed to MirrorHorizontal
).
I also don’t quite understand the rationale to vertically mirror the inputs for training, could you explain?
I could send a PR later. What do you think?
Those are good suggestsions, PR will be appreciated!
Still Relevant?
Yes, I've just check, still wrong (the comments issue in the very first comment). :)
In bitboard.h, for
class BoardSquare
the comment on line 43/44 states:In contrast, for the
class BitBoard
the comment on line 88/89 states:However, the subsequent
BitBoard
member functionsset
,reset
etc. take a BoardSquare parameter. So in fact BitBoard has the same ordering as BoardSquare.Should this comment in
class BitBoard
be updated?