---
title: "roundtrip-markdown-layout — Mova code model"
description: "Mova code model of tools/roundtrip/src/blocks/site_md.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/site_md.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/site_md.rs.groupant/>

# roundtrip-markdown-layout

The groupant beside tools/roundtrip/src/blocks/site_md.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/site_md.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/roundtrip/src/blocks/site_md.rs)
- **source SHA-256:** `ced26c9c453717c6…`
- **repository folder:** [`tools/roundtrip/src/blocks/site_md.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/roundtrip/src/blocks/site_md.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) |
| `byte_mark_transport` | byte_mark_transport | partial source derived model | [byte_mark_transport](#byte-mark-transport) |
| `branch_priority` | branch_priority | partial source derived model | [branch_priority](#branch-priority) |
| `given_endpoints` | given_endpoints | partial source derived model | [given_endpoints](#given-endpoints) |
| `sample_split` | sample_split | partial source derived model | [sample_split](#sample-split) |

## Parts

- [roundtrip-markdown-layout-inline-layout](https://md.groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/site_md.rs.groupant/inline-layout.groupant/)

## Model text


### descriptant

#### Description and epoch memory

page_volume decomposes Markdown with ordered fence/table/comment/foreign/heading/list/prose cases; inline records removed markup at UTF-8 text offsets. with_marks renders exact written strings on generated offsets. give replaces endpoint-marked given prose or matching Unparsed bodies, repeat selects copies at len>=24 and cost<=0.25 literal bits. page ids/sections/natural sorting feed runs then stride-before-split sampling.

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

page_volume decomposes Markdown with ordered fence/table/comment/foreign/heading/list/prose cases; inline records removed markup at UTF-8 text offsets. with_marks renders exact written strings on generated offsets. give replaces endpoint-marked given prose or matching Unparsed bodies, repeat selects copies at len>=24 and cost<=0.25 literal bits. page ids/sections/natural sorting feed runs then stride-before-split sampling.

Domain: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

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

page_volume decomposes Markdown with ordered fence/table/comment/foreign/heading/list/prose cases; inline records removed markup at UTF-8 text offsets. with_marks renders exact written strings on generated offsets. give replaces endpoint-marked given prose or matching Unparsed bodies, repeat selects copies at len>=24 and cost<=0.25 literal bits. page ids/sections/natural sorting feed runs then stride-before-split sampling.

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

Generated layout does not discard original byte sequence on tested fixtures; foreign paragraphs never become English text blocks. Given replacement cannot remove interior markup. repeat requires both length and price conditions.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.

### reverse_reconstruction

Volume with text, ordered marks and literal pieces reconstructs written bytes; prose-only view has infinitely many markup antecedents. Natural keys identify leading-zero/overflow-equivalent numeric runs; path id tie-break preserves deterministic sorting but not injective key.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.

### byte_mark_transport

Removed markup offsets count UTF-8 bytes, equal offsets preserve discovery order.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.

### branch_priority

Fences and derived tables precede comment language state; foreign applies to next ordinary paragraph and resets afterward.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.

### given_endpoints

Only marks at 0 or text.len permit Given; Unparsed strips newline suffix only.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.

### sample_split

stride=ceil(runs/max(target,1)) before hash split; target is not guaranteed resulting count.

Domain and held state: UTF-8 strings; generated marks in nondecreasing valid byte coordinates; finite representable sums. Environment chrome/repeat flags held fixed; actual filesystem listing/sampling not exercised.

Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.


### tests

#### Actual checks

- `blocks::site_md::tests::a_page_gives_itself_back_and_its_prose_goes_up`
- `blocks::site_md::tests::inline_marks_and_order`

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

Generated layout does not discard original byte sequence on tested fixtures; foreign paragraphs never become English text blocks. Given replacement cannot remove interior markup. repeat requires both length and price conditions.

Volume with text, ordered marks and literal pieces reconstructs written bytes; prose-only view has infinitely many markup antecedents. Natural keys identify leading-zero/overflow-equivalent numeric runs; path id tie-break preserves deterministic sorting but not injective key.

##### Cost

Inline scans can be O(B²) for repeated '['/'<' suffix searches. page lines and concatenation O(B) typical. repeat clones growing Copier each trial: O(total preceding history bytes) per text piece, possibly quadratic. Natural sort keys O(id bytes), sort O(P log P); filesystem rereads selected pages.

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.
