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

# latex-build-stage2

The groupant beside latex/build.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:** [`latex/build.rs`](https://github.com/ElamurAI/mova-free/blob/main/latex/build.rs)
- **source SHA-256:** `39a1feed1af329d1…`
- **covers:** Given validated ordered rows, emission writes Sym variants and SYM_LATEX/TEXT/CLASS/DELIM/ALL in the same index order. Fixed docs array orders the seven other enums. Lookup matches enumerate accumulated command, character and environment vectors and end in None. Finally require OUT_DIR and fs::write its table.rs. (bytes 9949–17217)
- **part of:** [latex-build](https://md.groupants.elamur.ai/free/en/mova/latex/build.rs.groupant/)
- **repository folder:** [`latex/build.rs.groupant/stage2.groupant`](https://github.com/ElamurAI/mova-free/tree/main/latex/build.rs.groupant/stage2.groupant)
- **repository commit:** `855da7bd4a7b`

> **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` |
| **composition** | partial | [composition](#composition) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed 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) |
| `discriminant_transport` | discriminant_transport | partial source derived model | [discriminant_transport](#discriminant-transport) |
| `optional_canonical` | optional_canonical | partial source derived model | [optional_canonical](#optional-canonical) |

## Model text


### descriptant

#### latex-build-stage2

Given validated ordered rows, emission writes Sym variants and SYM_LATEX/TEXT/CLASS/DELIM/ALL in the same index order. Fixed docs array orders the seven other enums. Lookup matches enumerate accumulated command, character and environment vectors and end in None. Finally require OUT_DIR and fs::write its table.rs.

Epoch 2026-10-31: replaced stage topic lists with concrete transitions, exclusions and compatible antecedents. Four meaningful typed views replace the previous six-view bookkeeping catalog. Shared syntax and source byte bounds are unchanged.

### approximant

#### Scoped forward relation

Given validated ordered rows, emission writes Sym variants and SYM_LATEX/TEXT/CLASS/DELIM/ALL in the same index order. Fixed docs array orders the seven other enums. Lookup matches enumerate accumulated command, character and environment vectors and end in None. Finally require OUT_DIR and fs::write its table.rs.

This is an exact source-derived partial model, not an executable approximate replacement.

### invariant

#### Scoped invariants

Array metadata cannot be independently reordered by HashMap iteration in this implementation. No runtime disk-reading lookup is generated. Successful emission cannot assign two explicit match arms from one rejected duplicate input; write errors panic rather than return a successful build.

For row i, Sym variant discriminant i indexes all four metadata arrays and SYM_ALL[i]. A manual reorder of only one array would break the parser/printer join.

FracKind has independent Option prefix/infix forms; EnvKind has independent Option begin-name/plain forms. Other enum families require a canonical form and panic if absent during emission.

### composition

#### Scoped interaction

table.rs includes this generated output. Emission assumes validation's references and row order; it is not independently validating arbitrary generated Rust.

The manifest binds this stage to the unchanged parent syntax projection and exact source byte range. Parent cost remains an upper accounting context; no independent whole-file invocation or execution count is assigned to this fragment.

### models

### behavior_complement

Array metadata cannot be independently reordered by HashMap iteration in this implementation. No runtime disk-reading lookup is generated. Successful emission cannot assign two explicit match arms from one rejected duplicate input; write errors panic rather than return a successful build.

### reverse_reconstruction

Generated text determines ordered enum variants and emitted mappings, but many input tables with different comments and equivalent canonical/alias construction produce it. OUT_DIR location is absent from generated text; output bytes do not reconstruct the build environment or prior file contents.

### discriminant_transport

For row i, Sym variant discriminant i indexes all four metadata arrays and SYM_ALL[i]. A manual reorder of only one array would break the parser/printer join.

### optional_canonical

FracKind has independent Option prefix/infix forms; EnvKind has independent Option begin-name/plain forms. Other enum families require a canonical form and panic if absent during emission.

### tests

#### Evidence — 2026-10-31

wave28_tests::canonical_first_form_and_variant_order; wave28_tests::variant_identifier_boundary

Selected library filters ast:: lex:: macros:: parse:: print:: table:: and integration gate excluding document_extraction_with_preamble_macros and random_token_soup_never_panics_and_roundtrips. Direct rustc --test latex/build.rs exercises private helpers. All selected tests twice debug/release with identical sorted names. Four compiled mutants at build/AST/parser/printer boundaries fail assertions then exact restoration passes. These do not individually cover every source. Build-main failure effects, allocation failures and universal roundtrip are unproved. Strict Clippy reports existing lints. No corpus/live VMM/API/GPU/full-school/held-out tests.
