diff options
| author | Scott Gasch <[email protected]> | 2026-08-23 11:28:49 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-08-23 11:28:49 -0700 |
| commit | df8facc22815f9eca0897e27ccce30701ba95322 (patch) | |
| tree | bf90ad7ff19383fbac9b0a163f31bf3a9fb11fbe /src/eval.c | |
| parent | dc0c9dbf405095a6483705b153f4c85c64499d4e (diff) | |
Clean X64 build and ported GetAttacks to x64.
Diffstat (limited to 'src/eval.c')
| -rwxr-xr-x | src/eval.c | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -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: |
