Debug with PerfT

Code, algorithms, languages, construction...
Post Reply
xianmei
Posts: 2
Joined: Tue May 30, 2017 2:25 pm

Debug with PerfT

Post by xianmei » Tue May 30, 2017 2:49 pm

Hello,
I make an AI I made a lot of game on lichess.com ( about 150 ) I have never encountered any problem ( illegal move ) I have 2000 elo on lichess but when I run a PerfT I obtain theses results :
1 : 20
2 : 400
3 : 8,902
4 : 197,281
5 : 4,865,867 <- problem should be 4,865,609 ( 4,865,609 + 258 en passant = 4,865,867 ?? )
6 : 119,072,421 <- problem should be 119,060,324

To determine legal move I make the move and if the king is check then I remove the move from list move
I implemented en passant, castling ( with rules ), promotions ...
I would like to know if there are several test which can isolate some probably problem
Thank you :D

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: Debug with PerfT

Post by User923005 » Tue May 30, 2017 8:49 pm

There are perft tests with things like 'divide' built into them that allow you to itemize.

Here is a thread about perft + divide. Stockfish will do this for you, so if you implement it for your engine, you can track down the branches that fail more easily.
http://www.talkchess.com/forum/viewtopi ... vide+perft

Here is a thread on debugging perft:
http://www.talkchess.com/forum/viewtopi ... vide+perft

Here is a place to get divide perft lists for huge trees:
http://talkchess.com/forum/viewtopic.ph ... ght=divide

xianmei
Posts: 2
Joined: Tue May 30, 2017 2:25 pm

Re: Debug with PerfT

Post by xianmei » Wed May 31, 2017 12:27 pm

Thank you for your link , I used JetChess on your first link and I have been able to divide and determine my problem. I generate 2x each move En passant because of an "if" instead of "else if" so now I obtain the right result now
Thank you :D :D

Post Reply