I am writing a chess engine, and I am comparing my move generation results with Stockfish. I am currently stumped by this result.
In this position 8/2p5/8/KP1p2kr/5p2/8/4P1P1/6R1 w - -
from https://www.chessprogramming.org/Perft_Results, at depth 6, my engine has 11030061 moves while Stockfish gets 11030083. I follow the discrepancies in nodes visited from each root position until I reach this position 8/2p5/8/KP1p2kr/5p2/8/4P1P1/6R1 w - - 0 1
. At depth 2 Stockfish finds 256 positions, I find 255. The discrepancy is at g2g4. Stockfish finds 16 nodes, I find 15. When I make g2g4 then run Stockfish on this new position, it finds 15 moves, the same as my engine. Counting the moves in 8/2p5/8/KP1p2kr/5pP1/8/4P3/6R1 b - - 0 1
by hand, it seems to me that there should be 15.
Why does Stockfish find a 16th move from g2g4 at depth 2 in 8/2p5/8/KP1p2kr/5p2/8/4P1P1/6R1 w - - 0 1
and yet when g2g4 is made, it finds 15 moves for black?