From 2eb8c30e54e63de76e88f38a6132107bc4a347a1 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sun, 13 Apr 2025 21:17:50 +0200 Subject: [PATCH] added simple LMP | bench 1150841 --- source/search.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/search.cpp b/source/search.cpp index 5b6f8f3..296d31b 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -273,6 +273,19 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC for (int i = 0; i < board.currentMoveIndex; i++) { Move currMove = board.moveList[i]; + // Late move pruning + // If we are near a leaf node we prune moves + // that are late in the list + if (!isPV && ply && currMove.IsQuiet() && results.score > (-MATE_SCORE + MAX_PLY)) { + int lmpBase = 3; + + int lmpThreshold = lmpBase + depth * depth; + + if (moveSeen >= lmpThreshold) { + 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