Skip to content

Complete the UCI implementation - #328

Merged
kirillbobyrev merged 1 commit into
mainfrom
claude/codebase-review-0hfehw
Jul 21, 2026
Merged

Complete the UCI implementation#328
kirillbobyrev merged 1 commit into
mainfrom
claude/codebase-review-0hfehw

Conversation

@kirillbobyrev

Copy link
Copy Markdown
Owner

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 ponder searches on the opponent's clock (unbounded); ponderhit switches to the engine's own clock via a small timer thread that stops the search once the move-time budget elapses. stop still aborts a ponder search immediately.
  • register. Accepted and ignored — the engine needs no registration.

Options (advertised in the handshake, 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 handles valueless button options and boolean check options, alongside the existing spin/string ones.

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.

Testing

  • 143 tests pass, incl. parser tests for the new commands/options and UCI integration tests for MultiPV (multiple ranked lines), forced-mate reporting (score mate 1 / bestmove a1a8), and ponderhit.
  • Manual: uci advertises all six options; MultiPV 3 emits three ranked lines with seldepth/hashfull; ponder→ponderhit returns a bestmove.
  • cargo clippy --all-targets --all-features zero warnings; cargo +nightly fmt --check clean.

Next in the sequence

The transmute safety cleanup (the last of the requested items).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GVrKvkMe4xDmkRAksacBzk


Generated by Claude Code

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
@kirillbobyrev
kirillbobyrev marked this pull request as ready for review July 21, 2026 04:00
@kirillbobyrev
kirillbobyrev merged commit 0d27f4b into main Jul 21, 2026
13 checks passed
@kirillbobyrev
kirillbobyrev deleted the claude/codebase-review-0hfehw branch July 21, 2026 04:00
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.

2 participants