Author: Gerd Isenberg
Date: 03:11:20 08/04/03
Hi all, One common search/evaluation test is to compare the search of a position with it's mirrored position. There is one principle problem related to bitboard traversal in move-generation. Black pieces and targets are traversed in an other order than the "mirrored" pieces and targets, regardless if one uses bsf or bsr and the square-bitindex mapping. Lets take some white pawns with following bit indicies: b2(9),d2(11) and c3(18). With bsf you'll find them in ascending order: b2,d2,c3. Now with "mirrored" black pawns on b7(49),d7(51),c6(42) we will foreward scan the ascending c6,b7,d7 squares. Even if there is further move sorting, the different initial order of generated moves in mirrored positions implies different search trees - and therefore slightly different search results. How do you deal with this behaviour in your bitboard based program? I ignore it so far. One possible solution with x86-64 is to use the fast "bswap reg64" instruction (direct path,1 cycle) before scanning black pieces or targets for movegen. "bswap" mirrors the bits rankwise (8 becomes 1, 7 become 2...) and a remirror of the scanned bit index is a simple xor with 0x38. According to the sample above we mirror the black b7,d7,c6 pawns to b2',d2',c3' and we get the same order as with original white pawns: b7,d7,c6. One drawback is of course the need of a color2move paramter for bitScan - or separate black/white traversal. Any remarks or implementaion hints? Regards, Gerd
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.