From 1509b3e593258690cbe3eee761a54f105111fc72 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 28 Aug 2026 20:41:48 -0700 Subject: Rewire GetMoveFailHighPercentage: index by (cFrom, cTo, pMoved) instead of (cFrom, cTo, color), and expose sample size. MOVE_TO_INDEX (used elsewhere for the counter-move table) folds any two moves with the same from/to/color into one fail-high bucket -- e.g. a king shuffle and a queen sac to the same square/color shared a slot. New MOVE_TO_FH_INDEX uses the low 20 bits of mv.uMove (cFrom+cTo+pMoved), which already encodes color in pMoved's low bit, so this is strictly more granular for free. Table grown 0x20000 -> 0x100000 entries to match. Also adds an optional ULONG *puAttempts out-param so future callers can weight by sample confidence instead of trusting a percentage computed from as few as one observation. GetLMRReduction (proto-LMR, live at HEAD) is the only real consumer right now; verified against head_reference at sd10 across ecm_ringers/ecm_confident_quick/ecm_hard_quick: net +2 solves (88 vs 87 on confident_quick, 18 vs 17 on hard_quick), node counts flat within noise (-1.5%/+1.4%/+0.5%). --- src/searchsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/searchsup.c') diff --git a/src/searchsup.c b/src/searchsup.c index b532d9a..5673bbe 100644 --- a/src/searchsup.c +++ b/src/searchsup.c @@ -227,7 +227,7 @@ Return value: ((ctx->uPly < 3) || (!IS_SAME_MOVE(mv, ctx->mvKiller[ctx->uPly-3][0]) && !IS_SAME_MOVE(mv, ctx->mvKiller[ctx->uPly-3][1]))) && - (GetMoveFailHighPercentage(mv) <= 10)) + (GetMoveFailHighPercentage(mv, NULL) <= 10)) { ASSERT(!InCheck(&ctx->sPosition, ctx->sPosition.uToMove)); return(-ONE_PLY); -- cgit v1.3