summaryrefslogtreecommitdiff
path: root/src/compiler.h
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-09-11 08:17:43 -0700
committerScott Gasch <[email protected]>2026-09-11 08:17:43 -0700
commitddf932b885e08a47c88a66c3888f127f1c9d31c2 (patch)
treebc9e390917204645c41d2f543bd3aad13f7105cc /src/compiler.h
parent5f43bcffff123924099d061d475b2de4ed3f65e3 (diff)
CommonSearchInit: stop returning an unearned fail-high on give-up,
check draws before bailing, cache pi->iEval consistently, and delete the now-fully-inlined GetRoughEvalScore wrapper. - searchsup.c: the "too deep" bailout (MAX_PLY_PER_SEARCH-1 array ceiling or g_uHardExtendLimit, the latter now reachable much sooner given the tightened extension taper landed in the previous commit) used to unconditionally return *piBeta -- an unearned fail-high claim ("this line is at least beta") with zero evidence behind it, right at the moment the search is giving up because it ran out of room to determine anything. Now returns a fail-low (*piAlpha, the honest "couldn't prove this helps" posture every other give-up path in the engine already uses) when in check, or a real Eval() call (matching normal QSearch's own stand-pat convention) when not -- never Eval() while in check, since that's exactly what QSearchFromCheckNoStandPat's whole design exists to avoid trusting. Split the ply-limit vs. qsearch-extend-limit triggers into separate counters (u64TooDeepPlyLimit / u64TooDeepQsearchExtendLimit, now in root.c's per-search report) to see which is actually firing -- confirmed live it's essentially all the latter now, not the rare array-safety case. - searchsup.c: moved the IsDraw() check to run before the too-deep bailout, not after -- a position can be simultaneously "too deep" and genuinely drawn (repetition/50-move), and a draw is a known, exact fact about the position, not an estimate; it was strictly worse to throw that away for an alpha/Eval() approximation just because the search also happened to run out of room at that node. - search.c/searchsup.c/root.c: pi->iEval now gets cached consistently everywhere a real Eval() call is made for a node (the too-deep fallback, normal QSearch's stand-pat, and GetRoughEvalScore's former call sites) -- was previously only set in the main Search() function, leaving stale/uninitialized values in other paths. - chess.h/evalhash.c/root.c/search.c: deleted GetRoughEvalScore -- already a one-line pass-through to Eval() (fUseHash unused, kept only "for call-site compatibility" per its own header comment from an earlier cleanup that gutted its real logic) -- inlined at both call sites instead of keeping a pointless indirection layer. evalhash.c's only content was this function; deleted the file too and dropped it from GNUmakefile's OBJS. Validated: precommit_check.sh passing; overnight self-play (match_play.py --st 1) against HEAD came back ~even. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TBtwX9aPrvwiM3gh4VnnZi
Diffstat (limited to 'src/compiler.h')
0 files changed, 0 insertions, 0 deletions