Simplify DirtyPiece

Simplifies the DirtyPiece struct.

passed STC: https://tests.stockfishchess.org/tests/view/68054c9798cd372e3aea05d7
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 36608 W: 9641 L: 9437 D: 17530
Ptnml(0-2): 89, 3630, 10668, 3822, 95

passed LTC: https://tests.stockfishchess.org/tests/view/6805514598cd372e3aea0783
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 127620 W: 31993 L: 31894 D: 63733
Ptnml(0-2): 42, 10983, 41665, 11074, 46

closes https://github.com/official-stockfish/Stockfish/pull/6016

No functional change
This commit is contained in:
Carlos Esparza
2025-05-13 20:30:22 +02:00
committed by Disservin
parent ed6b8d179a
commit 63c6f22627
4 changed files with 44 additions and 48 deletions
+7 -11
View File
@@ -276,18 +276,14 @@ enum Rank : int {
// Keep track of what a move changes on the board (used by NNUE)
struct DirtyPiece {
Piece pc; // this is never allowed to be NO_PIECE
Square from, to; // to should be SQ_NONE for promotions
// Number of changed pieces
int dirty_num;
// Max 3 pieces can change in one move. A promotion with capture moves
// both the pawn and the captured piece to SQ_NONE and the piece promoted
// to from SQ_NONE to the capture square.
Piece piece[3];
// From and to squares, which may be SQ_NONE
Square from[3];
Square to[3];
// if {add,remove}_sq is SQ_NONE, {add,remove}_pc is allowed to be
// uninitialized
// castling uses add_sq and remove_sq to remove and add the rook
Square remove_sq, add_sq;
Piece remove_pc, add_pc;
};
#define ENABLE_INCR_OPERATORS_ON(T) \