Add fixed-depth minimax to value-head search - #2434
Open
natsu0529 wants to merge 1 commit into
Open
Conversation
Add configurable full-width fixed-depth minimax while keeping depth 1 as the default. Reduce requested depth to the largest complete tree that fits the node limit, and handle terminal positions without neural evaluation. Run instamove searches asynchronously, propagate cancellation through tree construction and evaluation, and serialize UCI info/bestmove responses. Add regression tests for minimax, terminal scoring, safeguards, and stop/abort races.
natsu0529
marked this pull request as ready for review
July 31, 2026 18:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
valueheadgo depthoverrideValueHeadDepthValueHeadMaxNodesBehavior and safeguards
ValueHeadDepthdefaults to 1, so the existing default behavior is preserved.ValueHeadMaxNodesdefaults to 10000. If a requested full-width tree exceeds that limit, the search uses the deepest complete depth that fits; if even depth 1 does not fit, it returns a legal fallback move without NN evaluation.Instamove search now runs on a worker thread. Tree construction, evaluation queuing, and minimax resolution observe cancellation.
infoandbestmoveoutput are serialized so no search info is emitted after the final move.Testing
ninja -C builddirmeson test -C builddir --print-errorlogs— 9/9 test targets passedInstamoveTest— 14/14 cases passedgit diff --checkValueHeadMaxNodes=300000,go depth 4, andstopafter 10 msThe default depth remains unchanged, so this does not alter default value-head playing behavior
Related to #2176.