From baf0741e0dffe0ec1fe4a4a396809dff8cf5387a Mon Sep 17 00:00:00 2001 From: rektdie Date: Sun, 22 Mar 2026 10:56:47 +0100 Subject: [PATCH] lmr ttpv fail low | bench 1115526 --- source/search.cpp | 9 +++++++-- source/tunables.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index c41189b..7433bd1 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -73,7 +73,7 @@ bool IsDraw(Board &board, SearchContext* ctx) { } template -static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply, bool cutnode, bool improving, bool corrplexity, bool ttpv, SearchContext* ctx) { +static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply, bool cutnode, bool improving, bool corrplexity, bool ttpv, bool ttpvFailLow, SearchContext* ctx) { int reduction = 0; // Late Move Reduction @@ -95,6 +95,9 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int if (ttpv) reduction -= lmrTTPV; + if (ttpvFailLow) + reduction += lmrTTPVFailLow; + // History LMR int historyReduction = 0; @@ -636,7 +639,9 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC cutnode |= extension < 0; - int reductions = GetReductions(board, currMove, depth, moveSeen, ply, cutnode, improving, corrplexity, ttpv, ctx); + const bool ttpvFailLow = ttpv && ttHit && entry.score <= alpha; + + int reductions = GetReductions(board, currMove, depth, moveSeen, ply, cutnode, improving, corrplexity, ttpv, ttpvFailLow, ctx); int newDepth = depth + (copy.InCheck() && !ctx->excluded) - 1 + extension; diff --git a/source/tunables.h b/source/tunables.h index ec9fee4..8abb700 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -16,6 +16,7 @@ X_INT(lmrHistoryDivisor, 8192, 6000, 10000) \ X_INT(lmrImproving, 1024, 6000, 10000) \ X_INT(lmrCorrplexity, 1024, 6000, 10000) \ + X_INT(lmrTTPVFailLow, 1024, 6000, 10000) \ X_INT(rfpBase, 25, 50, 200) \ X_INT(rfpMargin, 100, 50, 200) \ X_INT(fpMargin, 100, 50, 200) \