]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Try razoring only for depth > OnePly
[stockfish] / src / search.cpp
index 768a22a4d36b50ce919248e7c0dc4cc95fe286c8..54ff467c1e563314ffed6804744fb1226ee555cf 100644 (file)
@@ -1239,10 +1239,13 @@ namespace {
     // Null move search not allowed, try razoring
     else if (   !value_is_mate(beta)
              && approximateEval < beta - RazorMargin
-             && depth < RazorDepth)
+             && depth < RazorDepth
+             && depth > OnePly
+             && ttMove == MOVE_NONE
+             && !pos.has_pawn_on_7th(pos.side_to_move()))
     {
         Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
-        if (v < beta - RazorMargin / 2)
+        if (v < beta - RazorMargin / 2 - int(depth - OnePly) * RazorMargin / 8)
             return v;
     }