@@ -282,7 +282,7 @@ Position& Position::set(const string& fenStr, bool isChess960, StateInfo* si, Th
282282
283283 chess960 = isChess960;
284284 thisThread = th;
285- set_state (st );
285+ set_state ();
286286
287287 assert (pos_is_ok ());
288288
@@ -313,19 +313,19 @@ void Position::set_castling_right(Color c, Square rfrom) {
313313
314314// / Position::set_check_info() sets king attacks to detect if a move gives check
315315
316- void Position::set_check_info (StateInfo* si ) const {
316+ void Position::set_check_info () const {
317317
318- si ->blockersForKing [WHITE] = slider_blockers (pieces (BLACK), square<KING>(WHITE), si ->pinners [BLACK]);
319- si ->blockersForKing [BLACK] = slider_blockers (pieces (WHITE), square<KING>(BLACK), si ->pinners [WHITE]);
318+ st ->blockersForKing [WHITE] = slider_blockers (pieces (BLACK), square<KING>(WHITE), st ->pinners [BLACK]);
319+ st ->blockersForKing [BLACK] = slider_blockers (pieces (WHITE), square<KING>(BLACK), st ->pinners [WHITE]);
320320
321321 Square ksq = square<KING>(~sideToMove);
322322
323- si ->checkSquares [PAWN] = pawn_attacks_bb (~sideToMove, ksq);
324- si ->checkSquares [KNIGHT] = attacks_bb<KNIGHT>(ksq);
325- si ->checkSquares [BISHOP] = attacks_bb<BISHOP>(ksq, pieces ());
326- si ->checkSquares [ROOK] = attacks_bb<ROOK>(ksq, pieces ());
327- si ->checkSquares [QUEEN] = si ->checkSquares [BISHOP] | si ->checkSquares [ROOK];
328- si ->checkSquares [KING] = 0 ;
323+ st ->checkSquares [PAWN] = pawn_attacks_bb (~sideToMove, ksq);
324+ st ->checkSquares [KNIGHT] = attacks_bb<KNIGHT>(ksq);
325+ st ->checkSquares [BISHOP] = attacks_bb<BISHOP>(ksq, pieces ());
326+ st ->checkSquares [ROOK] = attacks_bb<ROOK>(ksq, pieces ());
327+ st ->checkSquares [QUEEN] = st ->checkSquares [BISHOP] | st ->checkSquares [ROOK];
328+ st ->checkSquares [KING] = 0 ;
329329}
330330
331331
@@ -334,39 +334,39 @@ void Position::set_check_info(StateInfo* si) const {
334334// / The function is only used when a new position is set up, and to verify
335335// / the correctness of the StateInfo data when running in debug mode.
336336
337- void Position::set_state (StateInfo* si ) const {
337+ void Position::set_state () const {
338338
339- si ->key = si ->materialKey = 0 ;
340- si ->pawnKey = Zobrist::noPawns;
341- si ->nonPawnMaterial [WHITE] = si ->nonPawnMaterial [BLACK] = VALUE_ZERO;
342- si ->checkersBB = attackers_to (square<KING>(sideToMove)) & pieces (~sideToMove);
339+ st ->key = st ->materialKey = 0 ;
340+ st ->pawnKey = Zobrist::noPawns;
341+ st ->nonPawnMaterial [WHITE] = st ->nonPawnMaterial [BLACK] = VALUE_ZERO;
342+ st ->checkersBB = attackers_to (square<KING>(sideToMove)) & pieces (~sideToMove);
343343
344- set_check_info (si );
344+ set_check_info ();
345345
346346 for (Bitboard b = pieces (); b; )
347347 {
348348 Square s = pop_lsb (b);
349349 Piece pc = piece_on (s);
350- si ->key ^= Zobrist::psq[pc][s];
350+ st ->key ^= Zobrist::psq[pc][s];
351351
352352 if (type_of (pc) == PAWN)
353- si ->pawnKey ^= Zobrist::psq[pc][s];
353+ st ->pawnKey ^= Zobrist::psq[pc][s];
354354
355355 else if (type_of (pc) != KING)
356- si ->nonPawnMaterial [color_of (pc)] += PieceValue[MG][pc];
356+ st ->nonPawnMaterial [color_of (pc)] += PieceValue[MG][pc];
357357 }
358358
359- if (si ->epSquare != SQ_NONE)
360- si ->key ^= Zobrist::enpassant[file_of (si ->epSquare )];
359+ if (st ->epSquare != SQ_NONE)
360+ st ->key ^= Zobrist::enpassant[file_of (st ->epSquare )];
361361
362362 if (sideToMove == BLACK)
363- si ->key ^= Zobrist::side;
363+ st ->key ^= Zobrist::side;
364364
365- si ->key ^= Zobrist::castling[si ->castlingRights ];
365+ st ->key ^= Zobrist::castling[st ->castlingRights ];
366366
367367 for (Piece pc : Pieces)
368368 for (int cnt = 0 ; cnt < pieceCount[pc]; ++cnt)
369- si ->materialKey ^= Zobrist::psq[pc][cnt];
369+ st ->materialKey ^= Zobrist::psq[pc][cnt];
370370}
371371
372372
@@ -865,7 +865,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
865865 sideToMove = ~sideToMove;
866866
867867 // Update king attacks used for fast check detection
868- set_check_info (st );
868+ set_check_info ();
869869
870870 // Calculate the repetition info. It is the ply distance from the previous
871871 // occurrence of the same position, negative in the 3-fold case, or zero
@@ -1017,7 +1017,7 @@ void Position::do_null_move(StateInfo& newSt) {
10171017
10181018 sideToMove = ~sideToMove;
10191019
1020- set_check_info (st );
1020+ set_check_info ();
10211021
10221022 st->repetition = 0 ;
10231023
@@ -1320,12 +1320,6 @@ bool Position::pos_is_ok() const {
13201320 if (p1 != p2 && (pieces (p1) & pieces (p2)))
13211321 assert (0 && " pos_is_ok: Bitboards" );
13221322
1323- StateInfo si = *st;
1324- ASSERT_ALIGNED (&si, Eval::NNUE::CacheLineSize);
1325-
1326- set_state (&si);
1327- if (std::memcmp (&si, st, sizeof (StateInfo)))
1328- assert (0 && " pos_is_ok: State" );
13291323
13301324 for (Piece pc : Pieces)
13311325 if ( pieceCount[pc] != popcount (pieces (color_of (pc), type_of (pc)))
0 commit comments