---
title: "roundtrip-block-layout — Mova code model"
description: "Mova code model of tools/roundtrip/src/blocks/mod.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/mod.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/mod.rs.groupant/>

# roundtrip-block-layout

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

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`tools/roundtrip/src/blocks/mod.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/roundtrip/src/blocks/mod.rs)
- **source SHA-256:** `81113918aaba6d47…`
- **repository folder:** [`tools/roundtrip/src/blocks/mod.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/roundtrip/src/blocks/mod.rs.groupant)
- **repository commit:** `855da7bd4a7b`

> **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](#approximant) |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [composition](#composition) |
| **cost** | symbolic source derived | [invariant-and-cost](#invariant-and-cost) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant-and-cost](#invariant-and-cost) |
| **tests** | executed bounded checks | [tests](#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](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `greedy_threshold` | greedy_threshold | partial source derived model | [greedy_threshold](#greedy-threshold) |
| `index_rebasing` | index_rebasing | partial source derived model | [index_rebasing](#index-rebasing) |
| `duplicate_id` | duplicate_id | partial source derived model | [duplicate_id](#duplicate-id) |
| `paragraph_limit` | paragraph_limit | partial source derived model | [paragraph_limit](#paragraph-limit) |

## Parts

- [roundtrip-block-layout-group-and-concat](https://md.groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/mod.rs.groupant/group-and-concat.groupant/)

## Model text


### descriptant

#### Description and epoch memory

group greedily emits contiguous ranges when group differs or w+n>max before current chapter; concat rebases Text indices by prior block count and uses first canon_sep. blocks maps each nonempty range to id/words/OR para_cut. like indexes ids last-wins, emits requested known ids in template order, omits empty matches. book_text scans keyword/caps headings after blank lines, preserves text and falls back to paragraph runs above HARD_MAX. Corpus adapters read and normalize records.

##### 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

group greedily emits contiguous ranges when group differs or w+n>max before current chapter; concat rebases Text indices by prior block count and uses first canon_sep. blocks maps each nonempty range to id/words/OR para_cut. like indexes ids last-wins, emits requested known ids in template order, omits empty matches. book_text scans keyword/caps headings after blank lines, preserves text and falls back to paragraph runs above HARD_MAX. Corpus adapters read and normalize records.

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.

### composition

#### Local composition

group greedily emits contiguous ranges when group differs or w+n>max before current chapter; concat rebases Text indices by prior block count and uses first canon_sep. blocks maps each nonempty range to id/words/OR para_cut. like indexes ids last-wins, emits requested known ids in template order, omits empty matches. book_text scans keyword/caps headings after blank lines, preserves text and falls back to paragraph runs above HARD_MAX. Corpus adapters read and normalize records.

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

Valid grouping never crosses group boundary and never splits a chapter; it can exceed max for oversized singleton. concat does not invent separator bytes. Missing ids in like cannot create placeholders.

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

Given concatenated text alone, every compatible chapter partition, metadata labeling and separator choice remains possible. Given ranges and chapters, concat reconstructs bytes uniquely. like cannot recover omitted chapters or earlier duplicate-id entries.

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.

### greedy_threshold

Equality w+n=max stays together; > splits except at first chapter. Zero-word chapters can share max=0.

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.

### index_rebasing

Text(b) becomes Text(b+off); literal pieces unchanged; first canon_sep controls new Volume.

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.

### duplicate_id

BTreeMap collect replaces earlier equal ids; template references preserve order and duplicate requests.

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.

### paragraph_limit

para_runs checks the first line at each paragraph start, not full upcoming paragraph; max is not a hard bound for arbitrary multi-line paragraphs.

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_projection`
- `blocks::tests::book_chapters_give_the_file_back_and_runs_stay_whole`
- `blocks::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

Valid grouping never crosses group boundary and never splits a chapter; it can exceed max for oversized singleton. concat does not invent separator bytes. Missing ids in like cannot create placeholders.

Given concatenated text alone, every compatible chapter partition, metadata labeling and separator choice remains possible. Given ranges and chapters, concat reconstructs bytes uniquely. like cannot recover omitted chapters or earlier duplicate-id entries.

##### Cost

group O(total text bytes) word scans; concat O(copied text+pieces+blocks). like map O(C log C), lookups O(K log C) plus cloning. book_text O(bytes) typical, repeated chapter reconstruction and allocations can add copying. File adapters materialize files/maps; recursion has no explicit symlink cycle guard.

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.
