Repository navigation
Engine: an evaluation's quiet line and piece values (quiet, pieces, searchScore) - #21
Merged
Merged
Conversation
…earchScore) engine/evaluate gains two optional params, each behind a capability of its own name: - quiet: settle captures first, as the search does at its leaves, and evaluate the position where they stop. A search's pv can end in the middle of an exchange, so the position it reaches isn't always where its score came from (measured with cb2026: 2 lines in 30, off by 250 to 550 cp). - pieces: what each piece but the kings is worth to the search's evaluation, the evaluation less the evaluation without the piece. An engine that searches with a neural network has no terms for it; cb2026's terms are its hand-crafted evaluation's, which ordered three lines as its search did in 0 of 10 positions. With pieces, a node also says the search's own score (searchScore) when terms break down another evaluation. Two conformance sessions: the fields, and their refusal by a node without them. For cjus/chessgui#340. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to make After 1.e4 d5 White needn't take on d5, and cb2026's quiescence search stands pat: nothing to settle. After 2.exd5 Black's queen has to take back. The spec says a capture the side to move needn't make is left alone, and its example, session and test use the recapture. The example's numbers are cb2026's own answer, from its node built against this branch. 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#340 (Engine Mind's "why this move"). Two optional params on
engine/evaluate, each behind a capability of its own name, added to the 1.0 draft.Why
Measured with cb2026 at the end of 30 reported lines (10 positions, MultiPV 3; the data is in cjus/chessgui#340):
termsexplain an evaluation the search doesn't use. cb2026 searches with an NNUE network, butengine/evaluatebreaks down its hand-crafted evaluation. At the lines' ends, that evaluation ordered the three lines as the search did in 0 of 10 positions. The network ordered them right in 5 of 10, and where a line ended quietly, its score usually equalled the search's exactly.pvcan end mid-exchange. In 2 lines of 30, the line stopped where the quiescence search took over, with a piece about to be taken back. Its static evaluation was 250–550 cp from the search's score. So the spec's advice to "evaluate the position at the end of itspv" didn't hold.What
quiet(capabilityquiet): the node plays out captures, queen promotions and evasions as its search does at a leaf, and evaluates where they stop.quietin the result lists the moves, which may be none: a capture the side to move needn't make is left alone. Withquiet, a side checkmated where the captures stop is{"mate": 0}.pieces(capabilitypieces): each piece but the kings, withsquareandvalue: what it is worth to its own side by the search's evaluation, measured by evaluating the position without it. A network has no terms, but it can be asked this. Stockfish'sevalshows the same idea.searchScore, from a node withpieces: the search's own static score, whentermsbreak down another evaluation.EvaluateParams::new,EvaluateResult::{quiet, search_score, pieces},PieceValueand the two capabilities, with tests.evaluate-quiet-pieces(no line to settle at the start, a checkmate settles into mate in 0, and each param asked alone), andevaluate-quiet-pieces-unsupported.Checked
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test,cargo docwith-D warningsandcargo deny checkpass locally.Breaking for struct literals:
EvaluateParams { position }needsEvaluateParams::new(position), and anEvaluateResultliteral needs the three new fields. cb2026's and Solrac's pin bumps make those changes.🤖 Generated with Claude Code