Repository navigation
CNP: search trees (engine/tree, engine/treeNode, capability tree) - #249
Merged
Merged
Conversation
cb2026's node keeps search trees for Solrac's Engine Mind (Solrac Chess AI #350), as the Chess Node Protocol's new section 7.8 defines them. - A tree is recorded by Engine::search_tree on a fresh engine and a thread of its own (its own table, one thread, the switches at their defaults), so it is answered while a search runs and is the same tree every time. One at a time; a cancel stops it and keeps nothing; the node's maxTimeMs bounds it. - cb2026_engine::tree folds the log into nodes. Each node is its last search (window, score, children, decisions), after the decisions that say how it came to be searched that way; verification searches (null move, singular) and attempts that decided nothing are left out; each decision goes to the node it is about, so the singular, double and negative extensions move from the parent to the child. - The node says each note in alpha-beta's terms (cutoff, table, tablebase, nullMove, nodePruned, movePruned, reduced, extended, research), naming the switch behind it, with mates counted from the node and each score's bound read against the window of its last search. - Trees are kept five minutes after their last use, eight and 2,000,000 nodes and decisions at most, the one unused longest dropped first; up to depth 24 and six plies, 500,000 events a recording. - search_tree takes a stop flag, and a recorded tree brackets the root's searches (not counted in the statistics), so an aspiration re-search shows. - The cnp pin moves to cjus/chess-node-protocol#22's branch (68cf80d), whose six new sessions cb2026 passes. No functional change. Bench: 767812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No functional change. Bench: 767812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No functional change. Bench: 767812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same tree as the branch's 68cf80d, now on the protocol's main. No functional change. Bench: 767812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
For cjus/chessgui#350, the search-tree panel of Solrac's Engine Mind ("why not that move?"). CNP defines the requests in cjus/chess-node-protocol#22, merged, and this PR pins
cnpandcnp-conformanceto its merge commit,deeab77.What
engine/treeandengine/treeNode(capabilitytree, spec 7.8). A tree is recorded byEngine::search_treeon a fresh engine and a thread of its own: its own 16 MB table, one thread, the switches at their defaults, the main engine's evaluation, network and tablebases. So it is answered while a search runs, and the same request gives the same tree (a test checks both). One tree at a time (maxConcurrentTrees1).$/cancelRequeststops it and it keeps nothing; the next tree isn'tBusy.maxTimeMsbounds it (LimitExceeded).engine/treeNodeis answered in the command loop, at once.cb2026_engine::tree::FoldedTreefolds the event log into nodes:TtHit,NullMove,ProbCut,SingularSearch).technique:BetaCutoff(m, i)cutoffmovemorderialphabetaTtCutofftablettTablebasetablebaseNullMoveCutoffnullMovenullmoveReverseFutility,Razoring,MultiCutnodePrunedrfp,razoring,multicutProbCutCutoff(m)nodePrunedmovemprobcutLateMovePruning,HistoryPruning,Futility,SeePruning,DeltaPruning(m)movePrunedmovemlmp,histprune,futility,seeprune,deltaReduced(_, n)reducedpliesnlmrNegativeExtensionreducedpliesnegative_extension_pliesnegextSingularExtension,DoubleExtensionextendedplies1singular,doubleextReductionResearchresearchreasondepthlmrPvsResearchresearchreasonwindowpvsresearchreasonwindow, at the rootaspirationsearch::to_score_at), and a score's bound is read against the window of its last search.search_treetakes a stop flag, so a tree can be cancelled. A recorded tree brackets the root's searches withEnterandExit, so an aspiration re-search shows. These go to the tree only, never the statistics, so nothing changes outside a recording.docs/status.mdanddocs/PRD.mdupdated.Checked
main.scripts/check.shpassed on3e0432b, this PR's latest commit (fmt, clippy with and withoutgpu, every test, perft, docs,cargo deny, the book), and GitHub'sCIpassed on it. The release node passes the six tree sessions of the protocol atdeeab77withcnp-conformance(tree-unsupportedskipped).tree-unsupported, which is for nodes without trees (crates/cli/tests/cnp.rs).🤖 Generated with Claude Code