Page 1 of 1

Perft and Captures

Posted: Thu Jan 24, 2013 2:20 am
by CDaley11
Hi, I've been testing my chess engine's move generation by using perft. I have a problem with my move generation in the results that I'm getting, my engine is printing out numbers such as:

Depth: 5
Total Nodes: 4,865,609
Captures: 84,071
E.P: 258

Depth 6
Total Nodes: 119,060,324
Captures: 2,890,831
E.P: 5,506

If you look at the correct values (http://chessprogramming.wikispaces.com/Perft+Results), then you will see that in both cases, my engine got the total number of nodes correct. But, except in the case of the en passant number on depth 5, it is over counting the number of captures and en passant. This leads me to believe that my overall move generation function is working correctly, except that some moves are being flagged as captures or en passant when they shouldn't be. Up until now I've been using stockfish at the command line to give me a perft count. But stockfish only gives me a total number of nodes, and not captures/e.p. Can anyone recommend a good engine to use that gives perft counts with info about #of captures, etc.?

Re: Perft and Captures

Posted: Thu Jan 24, 2013 6:04 am
by User923005
I do not know of any perft programs that provide this data.
I glanced over the code of:
frcperft-1.0
hgmperft
iperft
oliperft
q2perft
qperft

and I could see places where promotion, e.p. etc. are checked but not separately counted. You could probably add in code to do that.

Re: Perft and Captures

Posted: Thu Jan 24, 2013 9:33 am
by Octopus
Maybe this could help a little bit: http://10x8.net/chess/PerfT.html

Re: Perft and Captures

Posted: Tue Aug 06, 2013 6:22 am
by zie-iuk
The capture counts in those 'standard' perft results only count the captures of leaf nodes, including en passant captures.

Re: Perft and Captures

Posted: Tue Aug 06, 2013 5:02 pm
by hyatt
zie-iuk wrote:The capture counts in those 'standard' perft results only count the captures of leaf nodes, including en passant captures.
If you sum them it should give you the right answer.

IE captures for perft1 + captures for perft2 should include all the ply1 and ply2 captures, and not duplicate any.