latex-test-gate
The groupant beside latex/tests/gate.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 |
| composition | partial | composition |
| 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 |
roundtrip_relation | roundtrip_relation | partial source derived model | roundtrip_relation |
golden_outputs | golden_outputs | partial source derived model | golden_outputs |
fault_applicability | fault_applicability | partial source derived model | fault_applicability |
coverage_boundary | coverage_boundary | partial source derived model | coverage_boundary |
Parts
Model text
descriptant
latex-test-gate
SUITE parses each fixture, rejects unknowns, checks structural round trip and canonical fixed point. Golden LaTeX/text compare exact strings; unknown spans checked against source slices; malformed fixtures check error kind and position; macro fixtures compare expanded trees and loop rejection.
Epoch2026-10-31: full source reviewed before edits; prospective models retained externally. No optimization.
approximant
Forward relation
SUITE parses each fixture, rejects unknowns, checks structural round trip and canonical fixed point. Golden LaTeX/text compare exact strings; unknown spans checked against source slices; malformed fixtures check error kind and position; macro fixtures compare expanded trees and loop rejection.
No useful approximate executable metric for exact categorical syntax; future caps1/2/5/10% only.
invariant
Domain, invariant and cost
SUITE parses each fixture, rejects unknowns, checks structural round trip and canonical fixed point. Golden LaTeX/text compare exact strings; unknown spans checked against source slices; malformed fixtures check error kind and position; macro fixtures compare expanded trees and loop rejection.
Only selected synthetic tests executed; document sample and random soup not run. No live VMM/API, corpus, GPU or external effects.
Selected tests linear in total fixture parsing/printing cost; loop witnesses bounded by parser expansion guards. Optional soup30000 has fixed PRNG but skipped here.
composition
Composition
SUITE parses each fixture, rejects unknowns, checks structural round trip and canonical fixed point. Golden LaTeX/text compare exact strings; unknown spans checked against source slices; malformed fixtures check error kind and position; macro fixtures compare expanded trees and loop rejection.
Build generates table enums consumed by parser dispatch and printers. Lexer tokens feed macros and parser; parser returns AST whose equality ignores spans. Printers and gate compare that quotient, not original bytes. Shared parent syntax backs scoped stages; stages are byte-bound projections, not independent Rust modules.
models
behavior_complement
The harness excludes passing when a chosen fixture violates expected output, but does not exclude all unseen parser/printer faults. Corruption test requires some applicable defect to turn red and explicitly accepts an unaffected fraction fault.
reverse_reconstruction
A successful test transcript has many compatible implementations; fixtures constrain outputs only at their cases. Failing assertion identifies a violated observation, not a unique bug or original input beyond logged fixture.
roundtrip_relation
gate check compares parser tree modulo Span equality, not byte source identity.
golden_outputs
Exact expected canonical strings and Unicode text constrain different projections.
fault_applicability
At least one configured fault changes each affected fixture; SwapFrac on x+y remains green.
coverage_boundary
Finite fixtures and explicit skips; no universal TeX correctness inferred.
tests
Evidence — 2026-10-31
7 integration tests via --test gate with document and soup skipped
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.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/latex/tests/gate.rs.groupant/