From: Marco Costalba Date: Thu, 29 Apr 2010 17:21:48 +0000 (+0100) Subject: Refresh TT entry after a cut-off to avoid aging X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8425b2b4997c90aaad35ced6ab190df098f24212;p=fairystockfish.git Refresh TT entry after a cut-off to avoid aging Re-save the same TT entry if value is usable and allow us to cut-off, it means that entry is valuable and we want to keep it fresh updating the 'generation' parameter up to the current value. Patch suggested by J. Wesley Cleveland and better clarified by Miguel A. Ballicora. After 999 games at 1+0 64MB hash size Mod vs Orig +167 =677 -155 +4 ELO Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index b2b2414..1f980fb 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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); }