]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Don't early stop if we have a mated score
[stockfish] / src / search.cpp
index ed029b4c4a08e6d15b3ef28f2b4b246b04ad74d9..e246512e985bbccff13c91c307454f680dd24356 100644 (file)
@@ -440,6 +440,7 @@ namespace {
             if (    depth >= 12
                 && !stop
                 &&  PVSize == 1
+                &&  bestValue > VALUE_MATED_IN_MAX_PLY
                 && (   RootMoves.size() == 1
                     || Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
             {
@@ -875,7 +876,7 @@ split_point_start: // At split points actual search starts from here
           // but fixing this made program slightly weaker.
           Depth predictedDepth = newDepth - reduction<PvNode>(depth, moveCount);
           futilityValue =  ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount)
-                         + Gain[pos.piece_moved(move)][to_sq(move)];
+                         + 2 * Gain[pos.piece_moved(move)][to_sq(move)];
 
           if (futilityValue < beta)
           {