Of course it was a typing mistake, i means 8 then 7 (not 4).xmas79 wrote:[...]you do perft 8 (eight) and see e2e4 have wrong node count. Then you play e2e4 on the board and do a perft 4 (four)?[...]
I'm a bug wizard... i can put a bug in the hash even if I don't use a hash at all or a bug in castling that appears even when there are no castling

To explain the problem, i have a single array for all the moves, allocated and cleaned up at the start of perft. Any move will be saved overwriting previous content, this could be one reason for the bug. There are also a complex make/unmake and some parameter moved up and down in the nodes array plus pointers to the moves in each piece object, adjourned only when needed (i use incremental generation, as said). So the order of make/unmake and the move order itself can hide or show some bug but only when you play the exact sequence of moves. More than this... i use a "IsInCheckAfterMove" function that say if teh king has been leaved in check, doing only a fraction of the examined move.
Debugging all of this is funny but not very easy.