X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=e1ca7964922610a7691d9b56543e243ce82d0830;hp=5e3e61b2011925bd3fad886481325098e3ecf634;hb=2af2c67650c4ac2531e6ab2753830f91c0999876;hpb=231103d2cf223a087fc76dbfabc4f44cc42385a6 diff --git a/src/search.cpp b/src/search.cpp index 5e3e61b2..e1ca7964 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -296,6 +296,7 @@ void Thread::search() { MainThread* mainThread = (this == Threads.main() ? Threads.main() : nullptr); double timeReduction = 1.0; Color us = rootPos.side_to_move(); + bool failedLow; std::memset(ss-4, 0, 7 * sizeof(Stack)); for (int i = 4; i > 0; i--) @@ -305,7 +306,7 @@ void Thread::search() { beta = VALUE_INFINITE; if (mainThread) - mainThread->bestMoveChanges = 0, mainThread->failedLow = false; + mainThread->bestMoveChanges = 0, failedLow = false; size_t multiPV = Options["MultiPV"]; Skill skill(Options["Skill Level"]); @@ -346,7 +347,7 @@ void Thread::search() { // Age out PV variability metric if (mainThread) - mainThread->bestMoveChanges *= 0.517, mainThread->failedLow = false; + mainThread->bestMoveChanges *= 0.517, failedLow = false; // Save the last iteration's scores before first PV line is searched and // all the move scores except the (new) PV are set to -VALUE_INFINITE. @@ -423,7 +424,7 @@ void Thread::search() { if (mainThread) { - mainThread->failedLow = true; + failedLow = true; Threads.stopOnPonderhit = false; } } @@ -471,7 +472,7 @@ void Thread::search() { && !Threads.stop && !Threads.stopOnPonderhit) { - const int F[] = { mainThread->failedLow, + const int F[] = { failedLow, bestValue - mainThread->previousScore }; int improvingFactor = std::max(246, std::min(832, 306 + 119 * F[0] - 6 * F[1])); @@ -522,7 +523,7 @@ namespace { constexpr bool PvNode = NT == PV; const bool rootNode = PvNode && ss->ply == 0; - // Check if we have an upcoming move which draws by repetition, or + // Check if we have an upcoming move which draws by repetition, or // if the opponent had an alternative move earlier to this position. if ( pos.rule50_count() >= 3 && alpha < VALUE_DRAW @@ -1164,7 +1165,8 @@ moves_loop: // When in check, search starts from here { // Quiet best move: update move sorting heuristics if (!pos.capture_or_promotion(bestMove)) - update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount, stat_bonus(depth)); + update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount, + stat_bonus(depth + (bestValue > beta + PawnValueMg ? ONE_PLY : DEPTH_ZERO))); else update_capture_stats(pos, bestMove, capturesSearched, captureCount, stat_bonus(depth + ONE_PLY));