LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.38k stars 525 forks source link

adressing issue #825 #2054

Closed KarlKfoury closed 2 weeks ago

KarlKfoury commented 2 weeks ago

The comment on the bitboard function previously stated that "a8 is bit 7, b1 is bit 8". All bitboard methods (set, get, reset...) use the following to set the position of the bit on the bitboard: std::uint64_t(1) << pos, with pos being the BoardSquare index that follows the horizontal indexing notation (a1=0, b1=1, c1=2...) Meaning the bit's position on the bitboard is going to be 0 + pos which means the position of the bit should also follow the horizontal indexing notation.

mooskagh commented 2 weeks ago

There was also https://github.com/LeelaChessZero/lc0/pull/445, we should finally check what is right. :)

KarlKfoury commented 2 weeks ago

BoardSquare.as_int() row*8 + col to pack square name into an int which is the horizontal indexing notation (a1 = 0, b1 = 1...). And all subsequent methods and functions (Move::as_packed_int for example) seem to follow this standard