Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report - wrong castling in chess #1125

Closed
sotetsuk opened this issue Oct 16, 2023 · 3 comments
Closed

Bug report - wrong castling in chess #1125

sotetsuk opened this issue Oct 16, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sotetsuk
Copy link

sotetsuk commented Oct 16, 2023

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
@lanctot
Copy link
Collaborator

lanctot commented Oct 16, 2023

@matthewlai can you take a look?

@matthewlai
Copy link

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

@lanctot lanctot added the bug Something isn't working label Oct 16, 2023
@lanctot
Copy link
Collaborator

lanctot commented Oct 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants