From d8aeaab79ca6809f8ad6a650611e827a7cba8978 Mon Sep 17 00:00:00 2001 From: mstembera Date: Wed, 15 Jul 2015 20:15:14 +0100 Subject: [PATCH] Consistent TT replace policy 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tt.cpp b/src/tt.cpp index d0e2d729..c94dae53 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -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]; -- 2.39.2