Skip to content

Commit f233ca1

Browse files
gvreulssnicolet
authored andcommitted
Compact position structures
Reorder the structures data members in position.h to reduce padding. Passed STC: https://tests.stockfishchess.org/tests/view/60a8011fce8ea25a3ef04069 LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 14120 W: 1214 L: 1067 D: 11839 Ptnml(0-2): 26, 857, 5161, 976, 40 --- Also tested for speed locally by Joost: Result of 50 runs ================== base (./stockfish.master ) = 2254919 +/- 4439 test (./stockfish.patch ) = 2274003 +/- 5278 diff = +19084 +/- 6386 ================== speedup = +0.0085 P(speedup > 0) = 1.0000 --- closes #3488 No functional change.
1 parent 754fc8a commit f233ca1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/position.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ struct StateInfo {
5151
// Not copied when making a move (will be recomputed anyhow)
5252
Key key;
5353
Bitboard checkersBB;
54-
Piece capturedPiece;
5554
StateInfo* previous;
5655
Bitboard blockersForKing[COLOR_NB];
5756
Bitboard pinners[COLOR_NB];
5857
Bitboard checkSquares[PIECE_TYPE_NB];
58+
Piece capturedPiece;
5959
int repetition;
6060

6161
// Used by NNUE
@@ -192,11 +192,11 @@ class Position {
192192
int castlingRightsMask[SQUARE_NB];
193193
Square castlingRookSquare[CASTLING_RIGHT_NB];
194194
Bitboard castlingPath[CASTLING_RIGHT_NB];
195+
Thread* thisThread;
196+
StateInfo* st;
195197
int gamePly;
196198
Color sideToMove;
197199
Score psq;
198-
Thread* thisThread;
199-
StateInfo* st;
200200
bool chess960;
201201
};
202202

0 commit comments

Comments
 (0)