FP before making move | bench 768886

This commit is contained in:
rektdie committed 2025-03-26 12:42:17 +01:00
1 parent 2c1d448d8f
commit 58a3e8f792
1 file changed
+5 -6
+5 -6
View File
@@ -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)