diff --git a/AUTHORS b/AUTHORS index edf189d8cff..b435ff8f4d8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -125,6 +125,7 @@ marotear Matt Ginsberg (mattginsberg) Matthew Lai (matthewlai) Matthew Sullivan (Matt14916) +Max A. (Disservin) Maxim Molchanov (Maxim) Michael An (man) Michael Byrne (MichaelB7) diff --git a/src/search.cpp b/src/search.cpp index c12b60e6815..4a41a8b0b09 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -238,6 +238,9 @@ void MainThread::search() { bestPreviousScore = bestThread->rootMoves[0].score; bestPreviousAverageScore = bestThread->rootMoves[0].averageScore; + for (Thread* th : Threads) + th->previousDepth = bestThread->completedDepth; + // Send again PV info if we have a new best thread if (bestThread != this) sync_cout << UCI::pv(bestThread->rootPos, bestThread->completedDepth, -VALUE_INFINITE, VALUE_INFINITE) << sync_endl; @@ -1061,7 +1064,7 @@ namespace { // a reduced search on all the other moves but the ttMove and if the // result is lower than ttValue minus a margin, then we will extend the ttMove. if ( !rootNode - && depth >= 4 + 2 * (PvNode && tte->is_pv()) + && depth >= 4 - (thisThread->previousDepth > 27) + 2 * (PvNode && tte->is_pv()) && move == ttMove && !excludedMove // Avoid recursive singular search /* && ttValue != VALUE_NONE Already implicit in the next condition */ diff --git a/src/thread.cpp b/src/thread.cpp index 30177a3915a..08a78db5f31 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -60,7 +60,8 @@ void Thread::clear() { counterMoves.fill(MOVE_NONE); mainHistory.fill(0); captureHistory.fill(0); - + previousDepth = 0; + for (bool inCheck : { false, true }) for (StatsType c : { NoCaptures, Captures }) { diff --git a/src/thread.h b/src/thread.h index 8027855a614..9e9cd488c3c 100644 --- a/src/thread.h +++ b/src/thread.h @@ -69,7 +69,7 @@ class Thread { Position rootPos; StateInfo rootState; Search::RootMoves rootMoves; - Depth rootDepth, completedDepth, depth; + Depth rootDepth, completedDepth, depth, previousDepth; Value rootDelta; CounterMoveHistory counterMoves; ButterflyHistory mainHistory;