This project includes a differential gate that compares interpreter behavior (tonic run <source>) against native AOT behavior (tonic compile <source> + direct executable run).
cargo test --test differential_backends -- --nocaptureThis test target runs two suites:
- Parity subset differential over curated active fixtures from
examples/parity/catalog.toml. - Seeded generator differential over deterministic generated programs.
Run a single seed:
TONIC_DIFF_SEED=17 cargo test --test differential_backends -- --nocaptureRun a larger seed count:
TONIC_DIFF_SEEDS=256 cargo test --test differential_backends -- --nocaptureDefaults: TONIC_DIFF_SEEDS=32 and seed range [0, N).
On mismatch, the harness writes a replay bundle under:
<temp-root>/differential-artifacts/<label>/program.tn<temp-root>/differential-artifacts/<label>/program.min.tn<temp-root>/differential-artifacts/<label>/mismatch.json
mismatch.json includes:
- fixture/seed identity
- mismatch reason (
exit code mismatch,stdout mismatch,stderr mismatch, or native compile failure) - interpreter and native command outputs
- replay command lines
Given a failing fixture <path>:
tonic run <path>
tonic compile <path>
./.tonic/build/<stem>Compare exit code, stdout, and stderr exactly.