From d9f3d0f15f341a0b7edb2a1fbb9fe39530fc094b Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 6 Aug 2025 23:29:31 +0200 Subject: [PATCH] preventing rfp when tt hit | bench 10038648 --- source/search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 3541070..8fe9995 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -368,11 +368,11 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if constexpr (!isPV) { if (ttHit) { - if (entry->depth >= depth && + if (entry->depth >= depth && ((entry->nodeType == PV) || (entry->nodeType == AllNode && entry->score <= alpha) || (entry->nodeType == CutNode && entry->score >= beta))) { - + return SearchResults(entry->score, entry->bestMove); } } @@ -399,7 +399,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (ply) { // Reverse Futility Pruning int margin = 100 * (depth - improving); - if (staticEval - margin >= beta && depth < 7) { + if (!ttHit && staticEval - margin >= beta && depth < 7) { return (beta + (staticEval - beta) / 3); }