diff options
| author | Scott Gasch <[email protected]> | 2026-10-05 22:20:10 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-05 22:20:10 -0700 |
| commit | 5fbd9353fa9b1a80f37bcf0339f5546ac88091b8 (patch) | |
| tree | 5ac60b40603fd8c6fd051a44a24fd0e5e21425a6 /src/search.c | |
| parent | bb7cdcda4c8c30ad0ed71d0f60427daf05977b24 (diff) | |
Cache good/bad-bishop pawn-structure score in the pawn hash
iBishopColorScore[color][complex] is a pure function of pawn placement
(own/enemy, stationary/transient) on a bishop's color complex, so it
doesn't need rescanning per-bishop -- computed once per pawn-hash miss
in _EvalPawns and reused by every bishop of that color/complex in
_EvalBishop, mirroring the same cache-the-per-structure-invariant idea
already used elsewhere in eval.c.
Also disables two speculative check-extension/futility-gating
experiments in search.c (#if 0, not deleted -- kept for reference)
that didn't hold up, and adds the BBLEFT/BBRIGHT bitboard constants
eval.c's bishop-mobility rewrite needs.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/search.c')
| -rw-r--r-- | src/search.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/search.c b/src/search.c index ccaae74..e6249b0 100644 --- a/src/search.c +++ b/src/search.c @@ -938,6 +938,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, if (MOVE_COUNT(ctx, ctx->uPly)) { // TODO: Experiment with removing these extensions. +#if 0 if (NUM_CHECKING_PIECES(ctx, ctx->uPly) > 1) { iPositionalExtend += QUARTER_PLY; @@ -948,7 +949,8 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, iPositionalExtend += QUARTER_PLY; INC(ctx->sCounters.extension.uNoLegalKingMoves); } - else if (ONE_LEGAL_MOVE(ctx, ctx->uPly) && +#endif + if (ONE_LEGAL_MOVE(ctx, ctx->uPly) && CountKingSafetyDefects(pos, pos->uToMove) > 2) { iPositionalExtend += HALF_PLY; @@ -1248,14 +1250,14 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, // extensions which are represented by iPositionalExtend). iExtend = iPositionalExtend; ComputeMoveExtension(ctx, - iAlpha, - iBeta, - (x - 1), // Note: x==0 if doing mvHash - iEval, - uDepth, - iMoveSee, - fIsLeftoverMove, - &iExtend); + iAlpha, + iBeta, + (x - 1), // Note: x==0 if doing mvHash + iEval, + uDepth, + iMoveSee, + fIsLeftoverMove, + &iExtend); ASSERT((uLegalMoves > 1) ? (x != 0) : TRUE); fMoveIsPruneReduceEligible = CanWeReduceOrPruneMove(ctx, @@ -2670,26 +2672,27 @@ _ShouldWeConsiderThisMove(IN SEARCHER_THREAD_CONTEXT *ctx, ASSERT(IS_CHECKING_MOVE(mv)); ASSERT(TRUE == fGeneratedChecks); +#if 0 // IDEA: don't play obviously losing checks if we are already // way below alpha. if (iFutility < +VALUE_BISHOP) { return(TRUE); } - { - FLAG fConsider = (GetMoveSee(ctx, mv, uMoveNum) >= 0); -#ifdef CALIBRATE_QSEARCH_FUTILITY - if (FALSE == fConsider) - { - _QFutDiagnoseReject(ctx, uMoveNum, iAlpha, iBeta, - iPositional, uPositionalSource, - QFUT_GATE_CHECK_BISHOP, - iFutility - (SCORE)VALUE_BISHOP, - fGeneratedChecks); - } #endif - return(fConsider); + FLAG fConsider = (GetMoveSee(ctx, mv, uMoveNum) >= 0); +#ifdef CALIBRATE_QSEARCH_FUTILITY + if (FALSE == fConsider) + { + _QFutDiagnoseReject(ctx, uMoveNum, iAlpha, iBeta, + iPositional, uPositionalSource, + QFUT_GATE_CHECK_BISHOP, + iFutility, // - (SCORE)VALUE_BISHOP, + fGeneratedChecks); } +#endif + return(fConsider); + } return(FALSE); } |
