From b392ac76db4d2334746a3621dd0c851679a08ca8 Mon Sep 17 00:00:00 2001 From: Nonlinear2 <131959792+Nonlinear2@users.noreply.github.com> Date: Sat, 18 Jan 2025 00:45:10 +0100 Subject: [PATCH] Increase history bonus of TT moves Passed STC: https://tests.stockfishchess.org/tests/view/678807653b8f206a2696b78b LLR: 2.96 (-2.94,2.94) <0.00,2.00> Total: 42208 W: 11113 L: 10783 D: 20312 Ptnml(0-2): 148, 4919, 10651, 5227, 159 Passed LTC: https://tests.stockfishchess.org/tests/view/6788a8463b8f206a2696b956 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 122886 W: 31454 L: 30952 D: 60480 Ptnml(0-2): 105, 13567, 33619, 14025, 127 closes https://github.com/official-stockfish/Stockfish/pull/5791 Bench: 1760081 --- src/search.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index a080daf30..5b4415462 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -119,7 +119,8 @@ void update_all_stats(const Position& pos, Square prevSq, ValueList& quietsSearched, ValueList& capturesSearched, - Depth depth); + Depth depth, + bool isTTMove); } // namespace @@ -1380,7 +1381,8 @@ moves_loop: // When in check, search starts here // If there is a move that produces search value greater than alpha, // we update the stats of searched moves. else if (bestMove) - update_all_stats(pos, ss, *this, bestMove, prevSq, quietsSearched, capturesSearched, depth); + update_all_stats(pos, ss, *this, bestMove, prevSq, quietsSearched, capturesSearched, depth, + bestMove == ttData.move); // Bonus for prior countermove that caused the fail low else if (!priorCapture && prevSq != SQ_NONE) @@ -1799,13 +1801,14 @@ void update_all_stats(const Position& pos, Square prevSq, ValueList& quietsSearched, ValueList& capturesSearched, - Depth depth) { + Depth depth, + bool isTTMove) { CapturePieceToHistory& captureHistory = workerThread.captureHistory; Piece moved_piece = pos.moved_piece(bestMove); PieceType captured; - int bonus = stat_bonus(depth); + int bonus = stat_bonus(depth) + 300 * isTTMove; int malus = stat_malus(depth); if (!pos.capture_stage(bestMove))