From 2fd3cf0d2a05889d0b9073ab10553f05144dd80a Mon Sep 17 00:00:00 2001 From: rektdie Date: Mon, 22 Dec 2025 01:50:48 +0100 Subject: [PATCH] tt adjusted rfp | bench 4065988 --- source/search.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index d8762c5..95ac6d0 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -443,6 +443,16 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC const int staticEval = AdjustEval(board, ctx, rawEval); ctx->ss[ply].eval = staticEval; + int ttAdjustedEval = staticEval; + + if (!ctx->excluded && !board.InCheck() && entry.bestMove && + ((entry.nodeType == PV) || + (entry.nodeType == AllNode && entry.score <= staticEval) || + (entry.nodeType == CutNode && entry.score >= staticEval))) { + + ttAdjustedEval = entry.score; + } + bool corrplexity = std::abs(rawEval - staticEval) > 70; const bool improving = [&] @@ -461,8 +471,8 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (ply) { // Reverse Futility Pruning int margin = rfpBase + rfpMargin * (depth - improving); - if (!ttHit && staticEval - margin >= beta && depth < 7) { - return (beta + (staticEval - beta) / 3); + if (!ttHit && ttAdjustedEval - margin >= beta && depth < 7) { + return (beta + (ttAdjustedEval - beta) / 3); } // Razoring