From 22f9e929f51764ad0fad11229500183177d963b8 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 26 Mar 2025 16:52:22 +0100 Subject: [PATCH] mate score condition + new margin | bench 684523 --- source/search.cpp | 6 +++--- source/search.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index b67aa44..31c7d2b 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -234,9 +234,9 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) { // 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 + 50 * depth; + int fpMargin = 100 * depth; if (!isPV && ply && !board.InCheck() && currMove.IsQuiet() - && depth <= 1 && staticEval + fpMargin < alpha) { + && depth <= 5 && staticEval + fpMargin < alpha && results.score > MATE_SCORE) { continue; } @@ -297,7 +297,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) { if (moveSeen == 0) { if (board.InCheck()) { // checkmate - return -99000 + ply; + return MATE_SCORE + ply; } else { // stalemate return 0; } diff --git a/source/search.h b/source/search.h index 0e92068..1490fb4 100644 --- a/source/search.h +++ b/source/search.h @@ -7,6 +7,7 @@ namespace SEARCH { +constexpr int MATE_SCORE = -99000; constexpr int maxDepth = 64; constexpr int maxHistory = 16384;