]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Give extra bonus to main history for moves that caused a fail low. #4744
[stockfish] / src / search.cpp
index dc439ed00e5d3ca55439235e83c9581cefa8c48d..ce9ed9508aa2e03af4af54c7740225211c8baf11 100644 (file)
@@ -1373,6 +1373,7 @@ moves_loop: // When in check, search starts here
     {
         int bonus = (depth > 5) + (PvNode || cutNode) + (bestValue < alpha - 113 * depth) + ((ss-1)->moveCount > 12);
         update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * bonus);
+        thisThread->mainHistory[~us][from_to((ss-1)->currentMove)] << stat_bonus(depth) * bonus / 2;
     }
 
     if (PvNode)
@@ -1495,7 +1496,7 @@ moves_loop: // When in check, search starts here
         if (bestValue > alpha)
             alpha = bestValue;
 
-        futilityBase = bestValue + 200;
+        futilityBase = std::min(ss->staticEval, bestValue) + 200;
     }
 
     const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,