roundtrip-derived-piece-codec
The groupant beside tools/roundtrip/src/blocks/site_code.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | syntax.json |
| composition | partial | composition |
| cost | symbolic source derived | invariant-and-cost |
| descriptant | present | descriptant |
| invariant | partial | invariant-and-cost |
| tests | executed bounded checks | tests |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
reference_priority | reference_priority | partial source derived model | reference_priority |
lcs_tie | lcs_tie | partial source derived model | lcs_tie |
tree_acceptance | tree_acceptance | partial source derived model | tree_acceptance |
damage_eligibility | damage_eligibility | partial source derived model | damage_eligibility |
Parts
Model text
descriptant
Description and epoch memory
find_sentence chooses exact block then Given/Unparsed then nonempty span then literal. CoNLL-U encoder compares aligned token rows and stores fields; decoder re-annotates using same resources. tree_words validates sequential ids, known relations, heads and acyclicity. Chain holds continuation/fresh readings; table chooses minimum script_bits among reset/short alternatives with strict tie retention. script computes LCS with insertion tie. damage removes first stored item; run compares decoded pieces and clears exact_ok on first difference.
Epoch 2026-10-31
Prospective model retained externally before edits. Existing production bytes preserved; only bounded inline tests appended to six owned files. Models distinguish byte reconstruction with residual from semantic understanding and persistent learning. Finite tests and compiled mutants support selected boundaries only. Source inspection identified noninjective projections and explicit admissibility restrictions; no bug repair or performance claim.
Combiner input is this source snapshot, syntax projection, models, costs and retained receipts. Proposed next epoch: target the stated unexecuted branches with bounded witnesses before expanding any claim. AST remains partial, macros opaque; no name resolution or proof.
approximant
Forward relation
find_sentence chooses exact block then Given/Unparsed then nonempty span then literal. CoNLL-U encoder compares aligned token rows and stores fields; decoder re-annotates using same resources. tree_words validates sequential ids, known relations, heads and acyclicity. Chain holds continuation/fresh readings; table chooses minimum script_bits among reset/short alternatives with strict tie retention. script computes LCS with insertion tie. damage removes first stored item; run compares decoded pieces and clears exact_ok on first difference.
Domain: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
No executable percentage surrogate is supplied: these categorical codec/effect observations have no justified lossy metric. Future caps are 1/2/5/10% only after defining metric, zero behavior and differential reference.
composition
Local composition
find_sentence chooses exact block then Given/Unparsed then nonempty span then literal. CoNLL-U encoder compares aligned token rows and stores fields; decoder re-annotates using same resources. tree_words validates sequential ids, known relations, heads and acyclicity. Chain holds continuation/fresh readings; table chooses minimum script_bits among reset/short alternatives with strict tie retention. script computes LCS with insertion tie. damage removes first stored item; run compares decoded pieces and clears exact_ok on first difference.
Children scope selected internal mechanisms by byte ranges; remaining branches are covered only by the parent partial model. Their costs are included in parent costs, not added again. Shared values and caller order are those named above; sibling fragments are tagged independent where no direct call is named.
catalog
Source-bound typed models
Each section is a partial source-derived relation on the bound snapshot and declared domain; finite checks are falsification evidence, not a universal proof. Observation horizon is one call unless history is explicitly named.
behavior_complement
Invalid ids, unknown relations, self/out-of-range heads and cycles cannot yield Some tree; multiple roots are allowed. A table tie cannot replace earlier candidate. free does not mean zero bits and permits stored comments.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
reverse_reconstruction
With fixed canonical lines and generated Script, target is unique; target alone admits many canonical/script pairs. Row patches need canonical rows to reconstruct; exact prose reference has many origin volumes. Tally aggregate cannot reconstruct codes or discourse history.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
reference_priority
First exact block outranks Given even if Given earlier in pieces; span uses first substring.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
lcs_tie
Insertion is chosen when d[i][j+1]>=d[i+1][j]; generated drop/put coordinates are monotonic.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
tree_acceptance
At least one root and terminating chains, not exactly one root; lowercase lemmas and unknown tags→X erase information.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
damage_eligibility
Tree removes first row patch/HRow patch/nonempty literal; frame puts precede drops; missing eligible item returns false.
Domain and held state: Same model/lexicon/environment at encode/decode; valid references and 10-column patches; LCS dimensions/counts fit usize/u32 and memory. Tests execute pure scripts/tree validation/reference/damage, not model-backed encoder.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
tests
Actual checks
blocks::site_code::wave32::script_fibers_and_reference_precedenceblocks::site_code::tests::line_scripts_give_the_target_backblocks::site_code::tests::a_tree_needs_known_relations_and_a_root
The listed parent/source tests exercise only their named mechanisms; other model statements are source inspection. Sixteen selected actual roundtrip library tests passed twice debug and twice release (64 exact-name executions), with identical sorted test outcomes. Eight compiled production-behavior mutants, one per source, failed assertions; exact originals were restored and the selected check passed. No assertion-only mutants or surviving compiled mutants. An initial mutation selector was ambiguous and stopped before writing that source; corrected selector retained separately.
Raw logs, numeric statuses, original/restored hashes, prospective.md, native-commands.json and syntax pairs: $MOVA_DATA/runs/octopus-wave32-rt_blocks-2026-10-31. No live model/corpus/site/learning workflow or full pipeline was executed.
invariant-and-cost
Invariants and cost
Invalid ids, unknown relations, self/out-of-range heads and cycles cannot yield Some tree; multiple roots are allowed. A table tie cannot replace earlier candidate. free does not mean zero bits and permits stored comments.
With fixed canonical lines and generated Script, target is unique; target alone admits many canonical/script pairs. Row patches need canonical rows to reconstruct; exact prose reference has many origin volumes. Tally aggregate cannot reconstruct codes or discourse history.
Cost
script O(n*m) time and memory for line counts; apply O(n log drops+output bytes). tree_words O(n²) worst-case head walks. Table selection computes four scripts; costs used for selection differ from later copier-based actual charge. Full annotation/frames costs unmeasured.
Integer additions/products and allocation sizes must fit native types. Floating costs require finite values; no throughput or all-input guarantee follows from synthetic tests.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/site_code.rs.groupant/