rt-mixed-sample
The groupant beside tools/roundtrip/src/mixed/sample.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 |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| 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 |
span_transport | span_transport | partial source derived model | span_transport |
sentence_boundary | sentence_boundary | partial source derived model | sentence_boundary |
eligibility | eligibility | partial source derived model | eligibility |
effect_order | effect_order | partial source derived model | effect_order |
Parts
Model text
descriptant
Descriptant
Prospective epoch
2026-10-31 source review predicted: sample reads candidates, sorts IDs, dedups adjacent equal texts only, seeded shuffles/truncates and sorts IDs again by variety. streams builds mono lists, shuffled lines and docs with glue and item byte spans. sentences cuts punctuation with optional closing quote before ASCII space and capital/open quote. Resource model: Candidates materialize corpus bytes and sort paths/items O(N log N) with string comparisons. In streams, N items cost O(N) for fixed16 variety scans and shuffles; the ordered by_verse map costs O(N log(V+1) * L), where V is distinct verse keys and L bounds verse-key comparison bytes. Total emitted bytes B include requested D carrier/quote documents AND additional verse-pair documents, plus mono/lines output. Assembly costs O(B + emitted spans); memory O(N + V + B + emitted spans). External prospective.md predates test additions and preserves APIs, effect order, hazards and interaction hypotheses.
Observed epoch
Bounded real helper checks in tests.md constrain these models; syntax is a partial lexical projection with no macro expansion, name resolution or proof. Production expressions unchanged; six inline test modules added. Compiled mutants are temporary and exactly restored. Existing malformed-input and nonfinite domains remain explicit, not silently repaired. Parent composes this scope with siblings without adding overlapping costs twice.
Finite synthetic helper evidence only; live corpora, parser/model loading, full orchestration and filesystem failure races excluded.
approximant
Forward relation
sample reads candidates, sorts IDs, dedups adjacent equal texts only, seeded shuffles/truncates and sorts IDs again by variety. streams builds mono lists, shuffled lines and docs with glue and item byte spans. sentences cuts punctuation with optional closing quote before ASCII space and capital/open quote.
Domain: Valid item.var<16; finite docs and arithmetic 2*d, text allocation fits usize. No corpus candidates or writes executed; synthetic streams only.
invariant
Invariant and cost
Invariant
Valid item.var<16; finite docs and arithmetic 2*d, text allocation fits usize. No corpus candidates or writes executed; synthetic streams only.
Cost
Candidates materialize corpus bytes and sort paths/items O(N log N) with string comparisons. In streams, N items cost O(N) for fixed16 variety scans and shuffles; the ordered by_verse map costs O(N log(V+1) * L), where V is distinct verse keys and L bounds verse-key comparison bytes. Total emitted bytes B include requested D carrier/quote documents AND additional verse-pair documents, plus mono/lines output. Assembly costs O(B + emitted spans); memory O(N + V + B + emitted spans).
Limits
Finite synthetic helper evidence only; live corpora, parser/model loading, full orchestration and filesystem failure races excluded. No percentage surrogate is implemented: categorical parsing/effect observations lack an admitted numerical error metric. Any future profile must define its metric/domain and use only1/2/5/10 percent caps.
composition
Local composition
sample reads candidates, sorts IDs, dedups adjacent equal texts only, seeded shuffles/truncates and sorts IDs again by variety. streams builds mono lists, shuffled lines and docs with glue and item byte spans. sentences cuts punctuation with optional closing quote before ASCII space and capital/open quote.
Children select narrow source functions with their exact byte intervals. Remaining branches stay in the file model; fragments are not exhaustive partitions. Calls and state joins follow the forward relation, not folder order. Shared scans/helpers are counted once in whole-file costs. Complement of composition is not union of complements; reverse composition retains compatible intermediates and caller premises.
models
Typed source-bound relations
Subject: exact source SHA-256 in manifest. Domain and resource premises are in invariant.md. Each model is partial, source-derived, over a single helper invocation or the described finite trace. Complements are proposed inner exclusions under those premises; reverse relations retain all compatible antecedents, with no unique inverse claim. The oracle is the named checks in tests.md; unexecuted cases remain hypotheses. No numerical approximation certificate.
behavior_complement
Excluded: dedup eliminates all duplicate texts irrespective of ID ordering; nonadjacent equal text can survive. Empty sample does not synthesize docs.
reverse_reconstruction
Gold item indices plus original items and glue reconstruct emitted lines; shuffled lines alone have seed/permutation ambiguity, and truncated sample cannot recover rejected candidates.
span_transport
Doc glue/piece offsets are UTF-8 bytes; consecutive spans cover entire generated line.
sentence_boundary
Only literal ASCII space triggers cut; whitespace generality would change behavior.
eligibility
usable admits3..40 whitespace words and rejects tab/LF/CR; trimming occurs before this filter.
effect_order
write creates directory, writes items.tsv then each stream text before gold; failures leave prefixes, no transactional promise.
tests
Checks and evidence
Named source/helper checks: mixed::sample::wave32_tests::synthetic_stream_spans.
Wave32 on2026-10-31:10 distinct exact tests passed twice debug and twice release, with equal sorted named outcomes. This node claims only its listed subset; empty subset means source review only. Five actual source-behavior mutants compiled, failed assertions, restored exact bytes/hash, and passed focused green reruns. No assertion-only mutants; existing swapped-input controls are separate. Receipt bundle: $MOVA_DATA/runs/octopus-wave32-rt_mixed-2026-10-31 (native-commands.json, source-test-map.json, mutation-results.json, .status/.log). No live corpus, teacher, frozen assessment, download or production data used.
Finite synthetic helper evidence only; live corpora, parser/model loading, full orchestration and filesystem failure races excluded.
This page in Markdown ā https://md.groupants.elamur.ai/free/en/mova/tools/roundtrip/src/mixed/sample.rs.groupant/