From 30e54c2b713e67c66f1d37024bd0ecf13ff51585 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sat, 19 Sep 2026 21:31:08 +0200 Subject: [PATCH] 50 mr scaling | bench 1331806 --- source/search.cpp | 7 ++++++- source/tunables.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 583acb7..5457a64 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -78,7 +78,12 @@ static int AdjustEval(Board &board, SearchContext* ctx, int eval) { int mateFound = MATE_SCORE - MAX_DEPTH; - return std::clamp(eval + corrhist / CORRHIST_GRAIN, -mateFound + 1, mateFound - 1); + int adjusted = eval + corrhist / CORRHIST_GRAIN; + + const int scaleNumerator = std::max(0, fiftyMoveScaleBase - board.halfMoves); + adjusted = adjusted * scaleNumerator / fiftyMoveScaleBase; + + return std::clamp(adjusted, -mateFound + 1, mateFound - 1); } static bool IsTwoFold(Board &board, SearchContext* ctx) { diff --git a/source/tunables.h b/source/tunables.h index b5c7c9c..de47e53 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -53,7 +53,8 @@ X_INT(captHistoryBonusMultiplier, 302, 280, 320) \ X_INT(captHistoryBonusSub, 249, 235, 265) \ X_INT(captHistoryMalusMultiplier, 300, 280, 320) \ - X_INT(captHistoryMalusSub, 249, 235, 265) + X_INT(captHistoryMalusSub, 249, 235, 265) \ + X_INT(fiftyMoveScaleBase, 200, 100, 400) #ifdef TUNING #define X_DOUBLE(name, default_val, min_val, max_val) \ -- 2.47.3