From fa48fedaccc49ed00f9c72bf84a9b32754556137 Mon Sep 17 00:00:00 2001 From: cj5716 <125858804+cj5716@users.noreply.github.com> Date: Wed, 10 Jan 2024 07:12:49 +0800 Subject: [PATCH] Small simplifications (#300) Also makes certain behaviours explicit Bench: 7592451 --- src/nnue.cpp | 21 +++++++++------------ src/search.cpp | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/nnue.cpp b/src/nnue.cpp index 32f0b45b..35c8b04c 100644 --- a/src/nnue.cpp +++ b/src/nnue.cpp @@ -90,26 +90,23 @@ void NNUE::update(NNUE::accumulator& board_accumulator, std::vector (bestScore + 53 + 2 * newDepth); + const bool doDeeperSearch = depthReduction && score > (bestScore + 53 + 2 * newDepth); score = -Negamax(-alpha - 1, -alpha, newDepth + doDeeperSearch, !cutNode, td, ss + 1); if (depthReduction) { @@ -646,7 +646,7 @@ int Negamax(int alpha, int beta, int depth, const bool cutNode, S_ThreadData* td } } - // PVS Search: Search the first move and every move that produced a score better than alpha with full depth and a full window + // PVS Search: Search the first move and every move that beat alpha with full depth and a full window if (pvNode && (movesSearched == 0 || score > alpha)) score = -Negamax(-beta, -alpha, newDepth, false, td, ss + 1);