- // We use Position::set() to set root position across threads. But there are
- // some StateInfo fields (previous, pliesFromNull, capturedPiece) that cannot
- // be deduced from a fen string, so set() clears them and they are set from
- // setupStates->back() later. The rootState is per thread, earlier states are shared
- // since they are read-only.
- for (Thread* th : *this)
- {
- th->nodes = th->tbHits = th->nmpMinPly = th->bestMoveChanges = 0;
- th->rootDepth = th->completedDepth = 0;
- th->rootMoves = rootMoves;
- th->rootPos.set(pos.fen(), pos.is_chess960(), &th->rootState, th);
- th->rootState = setupStates->back();
- }
+ // We use Position::set() to set root position across threads. But there are
+ // some StateInfo fields (previous, pliesFromNull, capturedPiece) that cannot
+ // be deduced from a fen string, so set() clears them and they are set from
+ // setupStates->back() later. The rootState is per thread, earlier states are shared
+ // since they are read-only.
+ for (Thread* th : threads)
+ {
+ th->nodes = th->tbHits = th->nmpMinPly = th->bestMoveChanges = 0;
+ th->rootDepth = th->completedDepth = 0;
+ th->rootMoves = rootMoves;
+ th->rootPos.set(pos.fen(), pos.is_chess960(), &th->rootState, th);
+ th->rootState = setupStates->back();
+ th->rootSimpleEval = Eval::simple_eval(pos, pos.side_to_move());
+ }