Recurrence export: tests and golden vectors

The format is described in Recurrence export format; this page is for maintainers of the export.

Golden vectors

The Rust test recurrence_export_golden_vectors_pin_the_execution_semantics replays every case from the fixture’s own inputs through the export interpreter. A differing bit fails with “the execution semantics changed: bump the version string and regenerate”. A new template, source family, orientation, or instruction kind cannot be added without new cases: the generator enumerates them exhaustively. After bumping EXECUTION_SEMANTICS in rust/crates/rusticol-core/src/engine/recurrence_export.rs, regenerate the vectors with:

cargo test -p rusticol-core --lib regenerate_recurrence_export_golden_vectors -- --ignored

The generator refuses to change an existing case while the version string is unchanged; it may add cases. External runners can replay the same fixture to check their implementation.

Consumer parity tests

The Rust export interpreter test covers every stored process, alias, and process-group member when RUSTICOL_RECURRENCE_ARTIFACT names a generated artifact, or a list of artifacts separated like PATH (: on Unix). It also reconstructs member programs from their representative references before comparing every color and helicity bit for bit. Set RUSTICOL_RECURRENCE_PROCESSES to a JSON array of process IDs to restrict that traversal. Without an artifact the test reports that it skipped. CI runs it against the artifacts that the export integration tests generate: d d~ > z g in the topology-replay and all-flow-union layouts, and a grouped q q~ > t t~ g set with an explicit alias, flavor-blind process-group members (including crossed initial states), and massive top sources.

RUSTICOL_RECURRENCE_ARTIFACT=/path/to/artifact \
  cargo test -p rusticol-core --lib recurrence_export_generated_artifact_matches_every_helicity_bit -- --test-threads=1

The ordinary focused export tests exercise zero-factor certified copies, in-place scaling, spin-2 sources, direct and scaled kernels with both write modes, nonunit replay multiplicities, group factors, and imaginary/general fanout scatter factors without requiring an external artifact. Their expected values come from Rusticol’s own source, certified-reuse, identity-finalization, closure and fanout-scale executors, its kernel output adapter, and its replay, reduction and group-factor arithmetic.