Complete the UCI implementation - #328
Merged
Merged
Conversation
Fill in the remaining UCI protocol surface: Commands: - ponder / ponderhit: 'go ponder' searches on the opponent's clock (unbounded); 'ponderhit' switches to the engine's own clock via a timer thread that stops the search after the move-time budget. 'stop' still aborts a ponder search immediately. - register: accepted and ignored (the engine needs no registration). Options (advertised in the handshake and handled in setoption): - MultiPV (spin): report the top-N root lines. - Ponder (check): capability flag for GUIs. - Clear Hash (button): drops the reusable search tree. The setoption parser now supports valueless button options and boolean check options. info output: - seldepth (deepest simulation), hashfull (tree fill against the Hash budget), and one 'multipv i' line per reported line. - score mate N for forced checkmates (detected by replaying the PV to a checkmate position, so tablebase wins are not misreported as mates), otherwise score cp. Search config (node budget + MultiPV) is bundled into mcts::Config to keep the search signature tidy. Tests: parser tests for the new commands/options and UCI integration tests for MultiPV, forced-mate reporting, and ponderhit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVrKvkMe4xDmkRAksacBzk
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
Fourth in the sequence (after #325–#327). Fills in the remaining UCI protocol surface so the engine handles the full command/option set and emits richer analysis output.
Commands
ponder/ponderhit.go pondersearches on the opponent's clock (unbounded);ponderhitswitches to the engine's own clock via a small timer thread that stops the search once the move-time budget elapses.stopstill aborts a ponder search immediately.register. Accepted and ignored — the engine needs no registration.Options (advertised in the handshake, handled in
setoption)The
setoptionparser now handles valuelessbuttonoptions and booleancheckoptions, alongside the existing spin/string ones.infooutputseldepth(deepest simulation),hashfull(tree fill against theHashbudget), and onemultipv iline per reported line.score mate Nfor forced checkmates — detected by replaying the PV to a checkmate position, so tablebase wins are not misreported as mates — otherwisescore cp.Search config (node budget + MultiPV) is bundled into
mcts::Configto keep the search signature tidy.Testing
score mate 1/bestmove a1a8), and ponderhit.uciadvertises all six options;MultiPV 3emits three ranked lines withseldepth/hashfull; ponder→ponderhit returns a bestmove.cargo clippy --all-targets --all-featureszero warnings;cargo +nightly fmt --checkclean.Next in the sequence
The
transmutesafety cleanup (the last of the requested items).🤖 Generated with Claude Code
https://claude.ai/code/session_01GVrKvkMe4xDmkRAksacBzk
Generated by Claude Code