From 675f6a038ba98b6b906a4767f009cf6fe91b0c52 Mon Sep 17 00:00:00 2001 From: Stefan Geschwentner Date: Tue, 2 Aug 2022 23:14:14 +0200 Subject: [PATCH] Tweak history updates In general the history update bonus is slightly decreased by 11% which gives a slower saturation speed. In addition only for main history the divisor is halfed (used history values are doubled to maintain same maximum) which have an effect in the opposite direction on saturation speed. STC: LLR: 2.95 (-2.94,2.94) <0.00,2.50> Total: 157088 W: 42673 L: 42168 D: 72247 Ptnml(0-2): 857, 17346, 41642, 17833, 866 https://tests.stockfishchess.org/tests/view/62e5517ab383a712b13867c5 LTC: LLR: 2.94 (-2.94,2.94) <0.50,3.00> Total: 325592 W: 88705 L: 87753 D: 149134 Ptnml(0-2): 594, 32288, 96076, 33248, 590 https://tests.stockfishchess.org/tests/view/62e5e4f4b383a712b1387d53 closes https://github.com/official-stockfish/Stockfish/pull/4119 Bench: 5518728 --- src/movepick.cpp | 4 ++-- src/movepick.h | 2 +- src/search.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index b0166c6e..60d041ab 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -137,7 +137,7 @@ void MovePicker::score() { + (*captureHistory)[pos.moved_piece(m)][to_sq(m)][type_of(pos.piece_on(to_sq(m)))]; else if constexpr (Type == QUIETS) - m.value = (*mainHistory)[pos.side_to_move()][from_to(m)] + m.value = 2 * (*mainHistory)[pos.side_to_move()][from_to(m)] + 2 * (*continuationHistory[0])[pos.moved_piece(m)][to_sq(m)] + (*continuationHistory[1])[pos.moved_piece(m)][to_sq(m)] + (*continuationHistory[3])[pos.moved_piece(m)][to_sq(m)] @@ -155,7 +155,7 @@ void MovePicker::score() { m.value = PieceValue[MG][pos.piece_on(to_sq(m))] - Value(type_of(pos.moved_piece(m))); else - m.value = (*mainHistory)[pos.side_to_move()][from_to(m)] + m.value = 2 * (*mainHistory)[pos.side_to_move()][from_to(m)] + 2 * (*continuationHistory[0])[pos.moved_piece(m)][to_sq(m)] - (1 << 28); } diff --git a/src/movepick.h b/src/movepick.h index 6b3c08c7..979709ae 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -87,7 +87,7 @@ enum StatsType { NoCaptures, Captures }; /// ordering decisions. It uses 2 tables (one for each color) indexed by /// the move's from and to squares, see www.chessprogramming.org/Butterfly_Boards /// (~11 elo) -typedef Stats ButterflyHistory; +typedef Stats ButterflyHistory; /// CounterMoveHistory stores counter moves indexed by [piece][to] of the previous /// move, see www.chessprogramming.org/Countermove_Heuristic diff --git a/src/search.cpp b/src/search.cpp index 004d061b..9b747e78 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -81,7 +81,7 @@ namespace { // History and stats update bonus, based on depth int stat_bonus(Depth d) { - return std::min((9 * d + 270) * d - 311 , 2145); + return std::min((8 * d + 240) * d - 276 , 1907); } // Add a small random component to draw evaluations to avoid 3-fold blindness @@ -1033,7 +1033,7 @@ moves_loop: // When in check, search starts here && history < -3875 * (depth - 1)) continue; - history += thisThread->mainHistory[us][from_to(move)]; + history += 2 * thisThread->mainHistory[us][from_to(move)]; // Futility pruning: parent node (~9 Elo) if ( !ss->inCheck @@ -1171,7 +1171,7 @@ moves_loop: // When in check, search starts here if ((ss+1)->cutoffCnt > 3 && !PvNode) r++; - ss->statScore = thisThread->mainHistory[us][from_to(move)] + ss->statScore = 2 * thisThread->mainHistory[us][from_to(move)] + (*contHist[0])[movedPiece][to_sq(move)] + (*contHist[1])[movedPiece][to_sq(move)] + (*contHist[3])[movedPiece][to_sq(move)] -- 2.39.2