]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use qsearch on step 11 if depth is equal to or below 0
[stockfish] / src / search.cpp
index ea1e63fea0a869a3dcd7abc0315aadc1033c77d9..17ac05c4c9a71ef17b383126cfd425d356897a1a 100644 (file)
@@ -908,14 +908,17 @@ namespace {
          ss->ttPv = ttPv;
     }
 
-    // Step 11. If the position is not in TT, decrease depth by 2 or 1 depending on node type (~3 Elo)
-    if (   PvNode
-        && depth >= 3
+    // Step 11. If the position is not in TT, decrease depth by 3.
+    // Use qsearch if depth is equal or below zero (~4 Elo)
+    if (    PvNode
         && !ttMove)
-        depth -= 2;
+        depth -= 3;
 
-    if (   cutNode
-        && depth >= 8
+    if (depth <= 0)
+        return qsearch<PV>(pos, ss, alpha, beta);
+
+    if (    cutNode
+        &&  depth >= 8
         && !ttMove)
         depth--;