Skip to content

Added Perft test suite#4

Merged
PRAndreini merged 1 commit into
PRAndreini:dev_stockfishfrom
zchown:dev_stockfish
May 19, 2026
Merged

Added Perft test suite#4
PRAndreini merged 1 commit into
PRAndreini:dev_stockfishfrom
zchown:dev_stockfish

Conversation

@zchown
Copy link
Copy Markdown

@zchown zchown commented May 15, 2026

Hey, took the time to checkout your project its a nice start and I hope you keep going.

Not sure if you want any help or outside contributions on this but noticed just some strangeness here and there and wanted to do a perft test https://www.chessprogramming.org/Perft to verify correctness. Feel free to adapt this to your style or to ignore.

Here are the perft results I got. I didn't have time to wait around for full depth results to finish as move generation isn't the fastest right now. I would recommend running this with full depth 6 instead of the 4 I did if you have the time.

perft_results.txt

The last position fails but otherwise looks mostly good with an asterix.
## Searching for other possible causes of stalemate... self.stalemate = self.search_for_material_stalemate() # # ## Fixing a bug where one can move after stalemate: if self.stalemate: moves = []

I understand this was added to fix a move after stalemate bug but it is very non standard. This had to be commented out or else many perft tests would fail. Normally stalemate is checked before calling to the move generation function. We just expect the move generation to return all legal moves in the position and not worry about the current state of the board.

Regardless I hope some perft testing will help you in your development going forward. Always good to have to make sure if you refactor anything you don't break chess.

@PRAndreini PRAndreini merged commit 9555433 into PRAndreini:dev_stockfish May 19, 2026
@PRAndreini
Copy link
Copy Markdown
Owner

Hey, Zander, thanks for helping me out! I noticed you had some quite-advanced algorithmic ideas, and I don't want to lose them, so I created a new branch for that. In the meantime, I'm still trying to come as close as possible to Stockfish, just with Python3, instead of C++ (I may even train a neural network on my Mac to help with this.). Anyway, I'll see you tomorrow at chess club!

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 this pull request may close these issues.

2 participants