Testing
The repository treats golden vectors and the Python reference model as the definition of correct behaviour. Rust, C and Python implementations must all replay the same scenarios.
One command
pixi run check # run every local check
pixi run ci # check plus the 60-second fuzz stage
The individual tasks are documented in Development and release.
Layers
| Layer | Command | What it proves |
|---|---|---|
| Formatting and lint | pixi run fmt, pixi run clippy | Workspace, fuzz crate and standalone ROS 2 example are clean under -D warnings. |
| Rust unit and integration tests | pixi run test | Primitives, predictors, schema validation, encoder, decoder, codegen, C header shape. |
| Doctests | pixi run docs-doctests | Public Rust examples compile and run. |
| Golden vectors | pixi run test / pixi run differential | All 21 scenario vectors, 8 predictor traces and the manifest are replayed. |
| Differential traces | pixi run differential-full | All 10,000 fixed-seed traces are regenerated and hash-checked against the manifest. |
| Reference model | pixi run reference-tests, pixi run reference-model | Stdlib Python oracle agrees with committed vectors. |
| C ABI | pixi run c-header-check, pixi run c-abi | Header is current; C replays every vector with -Werror. |
| Python bindings | pixi run python-tests | PyO3 extension replays vectors and round-trips generated classes. |
| Embedded | pixi run embedded-build, pixi run no-alloc-entry-tests, pixi run no-alloc-stack-usage | True no-alloc thumb build, zero steady-state allocations, recorded stack usage. |
| Determinism | pixi run qemu-determinism | Host and Cortex-M4 hashes agree. |
| Fuzzing | pixi run fuzz, pixi run fuzz-acceptance | 60-second gate and 30-minute acceptance run on the 12-hour timer. |
| Examples | pixi run examples | UDP, serial/COBS and ROS 2 codec self-tests pass. |
| Docs | pixi run docs | Book, rustdoc, pdoc, Doxygen, site assembly and local link checks pass. |
Golden vectors
tests/vectors/*.json contains hand-checked encoder/decoder scenarios, predictor
traces, width cases, CRC/message-ID checks and a stale-frame case. Each scenario
records schema YAML, operations, expected bytes and decoded output. Five
diff_seed_*.json files are human-reviewed differential scenarios.
traces.manifest.json records the generator version, seed range, frame count
and SHA-256 of 10,000 generated traces; those traces are not committed.
Fuzzing
tests/fuzz is a standalone Cargo workspace with three libFuzzer targets:
decoder_feed, schema_parse and yaml_to_schema. tools/run_fuzz.py
supplies sanitizer-coverage flags on stable Rust, copies the 14-file seed corpus
to a temporary directory, and stores crashes in a gitignored directory. The
decoder target asserts that state_hashes(0) is unchanged whenever feed
returns Err.
Reproducing a failure
Every runner names the failing vector, seed and step. For byte mismatches the
message includes the first differing byte; for decoded values it names the
field. Start with pixi run test, then narrow with the task from the table
above. Do not regenerate golden vectors unless the wire contract itself changes.