Repository navigation
CNP node: an evaluation's quiet line and piece values (quiet, pieces, searchScore) - #244
Merged
Merged
Conversation
… searchScore) cb2026 searches with its network, but engine/evaluate breaks down the hand-crafted evaluation, which ordered three reported lines as the search did in 0 of 10 positions (the network: 5 of 10). CNP now lets a node say more (cjus/chess-node-protocol#21), for Solrac's Engine Mind (cjus/chessgui#340): - Engine::quiet_line: the quiescence search alone, from a position, as at a leaf. A line can end mid-exchange (2 in 30), and its score comes from where these captures stop. With quiet, the node evaluates there. - Engine::search_evaluation: the static score the search would use, the network's or, in the endings it leaves to it, the hand-crafted one's. Sent as searchScore when it is the network's. - Engine::piece_values: each piece's value to that evaluation, the score less the score without the piece. The network's through Changes::removing, which takes a piece's row off the accumulator, so a position no FEN allows (a side not to move left in check) still has an answer; the hand-crafted evaluation's through a position without the piece, leaving out those. - The node answers evaluate with an engine of its own (1 MB table), cleared before each request, so an answer doesn't depend on a running search. CNP pinned to 3791c23 (cnp and cnp-conformance), which adds the two sessions: cb2026 passes evaluate-quiet-pieces and skips the one for nodes without it. No functional change: the search is untouched (Searcher::hand_crafted_ending now calls a shared function with the same test), and evaluate changes no engine state a search uses. Bench: 767812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
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, Solrac's Engine Mind ("why this move"), which needs cb2026 to explain the score its search really uses. CNP gained the fields in cjus/chess-node-protocol#21, and this PR pins CNP to its merge,
3791c23.Why
cb2026 searches with its network, but
engine/evaluatebreaks down the hand-crafted evaluation. Measured at the ends of 30 reported lines (data in cjus/chessgui#340):What
Engine::quiet_line: the quiescence search alone, from a position, as at a leaf of the main search. Withquiet, the node evaluates where its line stops. A capture the side to move needn't make is left alone, as at a leaf.Engine::search_evaluation: the static score the search would use for a position: the network's, or the hand-crafted evaluation's in the endings left to it (lone_king,pawnless_endings) or withnnueoff. The node sends it assearchScorewhen it is the network's.Engine::piece_values: each piece but the kings, valued as that evaluation's score less its score without the piece.Changes::removing, which takes a piece's row off the accumulator. A position no FEN allows (the side not to move left in check) still gets an answer.evalshows (GPL: only the idea, no code).engine/evaluatewith an evaluator engine of its own (1 MB table), cleared before each request. Answers repeat exactly, whether or not a search is running.quiet, a side checkmated where the captures stop is{"mate": 0}, with nosearchScoreorpieces. A plain evaluation stays static, as before.docs/status.mdanddocs/PRD.mdupdated.The spec's example is this node's real answer (after 1.e4 d5 2.exd5):
quiet: ["d8d5"], hand-crafted −17, network +34, and the queens on d1 and d5 and the bishop on f1 worth 918, 912 and 338 to the network. A test checks it (an_evaluation_settles_captures_and_values_pieces_by_the_network).Checked
main. The search is untouched:Searcher::hand_crafted_endingnow calls a shared function with the same test.scripts/check.shpassed on87e6192(fmt, clippy with and withoutgpu, every test, perft, docs,cargo deny, the book).db0c629is the same tree, with only theBench:line added to its message.evaluate-quiet-piecesand skipsevaluate-quiet-pieces-unsupported, which is for nodes without these capabilities (crates/cli/tests/cnp.rs).🤖 Generated with Claude Code