roundtrip-block-layout-group-and-concat
The groupant beside tools/roundtrip/src/blocks/mod.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 |
| 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 |
equal_cap | equal_cap | partial source derived model | equal_cap |
empty_input | empty_input | partial source derived model | empty_input |
offset_transport | offset_transport | partial source derived model | offset_transport |
template_fiber | template_fiber | partial source derived model | template_fiber |
Model text
descriptant
Description and epoch memory
Greedy ranges feed block_of through blocks; concat clones blocks and rebases Text indices. like independently projects template chapter ids through a last-wins map.
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
Greedy ranges feed block_of through blocks; concat clones blocks and rebases Text indices. like independently projects template chapter ids through a last-wins map.
Domain: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
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.
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
group/blocks keep each run within one group and retain every chapter. concat introduces no separators but accepts arbitrary chapter slices, including slices crossing groups. like intentionally omits unavailable ids.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
reverse_reconstruction
Keep chapter sequence plus ranges for unique block construction; text-only observation admits many segmentations; duplicate-id projection is noninjective.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
equal_cap
w+n==max does not split.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
empty_input
group([]) and blocks([]) are empty; concat([]) yields empty volume with newline separator.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
offset_transport
Each Text index increases by previous concatenated blocks length.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
template_fiber
Missing ids vanish; last duplicate source id wins and earlier versions are unrecoverable.
Domain and held state: Well-indexed volumes, valid UTF-8, representable word sums and index offsets. File adapters require readable matching files; no external corpus used.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
tests
Actual checks
blocks::wave32::grouping_and_duplicate_id_projectionblocks::tests::book_chapters_give_the_file_back_and_runs_stay_wholeblocks::tests::a_chapter_without_headings_is_cut_at_paragraphs
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
group/blocks keep each run within one group and retain every chapter. concat introduces no separators but accepts arbitrary chapter slices, including slices crossing groups. like intentionally omits unavailable ids.
Keep chapter sequence plus ranges for unique block construction; text-only observation admits many segmentations; duplicate-id projection is noninjective.
Cost
Word counting O(B), grouping O(C), map O(C log C+K log C), cloning proportional to retained bytes.
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/mod.rs.groupant/group-and-concat.groupant/