diff --git a/src/evaluate.cpp b/src/evaluate.cpp index e9376aa6..d9180f2b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1088,7 +1088,8 @@ Value Eval::evaluate(const Position& pos) { // Deciding between classical and NNUE eval (~10 Elo): for high PSQ imbalance we use classical, // but we switch to NNUE during long shuffling or with high material on the board. if ( !useNNUE - || abs(eg_value(pos.psq_score())) * 5 > (856 + pos.non_pawn_material() / 64) * (5 + pos.rule50_count())) + || ((pos.this_thread()->depth > 9 || pos.count() > 7) && + abs(eg_value(pos.psq_score())) * 5 > (856 + pos.non_pawn_material() / 64) * (5 + pos.rule50_count()))) { v = Evaluation(pos).value(); // classical useClassical = abs(v) >= 297; @@ -1138,6 +1139,7 @@ std::string Eval::trace(Position& pos) { std::memset(scores, 0, sizeof(scores)); // Reset any global variable used in eval + pos.this_thread()->depth = 0; pos.this_thread()->trend = SCORE_ZERO; pos.this_thread()->bestValue = VALUE_ZERO; pos.this_thread()->optimism[WHITE] = VALUE_ZERO; diff --git a/src/search.cpp b/src/search.cpp index 2d24c313..fa73dce5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -560,6 +560,7 @@ namespace { // Step 1. Initialize node Thread* thisThread = pos.this_thread(); + thisThread->depth = depth; ss->inCheck = pos.checkers(); priorCapture = pos.captured_piece(); Color us = pos.side_to_move(); diff --git a/src/thread.h b/src/thread.h index 594a8ea2..8027855a 100644 --- a/src/thread.h +++ b/src/thread.h @@ -69,7 +69,7 @@ public: Position rootPos; StateInfo rootState; Search::RootMoves rootMoves; - Depth rootDepth, completedDepth; + Depth rootDepth, completedDepth, depth; Value rootDelta; CounterMoveHistory counterMoves; ButterflyHistory mainHistory;