diff options
Diffstat (limited to 'src/search.c')
| -rwxr-xr-x | src/search.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c index 02f4e85..b0bcafd 100755 --- a/src/search.c +++ b/src/search.c @@ -546,17 +546,18 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, // floor already baked into generate.c's own encoding, // not a new one). The first time a selection reveals a // move below that floor, we've hit "the rest of the - // team" -- from then on, apply a budget (borrowing - // SEARCH_SORT_LIMIT's existing table as an untuned - // starting point for this new meaning) on how many more - // full selections are worth the cost before just taking - // the remainder in place. + // team" -- from then on, apply a budget + // (NumLeftoverMovesToSelect, indexed by remaining + // depth, not distance from root -- see searchsup.c) + // on how many more full selections are worth the + // cost before just taking the remainder in place. if (TRUE == pi->fMovesRescoredByIID) { SelectBestNoHistory(ctx, x); } else if ((FALSE == fInLeftovers) || - (uLeftoverPicks < SEARCH_SORT_LIMIT(ctx->uPly))) + (uLeftoverPicks < + NumLeftoverMovesToSelect(ctx, uDepth))) { SelectBestWithHistory(ctx, x); if (FALSE == fInLeftovers) @@ -720,10 +721,21 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, // own null-move probe raised fThreat. See // lmr_testing/RESULTS.md for the individual experiments // that arrived at this checklist. + // + // Explicit leftover-only gate (fInLeftovers, set above once + // the first sub-GOOD_MOVE move is selected, true for every + // move after): every high-performer move (winning/even + // capture, killer, killer-mate) is excluded from pruning + // consideration by construction, not just as a side effect + // of the capture/check/killer exemptions above happening to + // cover the same ground. Belt-and-suspenders on purpose -- + // this is the one thing that must never be true of a move + // we skip outright. fThisMoveEFPPruned = FALSE; if ((x != 0) && (uLegalMoves > 1) && (uFutilityMargin) && + (TRUE == fInLeftovers) && (ComputeMoveScore(ctx, mv, (x - 1)) < uFutilityMargin) && (iExtend <= 0) && (!IS_ESCAPING_CHECK(mv)) && |
