X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=5dff67f2a86f0c0f6d4b2d3375af5676a7507f47;hp=a74e3f256833c576c4e11f19462367af32f91119;hb=cddc8d4546ab0d7b63081cb75cbca66b9c68628b;hpb=a90fc4c877b39769ebdf227b3124008ec394ad3d diff --git a/src/search.cpp b/src/search.cpp index a74e3f25..5dff67f2 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(4096LL, Limits.nodes / 1024) + : 4096; } - if (++thisThread->callsCnt > 4096) + + if (--thisThread->callsCnt <= 0) { for (Thread* th : Threads) th->resetCalls = true;