- if ((*step)++, ep_square() != SQ_NONE && relative_rank(sideToMove, ep_square()) != RANK_6)
- return false;
-
- if ((*step)++, debugKey && st->key != compute_key())
- return false;
-
- if ((*step)++, debugPawnKey && st->pawnKey != compute_pawn_key())
- return false;
-
- if ((*step)++, debugMaterialKey && st->materialKey != compute_material_key())
- return false;
-
- if ((*step)++, debugIncrementalEval && st->psq != compute_psq_score())
- return false;
-
- if ((*step)++, debugNonPawnMaterial)
- if ( st->npMaterial[WHITE] != compute_non_pawn_material(WHITE)
- || st->npMaterial[BLACK] != compute_non_pawn_material(BLACK))
- return false;
-
- if ((*step)++, debugPieceCounts)
- for (Color c = WHITE; c <= BLACK; c++)
- for (PieceType pt = PAWN; pt <= KING; pt++)
- if (pieceCount[c][pt] != popcount<Full>(pieces(c, pt)))
- return false;
-
- if ((*step)++, debugPieceList)
- for (Color c = WHITE; c <= BLACK; c++)
- for (PieceType pt = PAWN; pt <= KING; pt++)
- for (int i = 0; i < pieceCount[c][pt]; i++)
- if ( board[pieceList[c][pt][i]] != make_piece(c, pt)
- || index[pieceList[c][pt][i]] != i)
- return false;
-
- if ((*step)++, debugCastleSquares)
- for (Color c = WHITE; c <= BLACK; c++)
- for (CastlingSide s = KING_SIDE; s <= QUEEN_SIDE; s = CastlingSide(s + 1))
- {
- CastleRight cr = make_castle_right(c, s);
-
- if (!can_castle(cr))
- continue;