world-spartqa-inference-tests
The groupant beside world/src/spartqa.rs.groupant/inference_tests.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 source model | forward |
| ast | partial | syntax.json |
| composition | partial source model | composition |
| cost | partial source model | cost |
| descriptant | partial source model | epoch-memory |
| invariant | partial source model | invariant |
| tests | partial source model | checks |
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 |
|---|---|---|---|
world-spartqa-inference-tests-complement | behavior_complement | partial source model | behavior-complement |
world-spartqa-inference-tests-reverse | reverse_reconstruction | partial source model | reverse-reconstruction |
world-spartqa-inference-tests-projection | reverse_reconstruction | partial source model | projection-fiber |
world-spartqa-inference-tests-product | state_abstraction | partial source model | product-state-sufficiency |
Model text
behavior-complement
Successful scoped test execution excludes disagreement of new methods with retained old loops on generated fixtures, disagreement with the independent fixed-point product relation, dropped inverse edges, lost qualifier witnesses, changed row encounter order and rejection of intermediate IDs absent from objs. The ignored benchmark is excluded from default runs. Tests do not establish behavior on all scenes or cover IO/training.
reverse-reconstruction
A passing run admits every implementation agreeing on the finite fixture observation vector. Many implementations and untested behaviors remain compatible; success cannot uniquely reconstruct production code. Failure reports identify a fixture and unequal observations, admitting defects in reference, production or test wiring. Source hashes and compiled mutation failures constrain these alternatives.
forward
Construct synthetic scenes, compare actual methods to prior scan loops, then compare directional path results with a repeated fixed-point closure over all small endpoint pairs. The latter uses pairwise BTreeSet membership and accumulated reachable-state sets, not production adjacency or FIFO. Generate 64 directional masks times 16 qualifier patterns for three vertices. Separately enumerate 64 block masks, check inverse-only and mixed-path witnesses, exact row order and dangling intermediate IDs. Six existing reader tests run in the parent module. Ignored benchmark emits timings and equality-checked checksums for actual old/new calls.
invariant
Fixtures are deterministic, fact sets have explicit order, and queries leave Scene unchanged. Reference loops are extracted from the base revision and renamed only. The closure enumerates product states until cardinality stabilizes; it is used only on the bounded dense-ID fixtures. Arbitrary fact IDs are covered separately by direct old/new observations.
cost
Finite test cost depends on 1,024 graph/qualifier fixtures, seven relations and nine endpoint pairs, plus bounded fixed-point iterations. At most 36 product states occur per three-node fixture. Benchmark workloads include chains of 3,32,256, a 48-node dense DAG, large direct edge and missing-source queries; runtime assertions compare checksums before reporting elapsed nanoseconds. No timing conclusion is built into tests.
projection-fiber
Type: reverse_reconstruction. Distinct raw fact sets may yield identical projected graph observations. Test fixtures encode alternating forward and inverse direction representations, ensuring equality cannot be attributed solely to forward-edge inputs.
product-state-sufficiency
Type: mutation_boundary. A direct unqualified path and longer qualified path distinguish shortest-target return from all-path OR. Removing qualification propagation must fail the dedicated control; removing inverse adjacency must fail inverse-only walks.
composition
Parent module provides private Scene and relation methods; this test module supplies old references, fixtures, independent fixed-point checks and an opt-in benchmark. Shared relation inversion and qualifier definitions remain common assumptions; explicit inverse and qualifier fixtures reduce this coupling without claiming independent language semantics.
checks
Use cargo test -p world --lib spartqa:: -- --test-threads=1, repeated debug and release. Ignored timing test requires a separate quiet release window. See parent evidence.md for real outcomes and limitations.
epoch-memory
2026-10-30: reference extraction preceded test authoring. Added dangling usize::MAX intermediate-ID test after review observed that global BFS validation would silently strengthen old input premises. No parser, model, teacher, corpus or GPU access occurs in new fixtures.
refinement-epoch
2026-10-30: original exhaustive three-object fixtures now cover scan fallback. Added 64/65/96-fact boundary fixtures with irrelevant directional facts, inverse-only paths, alternate qualified paths and absent sources for objects and blocks. The 65/96 cases force indexed production paths, and compiled mutations target this boundary test. The ignored benchmark now uses three warmups and seven samples alternating old/new order, with explicit 64/65 boundary workloads. Intermediate fact IDs outside objs remain legal and are used by irrelevant padding. Preserve initial evidence as a distinct eager-build epoch.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/world/src/spartqa.rs.groupant/inference_tests.rs.groupant/