From df8facc22815f9eca0897e27ccce30701ba95322 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sun, 23 Aug 2026 11:28:49 -0700 Subject: Clean X64 build and ported GetAttacks to x64. --- src/eval.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/eval.c') diff --git a/src/eval.c b/src/eval.c index b6a7792..48a21e0 100755 --- a/src/eval.c +++ b/src/eval.c @@ -5596,7 +5596,7 @@ Return value: // // Check the eval hash // - iScoreForSideToMove = ProbeEvalHash(ctx); + iScoreForSideToMove = ProbeEvalHash(ctx, iAlpha, iBeta); if (iScoreForSideToMove != INVALID_SCORE) { INC(ctx->sCounters.tree.u64EvalHashHits); @@ -5714,12 +5714,32 @@ Return value: // _QuicklyEstimateKingSafetyTerm(pos, &iAlphaMargin, &iBetaMargin); _QuicklyEstimatePasserBonuses(pos, pHash, &iAlphaMargin, &iBetaMargin); - - if ((iScoreForSideToMove + iAlphaMargin <= iAlpha) || - (iScoreForSideToMove - iBetaMargin >= iBeta)) + + if (iScoreForSideToMove + iAlphaMargin <= iAlpha) { ctx->uPositional = MINU(200, ctx->uPositional); INC(ctx->sCounters.tree.u64LazyEvals); +#ifdef EVAL_HASH + // + // The true eval can't reach iAlpha; that's a fact about + // the position (not this particular window), so remember + // it as a proven upper bound for reuse by later probes. + // + StoreEvalHash(ctx, iScoreForSideToMove, + (SCORE)(iScoreForSideToMove + iAlphaMargin), + EVAL_HASH_UPPER); +#endif + goto end; + } + else if (iScoreForSideToMove - iBetaMargin >= iBeta) + { + ctx->uPositional = MINU(200, ctx->uPositional); + INC(ctx->sCounters.tree.u64LazyEvals); +#ifdef EVAL_HASH + StoreEvalHash(ctx, iScoreForSideToMove, + (SCORE)(iScoreForSideToMove - iBetaMargin), + EVAL_HASH_LOWER); +#endif goto end; } } @@ -6102,7 +6122,7 @@ Return value: // // Store in eval hash. // - StoreEvalHash(ctx, iScoreForSideToMove); + StoreEvalHash(ctx, iScoreForSideToMove, 0, EVAL_HASH_EXACT); #endif end: -- cgit v1.3