Best way to debug perft?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 8:05 pm
Location: Italy
Full name: Stefano Gemma
Contact:

Re: Best way to debug perft?

Post by stegemma » Fri Feb 26, 2016 3:50 pm

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: 422
Joined: Sat Feb 28, 2015 3:37 pm
Location: Argentina

Re: Best way to debug perft?

Post by Luis Babboni » Fri Feb 26, 2016 4:17 pm

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 8:05 pm
Location: Italy
Full name: Stefano Gemma
Contact:

Re: Best way to debug perft?

Post by stegemma » Fri Feb 26, 2016 4:33 pm

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: 422
Joined: Sat Feb 28, 2015 3:37 pm
Location: Argentina

Re: Best way to debug perft?

Post by Luis Babboni » Fri Feb 26, 2016 4:56 pm

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 8:05 pm
Location: Italy
Full name: Stefano Gemma
Contact:

Re: Best way to debug perft?

Post by stegemma » Fri Feb 26, 2016 5:03 pm

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: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: Best way to debug perft?

Post by elcabesa » Fri Feb 26, 2016 5:14 pm

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 4:44 pm
Location: Bulgaria
Contact:

Re: Best way to debug perft?

Post by Mincho Georgiev » Sat Feb 27, 2016 7:32 am

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).

Post Reply