From ad7041c0a4991dd13cd97e5766408e5e207178d4 Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 19 Mar 2026 23:19:06 +0100 Subject: [PATCH] changed rfp return value | bench 1735187 --- source/search.cpp | 8 +++++++- source/search.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/search.cpp b/source/search.cpp index f82e37c..f4a4717 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -226,6 +226,10 @@ static bool ShouldStop(SearchContext* ctx) { return false; } +static bool IsDecisive(int score) { + return std::abs(score) > WIN_SCORE; +} + template static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) { if (ShouldStop(ctx)) return 0; @@ -409,7 +413,9 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC // Reverse Futility Pruning int margin = rfpBase + rfpMargin * (depth - improving); if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) { - return (beta + (ttAdjustedEval - beta) / 3); + return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta) + ? ((ttAdjustedEval + beta) / 2) + : ttAdjustedEval; } // Razoring diff --git a/source/search.h b/source/search.h index 5d88379..e50f584 100644 --- a/source/search.h +++ b/source/search.h @@ -23,6 +23,7 @@ enum searchMode { constexpr int MATE_SCORE = 32767; constexpr int MAX_DEPTH = 256; constexpr int MAX_HISTORY = 16384; +constexpr int WIN_SCORE = 30000; constexpr int CORRHIST_WEIGHT_SCALE = 256; constexpr int CORRHIST_GRAIN = 256; -- 2.47.3