ChessV castling problem

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28395
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

ChessV castling problem

Post by hgm »

I have been playing some Schoolbook-Chess test games with ChessV under WinBoard, against Fairy-Max. Of the 70 games, at 40 moves / min, 16 games could not be completed and ended in a time forfeit. One of these was a regular forfeit, where Fairy-Max exceeded time in a badly lost position.

The other 15 games were due to the game getting stuck after a castling. Of course this was expcted, as in Schoolbook castling can also be f1-d1 and f1-h1, where Fairy-Max, which is really just playing Capablanca with a setup position from a file, only accepts f1-c1 and f1-i1. So when ChessV plays one of the alternative castlings, WinBoard lets it pass (as I switched legality-testing off), but Fairy-Max refuses it, and the game gets stuck.

So far, so good, this was expected. But to my surprise / dismay, there were also a few games where Fairy-Max castled f1-i1 (or f8-i8), which was then refused by ChessV!

This should not have happened. And it did not always happen; Often the f1-i1 castling is accepted by ChessV, or it even plays it itself. I am now doing somewhat slower TC (15 min/game sudden death), where I am making a debug file, and in one it seems that ChessV indeed dies after receiving the perfectly legal move f1c1. This was the game

Code: Select all

[Event "Computer Chess Game"]
[Site "SCHAAK_PC"]
[Date "2009.10.01"]
[Round "1.1"]
[White "Fairy-Max 4.8v"]
[Black "ChessV Schoolbook"]
[Result "*"]
[TimeControl "900"]
[Variant "capablanca"]
[FEN "rqnbakbncr/pppppppppp/10/10/10/10/PPPPPPPPPP/RQNBAKBNCR w KQkq - 0 1"]
[SetUp "1"]
[Number "14"]

{--------------
r q n b a k b n c r
p p p p p p p p p p
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
P P P P P P P P P P
R Q N B A K B N C R
white to play
--------------}
1. f3 {+0.15/9 22} f5 {+0.06/8 0} 2. e3 {+0.11/8 18} e5 {+0.29/8 0} 3.
Ng3 {+0.13/9 19} Ch6 {+0.44/8 0} 4. Ad3 {-0.08/8 13} Be6 {+0.66/8 0} 5.
Axe5 {+0.73/8 11} Nf7 {+0.36/8 0} 6. Af4 {+0.76/8 10} g5 {+0.13/8 0} 7.
Ah5 {+0.81/9 9} O-O {-0.02/8 0} 8. Nb3 {+1.07/9 33} Bf6 {+0.11/7 0} 9.
Nc5 {+1.18/8 10} Bc4+ {-0.08/9 0} 10. d3 {+1.18/9 24} Bb5 {-0.08/8 0} 11.
c4 {+1.14/9 34} Bc6 {-0.35/8 0} 12. Aj4 {+1.09/8 14} Ch4 {-0.56/8 0} 13.
i3 {+1.09/9 30} Cxj4 {-0.68/10 0} 14. ixj4 {+1.02/9 8} Ag7 {-0.68/8 0} 15.
Ba4 {+1.05/8 9} Bxa4 {-0.58/8 0} 16. Nxa4 {+0.76/10 12} Ncd6 {-0.58/7 0}
17. Ch3 {+1.54/8 7} h5 {-0.81/7 0} 18. c5 {+1.55/9 9} g4 {-0.96/8 0} 19.
fxg4 {+1.88/10 10} fxg4 {-1.12/9 0} 20. d4+ {+1.85/10 14} Kj8 {-1.08/8 0}
21. Cj3 {+1.65/10 25} h4 {-1.02/8 0} 22. cxd6 {+1.86/10 7} hxg3 {-0.89/9 0}
23. Cxg3 {+1.51/9 6} Nxd6 {-0.73/9 0} 24. Qg6 {+1.19/9 18} Ai8 {-0.34/8 0}
25. Qxi8+ {+1.05/10 5} Kxi8 {-0.42/9 0} 26. Cxg4 {+0.83/10 13}
Qd8 {-0.42/8 0} 27. Bf2 {+0.78/9 9} Bxj2 {-0.50/8 0} 28. Cg7+ {+0.54/10 14}
Kj8 29. Nc5 {+0.06/10 10} Rxh2 {-0.05/8 0} 30. Nxd7 {-0.14/9 11}
Qg8 {+0.62/9 0} 31. Cxg8+ {-0.09/11 5} Rxg8 {+0.37/10 0} 32.
O-O-O {-0.20/11 14}
At that point ChessV dies (it stops using CPU), and on its own display the white castling move is not performed. The end of the debug file looks like:

Code: Select all

5 ep=-4
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
time odds: 1 1 
Interrupting second
790265 >second: time 58087
790265 >second: otim 43015
790265 >second: f1c1
Winboard send f1c1 to the second engine, and there is just no response whatsoever.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: ChessV castling problem

Post by Greg Strong »

That's odd. I'll take a look at it...
User avatar
hgm
Posts: 28395
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ChessV castling problem

Post by hgm »

I now have three more examples of this in Capabanca Chess as well. Tell me if you need the games. I guess that if this is eproducible, the single Schoolbook game above should be enough to debug it. And if it is not reproducible, the new games would not help anyway. I also have a lot of examples in Schoolbook Chess blitz games.

I could see no pattern in it. It is true that when it happens, it always happens when the opponent has no castling rights for that castling. But I hve plenty examples where this is also the case, and where the castling is accepted without any problems.