]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix a bug in insert_pv() where minimum depth is zero
[stockfish] / src / search.cpp
index 295ef63ea24d1c9645b26aa694b5be0c353e7f8c..0e3838371fe0bc95366462fd1b8d547a2e3bd079 100644 (file)
@@ -1245,8 +1245,8 @@ namespace {
     {
         Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
         if (   (v < beta - RazorMargin - RazorMargin / 4)
-            || (depth < 3*OnePly && v < beta - RazorMargin)
-            || (depth < 2*OnePly && v < beta - RazorMargin / 2))
+            || (depth <= 2*OnePly && v < beta - RazorMargin)
+            || (depth <=   OnePly && v < beta - RazorMargin / 2))
             return v;
     }
 
@@ -1333,7 +1333,7 @@ namespace {
           && !move_is_killer(move, ss[ply]))
       {
           // LMR dynamic reduction
-          Depth R = (moveCount >= 3 * LMRNonPVMoves && depth >= 7*OnePly ? 2*OnePly : OnePly);
+          Depth R = (moveCount >= 2 * LMRNonPVMoves && depth > 7*OnePly ? 2*OnePly : OnePly);
 
           ss[ply].reduction = R;
           value = -search(pos, ss, -(beta-1), newDepth-R, ply+1, true, threadID);