Page 1 of 1

Perftree: Semi-automated debugging of move generation using perft calculations

Posted: Tue Apr 28, 2020 9:12 pm
by agausmann
Hi all, I've recently gained some interest in computer chess after being introduced to it by a university class, and I've been reading some material on CPW and making my own chess engine based on the methods discussed there. It has mostly been a fun experience, but debugging move generation has been quite annoying. I eventually discovered the usefulness of perft and it has made the process much smoother, but I still found myself doing a lot of manual work, comparing the results and tracking where I am in the game tree. So, I built a tool to help me!

Perftree is a debugger that compares your perft calculations to the ones generated by Stockfish... and that's basically all that it does. Give it an initial state and a perft depth, and it will help you walk the tree and compare the results at each node, highlighting the differences so you can quickly figure out where your missed and illegal moves are.

Despite being so simple, I have found it incredibly useful in practice. It does most of the work that you'd have to do manually, while staying out of the way and letting you explore the tree at your own pace. If you're interested in trying it, you can find some more documentation and the source code on GitHub. I'm working on getting some binaries released as well, for those of you who prefer that.

Here is a demo of me using it against my engine, which still has some pretty significant bugs:

Image