google-deepmind / open_spiel

OpenSpiel is a collection of environments and algorithms for research in general reinforcement learning and search/planning in games.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug report - wrong castling in chess

sotetsuk opened this issue · comments

I have come across what appears to be a bug and would like to report it. In the following FEN position (Left Fig.), the castling on the kingside, which should not be possible for the black player, is incorrectly deemed as possible by the legal_actions() function. Furthermore, when attempting to perform this castling, one of the rooks mysteriously disappears (Right Fig.).

Buggy state: 4k1rr/1b1p3p/nn1p4/P3Np2/3P1bp1/6PP/P5R1/1B1K2N1 b k - 1 37

You can find the steps to reproduce this issue in the following gist.

https://gist.github.com/sotetsuk/77f72626a2d89c6be24adcd44b6c7a8f

Buggy state Wrong king side castling by black
Screen Shot 2023-10-16 at 11 49 23 Screen Shot 2023-10-16 at 11 49 41

@matthewlai can you take a look?

This is due to broken partial support for chess960. I will investigate more tomorrow.

This is due to broken partial support for chess960. I will investigate more tomorrow.

@matthewlai has a fix (thanks!), and we'll update the master branch as soon as it's sufficiently tested.