Page 2 of 2

Re: Finding bugs in legal move generation or make/unmake move functions (Python)

Posted: Mon Nov 16, 2020 5:23 pm
by eligolf
Ferdy, did you make that perft on my code? Because I fixed that and I get some strange results :)

Re: Finding bugs in legal move generation or make/unmake move functions (Python)

Posted: Mon Nov 16, 2020 5:25 pm
by Ferdy
eligolf wrote:
Mon Nov 16, 2020 5:23 pm
Ferdy, did you make that perft on my code? Because I fixed that and I get some strange results :)
Yes :)

Re: Finding bugs in legal move generation or make/unmake move functions (Python)

Posted: Mon Nov 16, 2020 5:31 pm
by eligolf
I reverted back to an older version of the code and made the switch, now it seems to be working perfect down to depth 5 from start position :D Thank you so much all for your valuable feedback, it will certainly be of use for future testing. And special gold star for Ferdy, you made my evening :)

Re: Finding bugs in legal move generation or make/unmake move functions (Python)

Posted: Wed Dec 09, 2020 3:37 pm
by alessandro
Hi Elias,

I'm very happy to read that you're using the data from the Perft Result page in the wiki to test your move generator, because those numbers have been calculated by using AdaChess and that is my very small contribution to the community.
In the future version of the engine I am going to release those numbers also for the Divide function. This should help a bit more in finding bugs, for whom has interest on it. It could be that the wiki page for the Divide will be elaborated to provide this information.

Even if it is not the most important topic, sure it is a topic that every chess programmer soon or later has to deal with.
Although I agree with H.G.Muller that bugs are often in the Search, the perft is one of the few thing in chess programming that can be extensively tested and (i feel comfortable to say) almost proved for correctness. Once the move generator has been tested, you don't need to search anymore there for bugs and this will help in isolating the non-working code. Furthermore, it opens for future optimizations and code refining. Keep in mind that an engine spends normally 5-10% of the time in generating moves, so it's up to you to decide how much effort it worth to put on it.

I wish you the best for your chess engine and your graphical interface!