Elamur GroupantsโŒ•
โ˜ฐ

mlab-builtins-mod

The groupant beside mlab/src/builtins/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

componentlabelwhere
approximantpartialapproximant
astpartialsyntax.json
compositionpartialcomposition
costsymbolic source derivedinvariant
descriptantpresentdescriptant
invariantpartialinvariant
testsexecuted bounded checkstests

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.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
state_invariantstate_invariantpartial source derived modelstate_invariant
failure_precedencefailure_precedencepartial source derived modelfailure_precedence
representation_transportrepresentation_transportpartial source derived modelrepresentation_transport
resource_costresource_costpartial source derived modelresource_cost

Parts

Model text

descriptant

mlab-builtins-mod

Builtin registry and shared value/shape extraction adapters used by numerical and I/O modules.

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

register overwrites a name's function; names sorts keys; with_defaults registers eleven modules in fixed order. scalar_arg returns first real element if nonempty. dims_args ignores char values, floors positive sizes, clamps nonpositive to zero and requires trailing dimensions equal one.

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

get copies a function pointer and does not mutate registry. Invalid missing argument fails before type extraction; no matrix product allocation occurs in dims_args itself.

Failure ordering

NaN checked before float-to-usize conversion; +Inf saturates usize. Single-array trailing dimensions compare raw floats to one, multiargument trailing dimensions compare converted usize values.

Cost

Expected O(1) map lookup/insert, sorted names O(K log K); dims extraction O(arguments + trailing dimensions). Casting and downstream shape multiplication are not overflow certificates.

composition

Composition

register overwrites a name's function; names sorts keys; with_defaults registers eleven modules in fixed order. scalar_arg returns first real element if nonempty. dims_args ignores char values, floors positive sizes, clamps nonpositive to zero and requires trailing dimensions equal one.

A single scalar dimension means square, no numeric arguments means 1x1, empty dimension vector means 0x0. default_dim chooses rows unless rows==1; dim_arg absent/empty/char yields None.

dimensions

Filter char values, dispatch by numeric argument count, map dimensions with NaN rejection then clamp/floor/saturating cast; constrain higher dimensions to one.

Boundary: The helper returns a pair only and does not allocate the requested matrix.

Interaction limit

Local fragment relations compose only with valid Value storage, caller error propagation and delegated providers. They do not establish whole-interpreter or host-filesystem guarantees.

models

Typed models โ€” mlab-builtins-mod

Source-derived partial relations; finite checks do not prove universality.

behavior_complement

names excludes hash iteration nondeterminism in its returned order. scalar_arg excludes rejecting a nonempty nonscalar solely for its size. NaN dimension excludes a successful dims_args result.

reverse_reconstruction

Registry snapshot admits arbitrary overwritten registrations and insertion permutations with same final bindings. Dimensions admit fractional/negative antecedents after floor/clamp and arbitrary skipped char arguments.

state_invariant

get copies a function pointer and does not mutate registry. Invalid missing argument fails before type extraction; no matrix product allocation occurs in dims_args itself.

failure_precedence

NaN checked before float-to-usize conversion; +Inf saturates usize. Single-array trailing dimensions compare raw floats to one, multiargument trailing dimensions compare converted usize values.

representation_transport

A single scalar dimension means square, no numeric arguments means 1x1, empty dimension vector means 0x0. default_dim chooses rows unless rows==1; dim_arg absent/empty/char yields None.

resource_cost

Expected O(1) map lookup/insert, sorted names O(K log K); dims extraction O(arguments + trailing dimensions). Casting and downstream shape multiplication are not overflow certificates.

tests

Evidence and limitations

Selected named outcomes: builtins::wave30_tests::registry_and_dimensions. Each ran twice debug and twice release with sorted identical nonempty outcomes and numeric exit 0. Source-specific compiled control exercised "builtins::wave30_tests::registry_and_dimensions": compile exit 0, assertion-red exit 101, exact-restored rerun exit 0. External receipts: octopus-wave30-io-2026-10-31 (native-commands.json, positive-receipts.json, controls.json).

Scope: get copies a function pointer and does not mutate registry. Invalid missing argument fails before type extraction; no matrix product allocation occurs in dims_args itself.

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/mod.rs.groupant/