X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=c9526ec3c683e38a013089dfcd98bb661f3f2c0e;hp=639c5bc55bf9a1d6d676d29bf2678ed80241cccf;hb=8bb7a737087ca82cb97380bf06bbfa659dec1f73;hpb=9fff27220917d706988185cbd847e3f355a7fe09 diff --git a/src/search.cpp b/src/search.cpp index 639c5bc5..c9526ec3 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -387,7 +387,7 @@ void Thread::search() { if (rootDepth >= 5 * ONE_PLY) { Value previousScore = rootMoves[pvIdx].previousScore; - delta = Value(18); + delta = Value(20); alpha = std::max(previousScore - delta,-VALUE_INFINITE); beta = std::min(previousScore + delta, VALUE_INFINITE); @@ -401,9 +401,11 @@ void Thread::search() { // Start with a small aspiration window and, in the case of a fail // high/low, re-search with a bigger window until we don't fail // high/low anymore. + int failedHighCnt = 0; while (true) { - bestValue = ::search(rootPos, ss, alpha, beta, rootDepth, false); + Depth adjustedDepth = std::max(ONE_PLY, rootDepth - failedHighCnt * ONE_PLY); + bestValue = ::search(rootPos, ss, alpha, beta, adjustedDepth, false); // Bring the best move to the front. It is critical that sorting // is done with a stable algorithm because all the values but the @@ -436,12 +438,17 @@ void Thread::search() { if (mainThread) { + failedHighCnt = 0; failedLow = true; Threads.stopOnPonderhit = false; } } else if (bestValue >= beta) + { beta = std::min(bestValue + delta, VALUE_INFINITE); + if (mainThread) + ++failedHighCnt; + } else break;