Best way to debug perft?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Best way to debug perft?

Post by stegemma »

qperft is fast and almost... perfect!

Any modern engine can be used too, even my satana is good enough but not faster as others.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Best way to debug perft?

Post by Luis Babboni »

stegemma wrote:qperft is fast and almost... perfect!

Any modern engine can be used too, even my satana is good enough but not faster as others.
I just end of tried it.

The command seems to be perft depth as in Sharper.

And gives me 20 as Sharper!
What I understood wrong?
I count 21 possible moves in that position! :?:
a5,b3,b4,c3,c4,d3,d4,e3,e4,f3,f4,g3,g4,h3,h4
Ra2,Ra3,Na3,Nc3,Nf3 and Nh3.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Best way to debug perft?

Post by stegemma »

Luis Babboni wrote:
stegemma wrote:qperft is fast and almost... perfect!

Any modern engine can be used too, even my satana is good enough but not faster as others.
I just end of tried it.

The command seems to be perft depth as in Sharper.

And gives me 20 as Sharper!
What I understood wrong?
I count 21 possible moves in that position! :?:
a5,b3,b4,c3,c4,d3,d4,e3,e4,f3,f4,g3,g4,h3,h4
Ra2,Ra3,Na3,Nc3,Nf3 and Nh3.
you must setup the position first, giving this command:

Code: Select all

setboard rnbqkbnr/1ppppppp/p7/8/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2
perft 1
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Best way to debug perft?

Post by Luis Babboni »

Thanks! Now yes.
I thought it was enough given the position in the GUI chessboard. :oops:
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Best way to debug perft?

Post by stegemma »

Luis Babboni wrote:Thanks! Now yes.
I thought it was enough given the position in the GUI chessboard. :oops:
If you want to develop a chess engine, maybe it is better if you get comfortable with the command line, not just the GUI.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: Best way to debug perft?

Post by elcabesa »

I suggest to not rely on sharper for perft.
I think to remember that sometimes it return wrong perft values. I hope to not have make a mistake and given bad word against sharper, but those are my memories.

I think there are stronger engines you can rely on, for example stockfish. it implement perft.
some engines implement the divide command too. it's used to debug perft.

bye :)
Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 6:44 pm
Location: Bulgaria

Re: Best way to debug perft?

Post by Mincho Georgiev »

You can take a look at my code at http://pawny.netii.net/. The entire perft.c is dedicated to movegen's debugging.
It's very simple to understand and you can switch off/on hashing for example. The cmd line interface of the engine is again - entirely developed for debugging purposes.
Then you have the 'epdtest' command that works with files with pre-calculated node counts for positions up to certain depth. Like this one:
http://pawny.netii.net/my_perftsuite.epd
So basically 'epdtest my_perftsuite.epd' will run the entire test and compare the node counts for each depth (like the 'divide' command).