mlab-builtins-io-atom-cycle
The groupant beside mlab/src/builtins/io.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 |
| 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 |
state_invariant | state_invariant | partial source derived model | state_invariant |
failure_precedence | failure_precedence | partial source derived model | failure_precedence |
representation_transport | representation_transport | partial source derived model | representation_transport |
resource_cost | resource_cost | partial source derived model | resource_cost |
Model text
descriptant
mlab-builtins-io-atom-cycle
Compute segments and atom queue; zero specs returns literals, otherwise cycle. Initially empty queue pads each spec once; exhausted noninitial queue returns immediately at the next spec.
Modeling epoch โ 2026-10-31
Prospective source read preceded edits. Bounded synthetic checks and selected existing safe tests exercise actual code; paired debug/release results and compiled negative-control assertions are retained externally. Frozen scenario, corpus, external measurement, full-school and training effects are unexecuted. Partial lexical syntax supplies no macro-expanded or semantic proof.
approximant
Forward relation
Compute segments and atom queue; zero specs returns literals, otherwise cycle. Initially empty queue pads each spec once; exhausted noninitial queue returns immediately at the next spec.
Domain
Valid Rust value/storage invariants and available bounded resources; exact branch and effect observations only.
Executable approximant gap
No useful percentage-error surrogate is established for these categorical, textual or effectful observations. Supported future caps are 1%, 2%, 5%, 10%; no executable approximation or production substitution is claimed.
invariant
Invariants and costs
Every productive numeric/string conversion removes an atom or expands a finite string to code atoms; iteration ends when queue empties.
Failure ordering
atoms rejects tables/string arrays before any output is returned; format allocation panic remains outside MError model.
Cost
O(format scan + repeated segment traversal and per-atom flag scans + atom expansion + output bytes); format/flag work can multiply by expanded atom count, and long padding can dominate.
models
Typed models โ mlab-builtins-io-atom-cycle
Source-derived partial relations; finite checks do not prove universality.
behavior_complement
A queue exhausted mid-cycle excludes later literal segments after the next unfilled spec. String precision truncates %s only, not %c.
reverse_reconstruction
Output prefix corresponds to any atom queue whose consumption ends at the same spec boundary; literal-only output permits any convertible atoms because none are consumed.
state_invariant
Every productive numeric/string conversion removes an atom or expands a finite string to code atoms; iteration ends when queue empties.
failure_precedence
atoms rejects tables/string arrays before any output is returned; format allocation panic remains outside MError model.
representation_transport
%s/%c numeric atoms produce valid Unicode scalar or shortest fallback; numeric spec strings expand by Unicode characters.
resource_cost
O(format scan + repeated segment traversal and per-atom flag scans + atom expansion + output bytes); format/flag work can multiply by expanded atom count, and long padding can dominate.
tests
Evidence and limitations
Parent source checks: builtins::io::tests::g_format, builtins::io::wave30_tests::cycling_unicode_and_empty. The fragment's actual statements lie in the recorded byte range; parent checks need not exercise every branch in this fragment. See ../tests.md for source-level control and limitations.
AST projection generated twice to fresh files and compared byte-for-byte. Runtime evidence is finite and does not establish every branch, allocation failure, backend implementation or effect path. No optimization or speed claim.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/io.rs.groupant/atom-cycle.groupant/