Repository navigation
Delete the target model's serialize-source edge; the rules row is the sole authority - #12576
Merged
Merged
Conversation
… sole authority Every TargetModel bundle carried ^target_model_edge_serialize_source: a second encoding of its rules row's token sequence (plus a source-text binding and a production name). Its only reader in the corpus was v2.compiler.target_serialize grammar_inverse_source_validated, which on every emit walked it for well_formed and zip_eq'd its tokens against the row -- proving two encodings of one fact agree. No ingest, coercion or Rust seed path reads the edge or its fields. Delete-first (DESIGN 3, replacement migrations): the edge, its per-language builders (81 declarations across bash, bash_command_fold, c, cpp, dag, ecmascript, english, go, java, kotlin, python, rust, rust_test_fixtures, rust_wire_serde, swift, typescript, wasm, formats.sql_target, formats.sql_create_table_fold, gha_workflow_yaml_fold), the check and its matcher. With no second list, "serialize source disagrees with its row" has no constructor (DESIGN 4b rung 4). Row-derivation refusals keep executing REDs (ts_lhs_exact_arrow_emitted_rejects, bash_emit_lhs_exact_arrow_emitted_rejects, ts_task_derive_row_surplus_conj_slot_rejects); a row whose tokens field is missing still refuses in the serializer. Emitted bytes are unchanged against main (dark-install, apply, retract scripts and a quoting-edge argv). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot
pushed a commit
that referenced
this pull request
Sep 29, 2026
…e five claims #12576 deleted (review 72700) 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.
Why
While re-deriving the generic serializer's per-emit cost for #12482, I found that every
TargetModelbundle carried^target_model_edge_serialize_source. It is a second encoding of its rules row's token sequence, plus a source-text binding and a production name. Its only reader in the corpus wasv2.compiler.target_serializegrammar_inverse_source_validated. On every emit that function walked the serialize source forwell_formedandzip_eq'd its tokens against the row: it proved that two encodings of one fact agree.Census (before cutting): the ingest, coercion and seed paths do not read it. No
.dagreads the edge or itsserialize_source_field_*sub-fields other than that check, and no.rsfile names either.This is the design proud-deer-538 approved: delete-first, a single PR, and the row as the sole authority. With no second list to disagree with, "serialize source disagrees with its row" has no constructor (§4b rung 4).
What changed
Deleted:
grammar_inverse_source_validatedandgrammar_serialize_source_matches_row, with their helpers;Signatures: the bundle constructors that took the serialize source as a parameter lose it:
bash_target_model_bundle,sql_target_model_bundle,rust_target_model_bundleandrust_bool_fn_target_model_core_edges. The witness wrappers that only bound it are unwrapped: two in typescript, plus the sql, gha and bash-fold folds.Where each refusal went
grammar_relation_row_tokens_root.ts_lhs_exact_arrow_emitted_rejectsandbash_emit_lhs_exact_arrow_emitted_rejects: a non-conj emitted node refuses.ts_task_derive_row_surplus_conj_slot_rejects: a surplus slot refuses.translate_grammar_inverse_not_realizedis still produced by the other structural paths. No test asserted it specifically.Tests deleted or re-pointed, and why
Deleted. Each of these asserted only that the deleted check accepted its fixture; its sibling claims in the same file still assert emitted bytes equal the authority and the ingest round trip:
execution/bind_round_trip_testbind_grammar_inverse_holdsexecution/branch_if_then_else_round_trip_testbranch_if_then_else_grammar_inverse_holdsexecution/dag_add_emit_round_trip_testdag_add_grammar_inverse_holdsexecution/loop_round_trip_testloop_grammar_inverse_holdsexecution/match_bool_round_trip_testmatch_bool_grammar_inverse_holdsmanual/field_access_emit_testfield_access_grammar_inverse_holdsmanual/record_construct_emit_testrecord_construct_grammar_inverse_holdsRe-pointed:
manual/english_emit_add_testenglish_emit_add_ingest_round_trip_holdsloses only its check conjunct. Its serialize and ingest conjuncts remain.Whole file deleted:
manual/typescript_eager_materialize_serialize_test. Its only subject was that the two TypeScript serialize-source witnesses hold. The rows those witnesses were built from stay exercised by the TypeScript translate tests.Fixtures: four fixture bundles lose the edge only:
add_body_emit_typescript,add_body_value_expression_fold_typescript,ingest_bridgeandtranslate_underived_refusal.Evidence
Bytes: unchanged against 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 main's seed; the two dumps are identical. The corpus-wide gates are this PR's CI: generated drift, self-host and v2-native-cli.Cost, measured with
claim_batch --functionseval_steps, main vs this head:This is not #12482's lever. I predicted that about 40% of per-emit serialize would disappear. That figure was measured on a 79-token row. The check scales with a row's token count, and today's scripts are made of three-token rows, so the gain here is about 2%. The prediction is falsified for #12482. The change stands on §2 and §3 alone: one encoding per fact, a check that could only fail if the two encodings disagreed deleted with it, and about 1,680 lines removed.
🤖 Generated with Claude Code