Repository navigation
Decode each serialized token once - #12570
Merged
Merged
Conversation
target_serialize token_sequence_item_kind decoded every token node
(concrete_syntax_token_from_node) only to classify it, then
token_text_from_model decoded the same node again to spell it. The
classification now carries the decoded token (TokenSequenceConcreteToken
{ token }) and std.compilers.target_model token_text_from_decoded spells
that value; token_text_from_model, whose only caller this was, is deleted.
The refusals are unchanged: a malformed token still refuses at the one
decode. Emitted bytes are unchanged (dark-install, apply, retract scripts
and a quoting-edge argv compare identical against main).
Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Small local defect found while re-deriving the generic serializer's per-token cost for #12482.
v2.compiler.target_serializetoken_sequence_item_kinddecoded every token node only to classify it, andtoken_text_from_modelthen decoded the same node again to spell it. Now the classification carries the decoded token, andstd.compilers.target_modeltoken_text_from_decodedspells it.token_text_from_modelhad no other caller and is deleted. Refusals are unchanged: a malformed token still refuses at the one decode.Bytes: identical to main. I dumped the srv1 dark-install, apply and retract scripts plus a quoting-edge argv (32,776 bytes) with
gunbc run, using a binary built from this tree.Cost:
claim_batcheval_steps, main vs this head. Dark-install render: 1,000,496 to 995,957. One-word command: 11,797 to 11,790. Eight-word command: 39,146 to 39,147. The gain is small. It is a correctness-of-shape fix (§6 bare minimum cost), not the #12482 lever. That lever is removing the per-emit target-model validation, as a separate PR.🤖 Generated with Claude Code