Great!JVMerlino wrote:And just to verify, I made a version of my engine that doesn't generate en passant captures, and my perft 1 through perft 5 agree with your numbers. So that is clearly most (if not all) of the problem.JVMerlino wrote:Your needle is right at the top.![]()
Perft 1 is wrong, because there are five legal moves (not four, as shown by your output). You probably aren't counting the en passant capture at d3, which is part of the FEN.
jm
However, my perft 6 is 31753706, whereas yours is 31753730 (difference of 24). But that could be another en passant effect?
jm
Now I pass all the test positions from "Sharpers" site. The bug is all from my just implemented UCI setboardfen() which did not call atoi() for digit characters. It is indeed the '3' from 'd3' that cause the error.
fen "8/7p/p5pb/4k3/P1pPn3/8/P5PP/1rB2RK1 b - d3 0 28" :
perft 1 5, nps(0) sec(0.000)
perft 2 117, nps(127000) sec(0.001)
perft 3 3293, nps(1771000) sec(0.002)
perft 4 67197, nps(2118685) sec(0.035)
perft 5 1881089, nps(2610637) sec(0.776)
perft 6 38633283, nps(4937524) sec(8.630)
Can now proceed to the next step

Thanks,
Rasjid