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/searchsup.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/searchsup.c')
| -rw-r--r-- | src/searchsup.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/searchsup.c b/src/searchsup.c index 9e11631..ca75c92 100644 --- a/src/searchsup.c +++ b/src/searchsup.c @@ -1267,15 +1267,16 @@ Return value: BITV bvFlags; ASSERT(IS_CHECKING_MOVE(mv) || (mv.pCaptured != NULL)); - if (uMoveNum != (ULONG)-1) + if (uMoveNum == (ULONG)-1) { - ASSERT(uMoveNum < MAX_MOVE_STACK); - ASSERT(IS_SAME_MOVE(mv, ctx->sMoveStack.mvf[uMoveNum].mv)); - bvFlags = ctx->sMoveStack.mvf[uMoveNum].bvFlags; - if (bvFlags & MVF_SEE_KNOWN) - { - return((bvFlags & MVF_SEE_NONNEGATIVE) ? 0 : -1); - } + return(SeeFastSign(&ctx->sPosition, mv) ? 0 : -1); + } + ASSERT(uMoveNum < MAX_MOVE_STACK); + ASSERT(IS_SAME_MOVE(mv, ctx->sMoveStack.mvf[uMoveNum].mv)); + bvFlags = ctx->sMoveStack.mvf[uMoveNum].bvFlags; + if (bvFlags & MVF_SEE_KNOWN) + { + return((bvFlags & MVF_SEE_NONNEGATIVE) ? 0 : -1); } return(SeeFastSign(&ctx->sPosition, mv) ? 0 : -1); } @@ -2393,9 +2394,11 @@ TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, { ASSERT(GET_COLOR(mv.pCaptured) == FLIP(pos->uToMove)); ASSERT(mv.pCaptured == pos->rgSquare[mv.cTo].pPiece); + // Victim belongs to FLIP(pos->uToMove) here, i.e. the // mover at ctx->uPly - 1 (see RecordEnprisePieceAtPly). RecordEnprisePieceAtPly(ctx, ctx->uPly - 1, mv.cTo); +#if 0 mvRef = ctx->mvNullmoveRefutations[ctx->uPly - 2]; if ((mvRef.uMove) && (mvRef.pCaptured == mv.pCaptured) && @@ -2410,6 +2413,7 @@ TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, *piOrigExtend += _bm_by_piece[PIECE_TYPE(mv.pCaptured)]; INC(ctx->sCounters.extension.uBotvinnikMarkoff); } +#endif ctx->mvNullmoveRefutations[ctx->uPly] = mv; } else if (!IS_CAPTURE_OR_PROMOTION(mv)) |
