]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Refresh TT entry after a cut-off to avoid aging
[stockfish] / src / search.cpp
index b2b2414ae68eb47f6d2de2101e5bcc198d7f9aa7..1f980fbb78038d6cf098e1b3cafaa37761bfd808 100644 (file)
@@ -1301,6 +1301,9 @@ namespace {
 
     if (tte && ok_to_use_TT(tte, depth, beta, ply))
     {
+        // Refresh tte entry to avoid aging
+        TT.store(posKey, tte->value(), tte->type(), tte->depth(), ttMove);
+
         ss[ply].currentMove = ttMove; // Can be MOVE_NONE
         return value_from_tt(tte->value(), ply);
     }
@@ -1624,6 +1627,9 @@ namespace {
     {
         assert(tte->type() != VALUE_TYPE_EVAL);
 
+        // Refresh tte entry to avoid aging
+        TT.store(pos.get_key(), tte->value(), tte->type(), tte->depth(), ttMove);
+
         ss[ply].currentMove = ttMove; // Can be MOVE_NONE
         return value_from_tt(tte->value(), ply);
     }