summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-28 11:20:50 -0700
committerScott Gasch <[email protected]>2026-08-28 11:20:50 -0700
commit7e2cd40581a184b2608f5a4206f18b0d208ca099 (patch)
tree263e1548659bde6592d406b7e72198b3288577a4
parent1a0712fee7e3fa9bcf124a942d8ef15efe4578e7 (diff)
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGSMkwjqiCk4XhbfN7ugD2
-rw-r--r--src/searchsup.c17
1 files 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);
//