Open stockfish terminal
Load a sample position in the engine and in stockfish
then start the perft:
go perft 4 for example
if it returns an invalid number in any move, select that move and start a ( depth - 1) perft there:
for example for start position if it prints different number in your engine than in stockfish for a2a4 for depth 4 then you need to:
Code: Select all
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 moves a2a4
go perft 3
then is:
Code: Select all
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 moves a2a4 e7e5
go perft 3
this can be a very tedious task. So sometimes is better to write some kind of function in your engine that reads a .txt file with the stockfish results and compares the numbers for you. It will save you hours of debugging. ( i did this, saved me a lot of time )