2 ms·
Good point. If I remember right, the engine used one state to represent "no promotion happening this turn". Of course it's redundant, because you can determine
by dmurray 5y ago
Good point. If I remember right, the engine used one state to represent "no promotion happening this turn". Of course it's redundant, because you can determine that from the rest of the representation, but apparently it was worth being able to determine that with a single bitwise operation.
Edit:
> each move is easily encoded as a 16 bit value:
6 bits for origin square, 6 for destination square, 1 for en passant, 1 for castling, and 2 for promotion. The 2 promotion bits can only represent 4 options... and since the move encoding is for ANY move, not just promotions, one of the options is "no promotion"[0]
And another tidbit from that page: the same encoding is used for making moves and retracting them (going back up the search tree), so efficient encoding of "no promotion" is important there. E.g. If there's a white rook on e8 and the last move was e7-e8, when retracting it you need to know whether to put a pawn or a rook on e7.
[0] http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=1042 http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=1...