sunfish icon indicating copy to clipboard operation
sunfish copied to clipboard

Illegal moves when death is imminent

Open HarshithBolar opened this issue 5 years ago • 5 comments

Just played a game against it on my local IDE. Towards the end of the game, the king captures my knight which is already defended by the queen, moving into check. It then allowed me to capture its King with my Queen.

Here's the game log: https://paste.ubuntu.com/p/7q6Jb92Cht/

HarshithBolar avatar Sep 14 '18 14:09 HarshithBolar

Was sunfish in checkmate when it played against the rules? Or was there simply a checkmate within reach of a few plies?

thomasahle avatar Sep 22 '18 11:09 thomasahle

I've attached the game, around line 1653, you'll see that the king captures the knight that is defended by the queen. Thereby moving into check.

HarshithBolar avatar Sep 30 '18 06:09 HarshithBolar

I found another example of sunfish making illegal moves when losing. This time during an xboard game:

$ python -u xboard.py                    
setboard 3Q4/8/2Q2P2/6P1/6K1/3k4/8/8 b - - 3 55
go
move d3e2

Pretty bad.

thomasahle avatar Aug 25 '19 23:08 thomasahle

I observed the same thing when playing it in this short game: https://pastebin.com/LEs7sxrw

ghost avatar Dec 30 '20 03:12 ghost

For xboard sunfish now correctly calls "resign" rather the keeping on playing. When playing directly with sunfish.py, the king will still be sacrificed the way you show. I guess we can take it as sunfish's way of "handing over the king" :)

thomasahle avatar Dec 30 '20 12:12 thomasahle

The latest version now plays correctly in positions like 3Q4/8/2Q2P2/6P1/6K1/3k4/8/8 b - - 3 55.

thomasahle avatar Jan 08 '23 01:01 thomasahle