From bc8a3fddb01a3708be54e1b5453cbd13c7afaaeb Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 28 Aug 2026 21:31:52 -0700 Subject: Replace SEARCH_SORT_LIMIT's ply-indexed leftover-selection budget with NumLeftoverMovesToSelect, indexed by remaining depth; make EFP's leftover-only scope explicit. SEARCH_SORT_LIMIT[ply] was a poor proxy for what actually matters here -- how large the remaining subtree below this node is. Distance from root only correlates with that when total search depth is roughly fixed; it says nothing once extensions/reductions/iterative-deepening are in play. NumLeftoverMovesToSelect(ctx, uDepth) uses remaining depth instead, only ever consulted once every high-performer move (winning/ even capture, killer, killer-mate -- anything >= GOOD_MOVE) has already been exhausted; this never limits how many of *those* get selected, only how much further care to spend on the ordinary/leftover tail. Table values carried over verbatim from the old one as an untuned starting point, just reindexed. Also adds an explicit (TRUE == fInLeftovers) gate to EFP's per-move checklist (landed last commit) -- every high-performer move was already excluded as a side effect of the capture/check/killer exemptions, but this makes "EFP only ever touches leftovers" a real, direct condition rather than an emergent property of unrelated checks. Verified against HEAD (commit bb07fbd) at sd10: ecm_ringers: 9/11 -> 10/11 (+1 solve), ~flat nodes (-0.04%) ecm_confident_quick: 88/90 -> 88/90 (even), +0.43% nodes ecm_hard_quick: 15/90 -> 18/90 (+3 solves), +4.4% nodes Net +4 solves across 269 positions for a negligible node-count cost. --- src/data.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index 2631d3a..b8f631d 100755 --- a/src/data.c +++ b/src/data.c @@ -34,9 +34,6 @@ CHAR g_SwapTable[14][32][32]; VECTOR_DELTA g_VectorDelta[256]; VECTOR_DELTA *g_pVectorDelta = &(g_VectorDelta[128]); -// How many generated moves should we bother to sort -ULONG g_uSearchSortLimits[MAX_PLY_PER_SEARCH]; - // Hardcoded move patterns to terminate PVs with MOVE NULLMOVE = {0}; MOVE HASHMOVE = {0x11118888}; @@ -182,36 +179,6 @@ VerifyVectorDelta(void) } } -void -InitializeSearchDepthArray(void) -{ - ULONG x; - - for (x = 0; - x < ARRAY_LENGTH(g_uSearchSortLimits); - x++) - { - g_uSearchSortLimits[x] = 5; - } - g_uSearchSortLimits[0] = 0; - g_uSearchSortLimits[1] = 17; - g_uSearchSortLimits[2] = 12; - g_uSearchSortLimits[3] = 9; - g_uSearchSortLimits[4] = 7; - g_uSearchSortLimits[5] = 6; -} - -#ifdef DEBUG -ULONG -GetSearchSortLimit(ULONG uPly) -{ - ASSERT(uPly > 0); - ASSERT(uPly < MAX_PLY_PER_SEARCH); - ASSERT(g_uSearchSortLimits[uPly] != 0); - return(g_uSearchSortLimits[uPly]); -} -#endif - void InitializeWhiteSquaresTable(void) { -- cgit v1.3