]> git.sesse.net Git - stockfish/commitdiff
Consistent TT replace policy
authormstembera <MissingEmail@email>
Wed, 15 Jul 2015 19:15:14 +0000 (20:15 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Wed, 15 Jul 2015 19:17:16 +0000 (20:17 +0100)
This fixes an inconsistency bug where TT entries were valued differently
depending on which pointer they were accessed through.

STC 2MB
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 11301 W: 2176 L: 2038 D: 7087

LTC 8MB
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17732 W: 2870 L: 2745 D: 12117

STC 16MB
LLR: 2.96 (-2.94,2.94) [-4.00,0.00]
Total: 17401 W: 3324 L: 3227 D: 10850

Bench: 8248164

Resolves #377

src/tt.cpp

index d0e2d729c8c766e883092277bfc5fd97b2bb58e2..c94dae53eb0289d4df142e2765ba7b71ff512099 100644 (file)
@@ -87,7 +87,7 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
   // Find an entry to be replaced according to the replacement strategy
   TTEntry* replace = tte;
   for (int i = 1; i < ClusterSize; ++i)
-      if (  ((  tte[i].genBound8 & 0xFC) == generation8 || tte[i].bound() == BOUND_EXACT)
+      if (  ((  tte[i].genBound8 & 0xFC) == generation8)
           - ((replace->genBound8 & 0xFC) == generation8)
           - (tte[i].depth8 < replace->depth8) < 0)
           replace = &tte[i];