From f9e0f5db1a784c92ae6aff83196e3433e92e587a Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 27 Mar 2026 03:34:38 +0100 Subject: [PATCH] fix max depth crash bench: 1315668 --- source/search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 9486705..4bb4c1f 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -262,7 +262,7 @@ template static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) { if (ShouldStop(ctx)) return 0; - if (ply >= MAX_DEPTH) + if (ply + 1 >= MAX_DEPTH) return NNUE::net.Evaluate(board); if (ply > ctx->seldepth) @@ -378,7 +378,7 @@ template SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchContext* ctx, bool cutnode) { if (ShouldStop(ctx)) return 0; - if (ply >= MAX_DEPTH) + if (ply + 1 >= MAX_DEPTH) return NNUE::net.Evaluate(board); if (ply > ctx->seldepth)