1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-04-29 18:21:48 +01:00
parent a086f34f36
commit 8425b2b499

View 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);
}