From 58a3e8f79245b07bc2ff457472a319adf2d8e2e3 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 26 Mar 2025 12:42:17 +0100 Subject: [PATCH] FP before making move | bench 768886 --- source/search.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index fcd8c81..3c6a61d 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -231,21 +231,20 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) { for (int i = 0; i < board.currentMoveIndex; i++) { Move currMove = board.moveList[i]; - Board copy = board; - bool isLegal = copy.MakeMove(currMove); - - if (!isLegal) continue; - // Futility pruning // If our static eval is far below alpha, there is only a small chance // that a quiet move will help us so we skip them int fpMargin = 100; if (!isPV && !board.InCheck() && currMove.IsQuiet() && depth <= 2 && staticEval + fpMargin < alpha) { - positionIndex--; continue; } + Board copy = board; + bool isLegal = copy.MakeMove(currMove); + + if (!isLegal) continue; + int reductions = GetReductions(board, currMove, depth, moveSeen, ply); // First move (suspected PV node)