Update killers after a TT hit
authorMarco Costalba <mcostalba@gmail.com>
Sun, 18 Sep 2011 18:50:42 +0000 (19:50 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 24 Sep 2011 16:20:35 +0000 (17:20 +0100)
Almost no increase but seems the logic thing to do.

After 16707 games 2771 - 2595 - 11341 ELO +3 (+- 3.2)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
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