]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
More accurate 'go nodes' searches at low count
[stockfish] / src / search.cpp
index 6699991a8d5237932f0b98f10d42bce308f0a62c..5dff67f2a86f0c0f6d4b2d3375af5676a7507f47 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(4096LL, Limits.nodes / 1024)
+                                            : 4096;
     }
-    if (++thisThread->callsCnt > 4096)
+
+    if (--thisThread->callsCnt <= 0)
     {
         for (Thread* th : Threads)
             th->resetCalls = true;
@@ -944,10 +948,15 @@ 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(-35 * depth / ONE_PLY * depth / ONE_PLY);
+              if (ss->staticEval != VALUE_NONE)
+                  v += ss->staticEval - alpha - 200;
+
+              if (!pos.see_ge(move, v))
                   continue;
+          }
       }
 
       // Speculative prefetch as early as possible