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

Chess 960 support #10

Open
leonhfr opened this issue Jul 2, 2023 · 3 comments · May be fixed by #11
Open

Chess 960 support #10

leonhfr opened this issue Jul 2, 2023 · 3 comments · May be fixed by #11

Comments

@leonhfr
Copy link

leonhfr commented Jul 2, 2023

Hi! Really useful project! I used it to debug my move generator a while back.

Are there any plans on supporting Chess960 (Fisher Random Chess) in the future?

@agausmann
Copy link
Owner

I haven't experimented with Chess960, and I'm not actively writing chess engines right now.
But if I understand correctly, there isn't much difference between it and standard chess, just that the starting position and castling moves are different.

Perftree doesn't care about the specifics of how a move is performed, it doesn't do any position calculations itself. It just identifies a position by some starting FEN and a list of moves in UCI notation, and passes that information to the engines (your engine and Stockfish). Then the engines do all the position calculations.

So, if Stockfish can recognize the position as Chess960 and your perft script configures your engine for Chess960, then it should "just work". Or maybe Perftree just needs a small patch to configure Stockfish for Chess960 mode.

@GreatGodOfFire
Copy link

The problem is that Stockfish handles normal positions and Chess960 positions differently. You can see that with the following position: Qr1krb2/1bpp2pp/4q2n/pp2pp2/4PP2/2P3P1/PP1P3P/NRBKRB1N b Beb -
Without setting any options, Stockfish thinks the result of perft 1 is 43 but when sending setoption name UCI_Chess960 value true before setting the position, perft 1 is 42.
Fixing this shouldn't be hard and I might be able to make a PR soon.

@GreatGodOfFire GreatGodOfFire linked a pull request Jul 19, 2023 that will close this issue
@leonhfr
Copy link
Author

leonhfr commented Jul 30, 2023

I missed the answer, sorry for the late reply.

Exactly what @GreatGodOfFire said. The main issue I think are the castling rules in Chess960. In the end I made it work by patching it locally and sending the setoption command. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants