]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Update killers after a TT hit
[stockfish] / src / search.cpp
index 4408475341ac9deea60df927609c4bfd61e79ae0..0e3ba85c82ae5bf421ce7192d8e03a621d636979 100644 (file)
@@ -780,8 +780,18 @@ namespace {
                                     : can_return_tt(tte, depth, beta, ss->ply)))
     {
         TT.refresh(tte);
-        ss->bestMove = ttMove; // Can be MOVE_NONE
-        return value_from_tt(tte->value(), ss->ply);
+        ss->bestMove = move = ttMove; // Can be MOVE_NONE
+        value = value_from_tt(tte->value(), ss->ply);
+
+        if (   value >= beta
+            && move
+            && !pos.move_is_capture_or_promotion(move)
+            && move != ss->killers[0])
+        {
+            ss->killers[1] = ss->killers[0];
+            ss->killers[0] = move;
+        }
+        return value;
     }
 
     // Step 5. Evaluate the position statically and update parent's gain statistics