From 7857096f39e16619a42ee85b4aa593abd846b74a Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Wed, 26 Aug 2026 11:50:25 -0700 Subject: Replace ctx->uPositional with a data-calibrated Eval() return value. uPositional was a per-thread EWMA of abs(material - true score) used to size lazy-eval and futility margins. It was history-derived (reflecting whatever recent, unrelated positions looked like) rather than derived from the position actually being margined, and its update/consumption was tangled with EVAL_HASH (now disabled). Eval() now takes an optional SCORE *piPositional out-param and fills it in on every return path: exact (abs(material-delta)) on a full eval, or an estimate from a new EstimatePositionalScore() on a lazy exit. EstimatePositionalScore()'s two terms (king-safety-defect-bucketed, and a flat residual for mobility/passers/everything else) are calibrated from ~1.6M measured full-eval samples (p90 of the actual swing), not guessed -- an initial guessed version measurably regressed ECM solve rate (630 vs a 650 baseline at sn=4M); the recalibrated version is back at parity (649/879). search.c's qsearch futility now reads the value Eval() just computed instead of the stale/shared ctx field. Also removes QSearchInDangerNoStandPat and SideCanStandPat, dead since the danger-hash check that fed them was already commented out (e08387a) -- they depended on the same enprise/ trapped-piece data this conversation is about to move off of g_PositionHash entirely. Co-Authored-By: Claude Sonnet 5 --- src/poshash.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/poshash.c') diff --git a/src/poshash.c b/src/poshash.c index 19d10ab..d8b4fcd 100644 --- a/src/poshash.c +++ b/src/poshash.c @@ -185,28 +185,6 @@ GetTrappedPiece(POSITION *pos, ULONG uSide) return c; } -FLAG -SideCanStandPat(POSITION *pos, ULONG uSide) -{ - UINT64 u64Sig = PositionToSignatureIgnoringMove(pos); - ULONG uEntry = PositionSigToHashPosition(u64Sig); - POSITION_HASH_ENTRY *pHash = &(g_PositionHash[uEntry]); - FLAG fStand = TRUE; -#ifdef MP - ULONG uLock = HashPositionToLockNumber(uEntry); - LOCK_POSITION_HASH(uLock); -#endif - if (pHash->u64Sig == u64Sig) - { - fStand = ((pHash->cTrapped[uSide] == ILLEGAL_COOR) && - (pHash->uEnpriseCount[uSide] < 2)); - } -#ifdef MP - UNLOCK_POSITION_HASH(uLock); -#endif - return fStand; -} - ULONG ValueOfMaterialInTroubleDespiteMove(POSITION *pos, ULONG uSide) { -- cgit v1.3