Page 1 of 1

Question on TT

PostPosted: 06 Jan 2012, 11:26
by geko
Values ​​stored in hashtable refer to a window (alpha,beta) that could be different to alpha beta values ​​during the search
eg:

TEMPO 1
alpha = 10
beta = 20
val = 11
as val > alpha --> tt_record(11,TT_EXACT)

TEMPO 2
alpha = 22
beta = 30

(of course the zobristKey is the same of TEMPO 1 and depth is <=)

probe hashtable:

Code: Select all
        ....   
        phashe = hash[zobristKey % HASH_SIZE];
        if ( phashe.key == key AND phashe.depth >= depth )
             if (phashe.flags == TT_EXACT)
                  return phashe.val
        ....


in this case the search returns the value stored in hashtable (11) which is out the window 22-30
is that correct or would need to store the values ​​alpha beta in hashtable ?
Many thanks
g.

Re: Question on TT

PostPosted: 06 Jan 2012, 11:48
by H.G.Muller
Your example is no problem, because an exact value is also valid as an upper or lower bound. The problem would be if these events occur in the revers order. You store 11, from a search with window {22,30}. So the search failed low, and 11 is only an upper bound, and the true score could be -100 or worse. So if you later get a hit when the window is {10, 20}, the 11 is not acceptable, as it would not fail low, but propagate to the root, and perhaps would cause selection of this branch (if nothing better was found later) leading in reality to a disastrous -100 score.

But storing the entry with a TT_UPPER flag fully takes care of that. You don't have to store the value of alpha itself, because the only thing that is important is whether alpha was above the stored score or not.