From ab83d320b87f75de6ff01999193ec3f223b10fb2 Mon Sep 17 00:00:00 2001 From: Styx <164851643+styxdoto@users.noreply.github.com> Date: Sun, 27 Jul 2025 17:45:54 -0700 Subject: [PATCH] Simplify NMP condition As this is tried only for cutNode, and all children of cutNodes will be nonCutNodes, the guard condition is redundant. Simplification just removes the unnecessary condition (always true). closes https://github.com/official-stockfish/Stockfish/pull/6187 No functional change --- AUTHORS | 1 + src/search.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 76b4f71ca..273cab33b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -231,6 +231,7 @@ Stefano Di Martino (StefanoD) Steinar Gunderson (sesse) Stéphane Nicolet (snicolet) Stephen Touset (stouset) +Styx (styxdoto) Syine Mineta (MinetaS) Taras Vuk (TarasVuk) Thanar2 diff --git a/src/search.cpp b/src/search.cpp index b0efea869..71a46ea7b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -856,10 +856,11 @@ Value Search::Worker::search( } // Step 9. Null move search with verification search - if (cutNode && (ss - 1)->currentMove != Move::null() - && ss->staticEval >= beta - 19 * depth + 403 && !excludedMove && pos.non_pawn_material(us) - && ss->ply >= nmpMinPly && !is_loss(beta)) + if (cutNode && ss->staticEval >= beta - 19 * depth + 403 && !excludedMove + && pos.non_pawn_material(us) && ss->ply >= nmpMinPly && !is_loss(beta)) { + assert((ss - 1)->currentMove != Move::null()); + // Null move dynamic reduction based on depth Depth R = 7 + depth / 3;