Thursday, October 28, 2010

Still fighting the KQKP table

I fixed most of the issues with the KQKP table but there are still errors in it.

I find them when I consider symmetry properties of the board. When you have a position and flip the board vertical you end up with a mirrored position that should have the exact same value. Whenever the position and the mirrored position values are different you know there is a bug somewhere. This way I eliminated most of the bugs. The last I found is caused by not properly handling under promotions.

Consider the following position

If white promotes the pawn to a queen it is mated next move, moving with the king is slightly better as White then is "Mated in 2". The best move however is e7-e8 N. Then black must move out of check and white gains an additional move. So this positions value is "Mated in 3" but the table shows "Mated in 2" because it does not consider the under promotion to a knight.

A nice shot of the inconsistency of the table.

So this is the next thing to fix and then hopefully the KQKP is ready and I can finally progress to the KPKP table.

Saturday, October 23, 2010

Further work on the 4 man end game tables

The work on the KPKP table base is quite challenging, because one has to consider the pawn promotions and also decide how to handle en passent positions. While working on the table it showed that there are some inconsistencies in the KQKP and other tables as well that popped up when handling the promotions. So I have to verify the base tables before I continue to work on the KPKP table. I hope to fix those issues pretty soon.

Thursday, October 14, 2010

Chess endgame table base KRKB

The next on my list for endgame tables was the endgame of king and rook vs king and bishop. Theory says that games with rook vs bishop or knight are drawish as they contain mostly draws and a few easy to spot wins where the rook is able to capture the piece (e.g. by pinning it to the king).

The table proved the theory however there are a few positions where the side with the rook can force a win that is not that obvious. I find those positions and the paths to mate from them quite interesting. One example is the following board

From the first look this position seems to be a safe draw for black. White is not able to capture the bishop in the near future. But the final table shows that this position is a forced with for White in 29 moves. The only winning move is 1. Ke1. The bishop is captured in move 17. So it would require a rather deep calculation for an engine to see the win in that position.

Thursday, October 7, 2010

Chess endgame table base KQKR

When I continued my work on the 4 man endgame table bases I started to work on a rather interesting 4 man combination. It is the King and Queen vs King and Rook end game. It is interesting because it is not trivial. All previous tables were mostly trivial as they contain easy forced wins (King and Queen vs King) or contain mostly draws (King and Queen vs King and Queen).

Consider the following position

Black threatens check mate with ... Rh4#. With white to move white can prevent the mate and win. But the table base shows that it requires at least 35 moves to do so. With regards to the 50 moves rule this requires accurate play and here the table base is quite helpful.

The generation of the table took quite some time on my computer also because I use board symmetries when storing the data but so far not in the calculation of the table. So I consider all 33.554.432 positions (2 * 2^24) and this took several hours.