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

# 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

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`gparse/src/data.rs`](https://github.com/ElamurAI/mova-free/blob/main/gparse/src/data.rs)
- **source SHA-256:** `f115aeb0613b1ac5…`
- **covers:** batch_prag allocates BT input/mask and BT² roles, adds root and gathers real rows; planner sorts and flushes before oversized additions. (bytes 9736–15415)
- **part of:** [gparse-data](https://md.groupants.elamur.ai/free/en/mova/gparse/src/data.rs.groupant/)
- **repository folder:** [`gparse/src/data.rs.groupant/batching.groupant`](https://github.com/ElamurAI/mova-free/tree/main/gparse/src/data.rs.groupant/batching.groupant)
- **repository commit:** `48f2e6f74146`

> **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` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | partial 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) |
| `row_address` | row_address | partial source derived model | [row_address](#row-address) |
| `drop_state` | drop_state | partial source derived model | [drop_state](#drop-state) |
| `plan_order` | plan_order | partial source derived model | [plan_order](#plan-order) |
| `role_precedence` | role_precedence | partial source derived model | [role_precedence](#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.

##### Epoch 2026-11-04

batch_full replaces the body of batch_prag (now a wrapper with ngram=0). It precomputes n-grams per word when ngram>0, sizes g by the longest list, and pushes arc_conf, rel_conf and alts per row in row order. No new RNG draws.

### 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*(k*T+i), roles use(k*T+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.
