From 2b4926e091cb423d34447b9f995578b4da74906b Mon Sep 17 00:00:00 2001 From: Shawn Xu Date: Mon, 31 Mar 2025 21:33:40 -0700 Subject: [PATCH] Simplify TT Move History Part 1 passed Non-regression STC: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 195552 W: 50394 L: 50349 D: 94809 Ptnml(0-2): 581, 23222, 50122, 23273, 578 https://tests.stockfishchess.org/tests/view/67eb6ea831d7cf8afdc44c30 Part 2 passed Non-regression STC: LLR: 2.92 (-2.94,2.94) <-1.75,0.25> Total: 181664 W: 46786 L: 46727 D: 88151 Ptnml(0-2): 517, 21403, 46974, 21380, 558 https://tests.stockfishchess.org/tests/view/67eb6f3331d7cf8afdc44c33 Passed Non-regression LTC: LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 155454 W: 39496 L: 39412 D: 76546 Ptnml(0-2): 77, 16950, 43580, 17052, 68 https://tests.stockfishchess.org/tests/view/67eee76531d7cf8afdc45358 Passed Non-regression VLTC: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 118266 W: 30263 L: 30148 D: 57855 Ptnml(0-2): 11, 11844, 35309, 11957, 12 https://tests.stockfishchess.org/tests/view/67f2414a31d7cf8afdc45760 closes https://github.com/official-stockfish/Stockfish/pull/5987 Bench: 1792850 --- src/history.h | 2 +- src/search.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/history.h b/src/history.h index f2ef7661f..259d6eefb 100644 --- a/src/history.h +++ b/src/history.h @@ -166,7 +166,7 @@ struct CorrHistTypedef { template using CorrectionHistory = typename Detail::CorrHistTypedef::type; -using TTMoveHistory = Stats; +using TTMoveHistory = StatsEntry; } // namespace Stockfish diff --git a/src/search.cpp b/src/search.cpp index 3f24f86c5..0fecbce65 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -579,7 +579,7 @@ void Search::Worker::clear() { minorPieceCorrectionHistory.fill(0); nonPawnCorrectionHistory.fill(0); - ttMoveHistory.fill(0); + ttMoveHistory = 0; for (auto& to : continuationCorrectionHistory) for (auto& h : to) @@ -1151,10 +1151,10 @@ moves_loop: // When in check, search starts here if (value < singularBeta) { - int corrValAdj1 = std::abs(correctionValue) / 248873; - int corrValAdj2 = std::abs(correctionValue) / 255331; - int doubleMargin = 262 * PvNode - 188 * !ttCapture - corrValAdj1 - - ttMoveHistory[pawn_structure_index(pos)][us] / 128; + int corrValAdj1 = std::abs(correctionValue) / 248873; + int corrValAdj2 = std::abs(correctionValue) / 255331; + int doubleMargin = + 262 * PvNode - 188 * !ttCapture - corrValAdj1 - ttMoveHistory / 128; int tripleMargin = 88 + 265 * PvNode - 256 * !ttCapture + 93 * ss->ttPv - corrValAdj2; @@ -1450,8 +1450,8 @@ moves_loop: // When in check, search starts here bestMove == ttData.move, moveCount); if (!PvNode) { - int bonus = (ttData.move == move) ? 800 : -600 * moveCount; - ttMoveHistory[pawn_structure_index(pos)][us] << bonus; + int bonus = (ttData.move == move) ? 800 : -870; + ttMoveHistory << bonus; } }