Repository navigation
Engine: following the root (engine/root, rootMs, capability root) - #23
Merged
Merged
Conversation
…oot) RootParams says which root move a search is on (move, number, of, its line and depth), the best so far, the nodes each root move has had, and, at once, a RootResearch: a later move searched again to see whether it is the new best (better), or a depth's score above or below its aspiration window (failHigh, failLow, with the bounded score). For Solrac's Engine Mind (cjus/chessgui#357). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions The sessions check a search that follows its root gets engine/root before its result and none after, that each names its line when there are several, and that a node without root refuses rootMs. A session's new forbid step says a message must not come: from that step on, one matching its pattern fails the session, even a notification that would be skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A search of 7.1's position followed at its root: d4 leads depth 15, Bb5 beats it on its quick search at depth 16 and is searched again, and the next notification's best says the second search confirmed it. 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.
Following a search's root, for the live search of Solrac's Engine Mind (cjus/chessgui#357, pillar 3). A minor addition to 1.0's draft: an optional field, a notification and a capability.
What it adds
root(6.2), androotMsonengine/search(7.1): sendengine/rootat most this often.engine/root(new 7.9), a notification from the node: which root move a search is on (move,number,of, itsdepthand, with several lines,multipv), the line'sbestso far,moves(every root move searched so far and the nodes below it, all depths and lines together),nodesandtimeMs. Aresearchcomes at once, without waiting forrootMs, and restarts the interval:better(move): a later root move beat the best on its null-window search and is searched again in full;failHigh/failLow(score, with boundlower/upper): the depth's score fell outside its aspiration window, and the depth is searched again wider.UCI's
currmove,currmovenumber,lowerboundandupperboundsay the same. It is throttled apart fromengine/progress. A node MAY follow its root on one thread only, and thenmovesholds that thread's counts, whilenodescounts every thread. A node MUST send at least one before the result of a search that searched a root move, and never after the result. A client ignores aresearchkind it doesn't know.bestshows the second search confirmed it), and the entry in 14 Changes.The crate
cnp::engine::Root(engine/root),RootParams,RootMove, andRootResearch(Better,FailHigh,FailLow, plusUnknownfor a later version's kinds, asDecisionKindhas);SearchParams::root_mswith aroot_ms()builder;EngineCapabilities::root. Round trips are intests/messages.rs, and the spec's example is parsed intests/spec_examples.rs.Conformance
engine/root.jsonl: a search withrootMsgets a well-formedengine/rootwith its id before its result, and none after.engine/root-multipv.jsonl: with two lines, eachengine/rootnames its line.engine/root-unsupported.jsonl:rootMsto a node withoutrootisUnsupported.{"forbid": pattern}: from that step on, a message that matches fails the session, even a notification that would otherwise be skipped. Without it a session couldn't check "none after the result". It is documented inconformance/README.mdandsession.rs, and tested incnp-conformance/tests/runner.rs.cb2026 implements it in a PR that follows this one. Its conformance test runs all three sessions against the real binary:
rootandroot-multipvpass, androot-unsupportedis skipped, since cb2026 offersroot.Checks
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test,RUSTDOCFLAGS=-D\ warnings cargo doc --workspace --no-depsandcargo deny checkpass locally.🤖 Generated with Claude Code