]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix trace in case of space evaluation
[stockfish] / src / search.cpp
index a74e3f256833c576c4e11f19462367af32f91119..2e4ec5ec0889672162fdf25c77317a4aade7165e 100644 (file)
@@ -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;