gparse-data-batching
The groupant beside gparse/src/data.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 | partial 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 |
row_address | row_address | partial source derived model | row_address |
drop_state | drop_state | partial source derived model | drop_state |
plan_order | plan_order | partial source derived model | plan_order |
role_precedence | role_precedence | partial source derived model | role_precedence |
Model text
descriptant
Source-bound description
batch_prag allocates BT input/mask and BT² roles, adds root and gathers real rows; planner sorts and flushes before oversized additions.
Epoch 2026-10-31
Prospective model was recorded before edits. Added tests use bounded synthetic fixtures; production algorithms unchanged. Coverage is partial, not proof. No trained corpus, live teacher or throughput experiment was executed.
approximant
Forward approximant
batch_prag allocates BT input/mask and BT² roles, adds root and gathers real rows; planner sorts and flushes before oversized additions.
Domain: valid source-specific dimensions and resources stated in invariant; no automatic production substitution. Numerical observations are finite checks, not an end-to-end relative bound. Executable Rust surrogate: unsupported gap; existing exact tests are not surrogates. Future metric-specific caps may be 1/2/5/10%, never above 10%.
invariant
Invariant and cost
At budget zero each selected sentence remains as a singleton; root key=1 and mask=0.
Cost
O(BT²+word characters+S log S), O(BT²) arrays; u32 index casts unchecked.
Allocation, finite arithmetic, platform dimensions and external failures are not universally certified.
models
Typed model catalog
behavior_complement
Root never enters rows or mask as real word; zero budget never drops a singleton.
reverse_reconstruction
Given masks/rows, lengths are recoverable for valid canonical batches; forms are not because hashing/dropout collide.
row_address
inp uses4*(kT+i), roles use(kT+d)*T+p; root i=0.
drop_state
Only positive drop draws RNG for words; prag draws only for nonempty roles and positive prag_drop.
plan_order
Sort by(length,index); flush before adding if nonempty and prospective padded token total exceeds budget.
role_precedence
First nonzero filler role survives, predicate flag adds8 once; invalid manual role indices may panic.
tests
Checks and limits
Selected parent checks relevant to this fragment (not exhaustive): data::tests::features_line_up_with_words; data::cost_tests::cost_counts_real_batch_shapes_and_filters_skipped_sentences; data::wave30::projection_roles_and_zero_budget
Selected commands run twice debug and twice release; exact receipts and source-to-test mapping retained in wave30 gparse external run directory. Tests do not certify allocation failure, all NaN/overflow inputs, trained-model accuracy or corpus timing. Compiled mutants cover selected boundaries; per-source coverage is recorded in the external map, not presumed.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/gparse/src/data.rs.groupant/batching.groupant/