From a016abd6982d1f8f1b0f5175b0005c8749c0925b Mon Sep 17 00:00:00 2001 From: Nonlinear2 <131959792+Nonlinear2@users.noreply.github.com> Date: Sun, 26 Jan 2025 01:16:09 +0100 Subject: [PATCH] Decrease all stats malus according to move count Passed STC: https://tests.stockfishchess.org/tests/view/6794c4634f7de645171fb341 LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 28096 W: 7412 L: 7106 D: 13578 Ptnml(0-2): 97, 3194, 7148, 3524, 85 Passed LTC: https://tests.stockfishchess.org/tests/view/6794ea13406a4efe9eb7d06b LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 58086 W: 15049 L: 14684 D: 28353 Ptnml(0-2): 27, 6344, 15957, 6667, 48 closes https://github.com/official-stockfish/Stockfish/pull/5823 Bench: 1711170 --- src/search.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index e07c719e..7317b7e4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -125,7 +125,8 @@ void update_all_stats(const Position& pos, ValueList& quietsSearched, ValueList& capturesSearched, Depth depth, - bool isTTMove); + bool isTTMove, + int moveCount); } // namespace @@ -1372,7 +1373,7 @@ moves_loop: // When in check, search starts here // we update the stats of searched moves. else if (bestMove) update_all_stats(pos, ss, *this, bestMove, prevSq, quietsSearched, capturesSearched, depth, - bestMove == ttData.move); + bestMove == ttData.move, moveCount); // Bonus for prior countermove that caused the fail low else if (!priorCapture && prevSq != SQ_NONE) @@ -1792,14 +1793,15 @@ void update_all_stats(const Position& pos, ValueList& quietsSearched, ValueList& capturesSearched, Depth depth, - bool isTTMove) { + bool isTTMove, + int moveCount) { CapturePieceToHistory& captureHistory = workerThread.captureHistory; Piece moved_piece = pos.moved_piece(bestMove); PieceType captured; int bonus = stat_bonus(depth) + 300 * isTTMove; - int malus = stat_malus(depth); + int malus = stat_malus(depth) - 34 * (moveCount - 1); if (!pos.capture_stage(bestMove)) {