X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=db94ed5dc7b9a0efaad54d83d8f17efe6f87202b;hp=6699991a8d5237932f0b98f10d42bce308f0a62c;hb=0d33466bcd84d9d58ea7049b224f375ba6a51221;hpb=e6c289902069b7bc262ddaf86a21884867d8f83b diff --git a/src/search.cpp b/src/search.cpp index 6699991a..db94ed5d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -573,9 +573,13 @@ namespace { if (thisThread->resetCalls.load(std::memory_order_relaxed)) { thisThread->resetCalls = false; - thisThread->callsCnt = 0; + // At low node count increase the checking rate to about 0.1% of nodes + // otherwise use a default value. + thisThread->callsCnt = Limits.nodes ? std::min((int64_t)4096, Limits.nodes / 1024) + : 4096; } - if (++thisThread->callsCnt > 4096) + + if (--thisThread->callsCnt <= 0) { for (Thread* th : Threads) th->resetCalls = true; @@ -944,10 +948,16 @@ moves_loop: // When in check search starts from here && !pos.see_ge(move, Value(-35 * lmrDepth * lmrDepth))) continue; } - else if ( depth < 7 * ONE_PLY - && !extension - && !pos.see_ge(move, Value(-35 * depth / ONE_PLY * depth / ONE_PLY))) + else if (depth < 7 * ONE_PLY && !extension) + { + Value v = -Value(399 + 35 * depth / ONE_PLY * depth / ONE_PLY); + + if (PvNode) + v += beta - alpha - 1; + + if (!pos.see_ge(move, v)) continue; + } } // Speculative prefetch as early as possible @@ -986,7 +996,6 @@ moves_loop: // When in check search starts from here // castling moves, because they are coded as "king captures rook" and // hence break make_move(). else if ( type_of(move) == NORMAL - && type_of(pos.piece_on(to_sq(move))) != PAWN && !pos.see_ge(make_move(to_sq(move), from_sq(move)), VALUE_ZERO)) r -= 2 * ONE_PLY;