mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Better document entry age calculation used in TT replace.
No functional change. Resolves #401 Resolves #400
This commit is contained in:
parent
c052e03426
commit
bf6bc1b37b
1 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,10 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||||
// Find an entry to be replaced according to the replacement strategy
|
// Find an entry to be replaced according to the replacement strategy
|
||||||
TTEntry* replace = tte;
|
TTEntry* replace = tte;
|
||||||
for (int i = 1; i < ClusterSize; ++i)
|
for (int i = 1; i < ClusterSize; ++i)
|
||||||
|
// Due to our packed storage format for generation and its cyclic
|
||||||
|
// nature we add 259 (256 is the modulus plus 3 to keep the lowest
|
||||||
|
// two bound bits from affecting the result) to calculate the entry
|
||||||
|
// age correctly even after generation8 overflows into the next cycle.
|
||||||
if ( replace->depth8 - ((259 + generation8 - replace->genBound8) & 0xFC) * 2 * ONE_PLY
|
if ( replace->depth8 - ((259 + generation8 - replace->genBound8) & 0xFC) * 2 * ONE_PLY
|
||||||
> tte[i].depth8 - ((259 + generation8 - tte[i].genBound8) & 0xFC) * 2 * ONE_PLY)
|
> tte[i].depth8 - ((259 + generation8 - tte[i].genBound8) & 0xFC) * 2 * ONE_PLY)
|
||||||
replace = &tte[i];
|
replace = &tte[i];
|
||||||
|
|
Loading…
Add table
Reference in a new issue