From ef4751f50fcc6d588f29ec498eba102af5c86c56 Mon Sep 17 00:00:00 2001 From: dhb <1084714805@qq.com> Date: Mon, 14 Oct 2024 02:55:14 +0800 Subject: [PATCH] evaluate leaf value before vcf test f15 --- Rapfi/search/ab/search.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Rapfi/search/ab/search.cpp b/Rapfi/search/ab/search.cpp index d9f78e6..f3c4a64 100644 --- a/Rapfi/search/ab/search.cpp +++ b/Rapfi/search/ab/search.cpp @@ -640,6 +640,17 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth // Dive into vcf search when the depth reaches zero (~17 elo) if (depth <= 0.0f) { + Value leafValue = Evaluation::evaluate(board, alpha, beta); + + // Update bound using standing pat + if (oppo5) + beta = std::min(beta, leafValue); + else + alpha = std::max(alpha, leafValue); + // Prune directly if the value is already outside the window + if (alpha >= beta) + return alpha; + return oppo5 ? vcfdefend(board, ss, alpha, beta) : vcfsearch(board, ss, alpha, beta); }