Monday, May 23, 2011

Draw recognizer with pawns involved

I try to build a endgame draw recognizer for all 4 man endgame positions that are not easily evaluated. So I don't build one for king and 2 rooks against king as this make no sense. The engine will mate the enemy king and avoid stalemate traps without any additional help.

King and bishop vs king and pawn is more interesting. Usually it is a draw but there are quite a few winning positions for the side with the pawn and even a few for the side with the bishop.

I verify the recognizer by running all possible positions through it and verify its decision (draw / not draw) against a table base. This verification process takes much longer when pawns are involved as I have to test much mor positions. Without pawns I only test 10 squares for the white king, all other positions can be matched by mirroring or flipping to one of the 10 tested squares. With pawns that does not work, so I have to test 32 squares for the white king and so it takes three times as long.

So the whole recognizer implementation takes quite some time and I looking forward when it is done so I can move to more interesting stuff.

No comments:

Post a Comment