From 347e328fdbe8104747a258db00a9f034e09d3cb8 Mon Sep 17 00:00:00 2001 From: Shawn Xu Date: Sun, 18 May 2025 18:36:06 -0700 Subject: [PATCH] Simplify TT Replacement Strategy Passed Non-regression STC: LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 50528 W: 13160 L: 12958 D: 24410 Ptnml(0-2): 132, 5681, 13439, 5877, 135 https://tests.stockfishchess.org/tests/view/682a8b296ec7634154f9a785 Passed Non-regression STC w/ High Hash Pressure: LLR: 2.98 (-2.94,2.94) <-1.75,0.25> Total: 30048 W: 7849 L: 7621 D: 14578 Ptnml(0-2): 75, 3390, 7884, 3582, 93 https://tests.stockfishchess.org/tests/view/682a9caf6ec7634154f9a7ae Passed Non-regression LTC w/ High Hash Pressure: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 17610 W: 4584 L: 4362 D: 8664 Ptnml(0-2): 7, 1799, 4974, 2015, 10 https://tests.stockfishchess.org/tests/view/682ab3966ec7634154f9a8c8 closes https://github.com/official-stockfish/Stockfish/pull/6079 Bench: 2422771 --- src/tt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tt.cpp b/src/tt.cpp index 5d845761..d7f7dbde 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -234,8 +234,8 @@ std::tuple TranspositionTable::probe(const Key key) cons // Find an entry to be replaced according to the replacement strategy TTEntry* replace = tte; for (int i = 1; i < ClusterSize; ++i) - if (replace->depth8 - replace->relative_age(generation8) * 2 - > tte[i].depth8 - tte[i].relative_age(generation8) * 2) + if (replace->depth8 - replace->relative_age(generation8) + > tte[i].depth8 - tte[i].relative_age(generation8)) replace = &tte[i]; return {false,