Skip to content

Engine: following the root (engine/root, rootMs, capability root) - #23

Merged
cjus merged 3 commits into
mainfrom
claude/root
Nov 2, 2026
Merged

cjus merged 3 commits into
mainfrom
claude/root

Conversation

@cjus

@cjus cjus commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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

  • Capability root (6.2), and rootMs on engine/search (7.1): send engine/root at most this often.
  • engine/root (new 7.9), a notification from the node: which root move a search is on (move, number, of, its depth and, with several lines, multipv), the line's best so far, moves (every root move searched so far and the nodes below it, all depths and lines together), nodes and timeMs. A research comes at once, without waiting for rootMs, 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 bound lower / upper): the depth's score fell outside its aspiration window, and the depth is searched again wider.
      UCI's currmove, currmovenumber, lowerbound and upperbound say the same. It is throttled apart from engine/progress. A node MAY follow its root on one thread only, and then moves holds that thread's counts, while nodes counts 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 a research kind it doesn't know.
  • An example from cb2026's search of 7.1's position (d4 leads depth 15; Bb5 beats it on its quick search at depth 16, and the next notification's best shows the second search confirmed it), and the entry in 14 Changes.

The crate

cnp::engine::Root (engine/root), RootParams, RootMove, and RootResearch (Better, FailHigh, FailLow, plus Unknown for a later version's kinds, as DecisionKind has); SearchParams::root_ms with a root_ms() builder; EngineCapabilities::root. Round trips are in tests/messages.rs, and the spec's example is parsed in tests/spec_examples.rs.

Conformance

  • engine/root.jsonl: a search with rootMs gets a well-formed engine/root with its id before its result, and none after.
  • engine/root-multipv.jsonl: with two lines, each engine/root names its line.
  • engine/root-unsupported.jsonl: rootMs to a node without root is Unsupported.
  • A new session step, {"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 in conformance/README.md and session.rs, and tested in cnp-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: root and root-multipv pass, and root-unsupported is skipped, since cb2026 offers root.

Checks

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test, RUSTDOCFLAGS=-D\ warnings cargo doc --workspace --no-deps and cargo deny check pass locally.

🤖 Generated with Claude Code

cjus and others added 3 commits November 1, 2026 19:10
…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>
@cjus
cjus marked this pull request as ready for review November 2, 2026 02:26
@cjus
cjus merged commit 6274420 into main Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant