From 7e2cd40581a184b2608f5a4206f18b0d208ca099 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 28 Aug 2026 11:20:50 -0700 Subject: Remove RescoreMovesViaSearch's dead same-ply recursive pre-call. Before searching its own move list, RescoreMovesViaSearch called itself recursively at an even shallower depth, at the *same* ctx->uPly, on the theory that the extra rescore's side effects (hash/killer/history table population) would help the real loop's own -Search() calls find cutoffs faster. But the recursive call's own iValue writes were always fully overwritten by this same call's loop immediately after it (same ply, same move-stack range), so the only way it could possibly help was via those side effects. Measured directly: disabling it produced a bit-identical result across all three test suites (ecm_ringers.ep_, ecm_confident_quick.ep_, ecm_hard_quick.ep_ at sn=5M) -- no change whatsoever, not even a single position. It was pure wasted search effort. Removed. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01YGSMkwjqiCk4XhbfN7ugD2 --- src/searchsup.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/searchsup.c b/src/searchsup.c index efdde67..8bc74ef 100644 --- a/src/searchsup.c +++ b/src/searchsup.c @@ -626,13 +626,20 @@ Return value: ASSERT(uDepth >= (IID_R_FACTOR + ONE_PLY)); // - // Compute next depth, possibly recurse + // Compute next depth. // + // This used to recurse here first (call itself at this same + // ctx->uPly, before the loop below), on the theory that an even + // shallower rescore's *side effects* -- hash/killer/history table + // population -- would help the loop below's own -Search() calls + // find cutoffs faster. Measured (see lmr_testing/RESULTS.md): removing + // it entirely produced a bit-identical result on all three test + // suites (ecm_ringers/confident_quick/hard_quick). Its own writes to + // iValue were always fully overwritten by this same call's loop + // right after it (same ctx->uPly, same move-stack range), so it had + // no way to help other than those side effects, and empirically it + // wasn't -- just wasted nodes. Removed. uDepth -= (IID_R_FACTOR + ONE_PLY); - if (uDepth >= (IID_R_FACTOR + ONE_PLY)) - { - (void)RescoreMovesViaSearch(ctx, uDepth, iAlpha, iBeta); - } ASSERT(uDepth < MAX_DEPTH_PER_SEARCH); // -- cgit v1.3