chess960 = isChess960;
thisThread = th;
set_state(st);
+ st->accumulator.state[WHITE] = Eval::NNUE::INIT;
+ st->accumulator.state[BLACK] = Eval::NNUE::INIT;
assert(pos_is_ok());
++st->pliesFromNull;
// Used by NNUE
- st->accumulator.computed_accumulation = false;
- st->accumulator.computed_score = false;
+ st->accumulator.state[WHITE] = Eval::NNUE::EMPTY;
+ st->accumulator.state[BLACK] = Eval::NNUE::EMPTY;
auto& dp = st->dirtyPiece;
dp.dirty_num = 1;
assert(!checkers());
assert(&newSt != st);
- if (Eval::useNNUE)
- {
- std::memcpy(&newSt, st, sizeof(StateInfo));
- st->accumulator.computed_score = false;
- }
- else
- std::memcpy(&newSt, st, offsetof(StateInfo, accumulator));
+ std::memcpy(&newSt, st, offsetof(StateInfo, accumulator));
newSt.previous = st;
st = &newSt;
+ st->dirtyPiece.dirty_num = 0;
+ st->dirtyPiece.piece[0] = NO_PIECE; // Avoid checks in UpdateAccumulator()
+ st->accumulator.state[WHITE] = Eval::NNUE::EMPTY;
+ st->accumulator.state[BLACK] = Eval::NNUE::EMPTY;
+
if (st->epSquare != SQ_NONE)
{
st->key ^= Zobrist::enpassant[file_of(st->epSquare)];