Developer tooling and verification
ayaml ships with a reproducible verification stack covering YAML 1.2.2
conformance, performance and memory regression gates, fuzzing, formal
verification, and mutation testing. For an accessible overview of what each
verification technique proves and which bug classes it catches, see
Correctness and verification.
Local CI runner (tools/ci-local.sh)
Section titled “Local CI runner (tools/ci-local.sh)”Run the same checks that gate pull requests locally before pushing:
tools/ci-local.sh --list # list all mirrored CI jobstools/ci-local.sh quality-stable # fmt, clippy, panic-profile clippy, workspace tests, docs (also quality-msrv)tools/ci-local.sh suite # pinned YAML Test Suite (default + compat profiles)tools/ci-local.sh harness # conformance fixtures, JSONL baseline + legacy corpus allocation gates, bench/fuzz compiletools/ci-local.sh docs-lint # markdownlint, link/coverage checks, site build, documentation doctestsBenchmark and measurement CLI (cargo xtask)
Section titled “Benchmark and measurement CLI (cargo xtask)”The workspace defines a cargo xtask alias (crates/xtask) that drives all
deterministic fixtures, Criterion timings, counting-allocator memory probes,
Callgrind instruction/cycle diffs, Callgrind and DHAT hotspot profiling, and
10x linear scaling checks:
cargo xtask fixtures --verify # verify pinned SHA-256 fixture digestscargo xtask speed --out-dir target/xtask # export Criterion speed.jsonlcargo xtask memory --suite baseline --out-dir target/xtask # export counting-allocator memory.jsonlcargo xtask det --suite pr --base HEAD~1 # steady-state Callgrind over ayaml-benchcargo xtask det --suite pr --base HEAD~1 --anchor main # compare against base and long-horizon anchorcargo xtask profile --tool callgrind --bench layers/parse_value/openapi-spec --inclusivecargo xtask profile --tool dhat --fixture scale-map-100kb --mode parse_valuecargo xtask scale --out-dir target/xtask # verify 10x O(n) time & memory scalingcargo xtask compare --baseline DIR_A --current DIR_Bcargo xtask gate # run CI allocation & baseline gatescargo xtask report --dir target/xtask # render Markdown summary tablesSee Benchmark methodology for schema details and hardware provenance rules.
YAML Test Suite conformance
Section titled “YAML Test Suite conformance”crates/ayaml-conformance runs the pinned YAML Test Suite under both the
default YAML 1.2.2 profile and the optional libyaml-compat profile:
AYAML_STRICT_SUITE=1 cargo run --locked -p ayaml-conformance -- tests/fixtures tests/data/yaml-test-suite/srcAYAML_STRICT_SUITE=1 cargo run --locked -p ayaml-conformance --features compat -- tests/fixtures tests/data/yaml-test-suite/srcEvery README.md and docs/**/*.md Rust snippet is also compiled and executed
through crates/ayaml-conformance doctests:
cargo test --doc -p ayaml-conformance --all-features --lockedFuzzing (10 libFuzzer targets)
Section titled “Fuzzing (10 libFuzzer targets)”The fuzz/ workspace defines 10 libFuzzer targets covering parsing, typed
decoding, emission, event-stream emission, SpannedTree / Spanned<T>, merge
keys, masked error canary non-leakage, ayaml-edit, and tree-vs-event
equivalence (parse, emit, borrowed, structured, spanned,
merge_keys, masked_errors, event_emit, typed_equiv, edit).
Run the deterministic seed smoke tests or bound a live libFuzzer run:
cargo test --manifest-path fuzz/Cargo.toml --lib --lockedtimeout -k 5 120 nice -n 10 cargo +nightly fuzz run spanned -- -max_total_time=60 -rss_limit_mb=2048Adversarial tests, Miri, Kani, and mutation testing
Section titled “Adversarial tests, Miri, Kani, and mutation testing”- Adversarial DoS suite:
crates/ayaml/tests/adversarial.rsisolates hostile inputs inside child processes with a 1 GiB virtual-memory cap and wall-clock deadline. Always bound full adversarial runs:
( ulimit -v 8388608; timeout -k 5 300 nice -n 10 cargo test -p ayaml --all-features --locked )- Miri: Daily bounded scheduled CI (
.github/workflows/miri.yml) runscargo +nightly miri testacross five steps: coreayamllibrary unit tests, extended 1.0 API integration suites (frontmatter,merge_keys,document_deserializer,spanned_typed,options), error/span/state-machine/freeze integration suites (error_codes,masked_errors,api_freeze,spanned,state_machines),ayaml-editunit and integration tests (all with-Zmiri-disable-isolation), and the counting global allocator tests infuzz/src/bin/memcount.rs(under default isolation), bounded byulimit -v 8388608andtimeout. - Kani bounded model checking: Pure arithmetic, packing, and bounds
invariants (41 harnesses across 10 files) are verified via
python3 tools/run_kani.py --package ayaml --all-featuresandpython3 tools/run_kani.py --package ayaml-edit --all-features(which enforce per-harness virtual-memory, peak-RSS, and timeout bounds). - Mutation testing:
.cargo/mutants.tomland.github/workflows/mutants.ymlshardcargo-mutantswithcargo-nextest(--test-tool=nextest,--timeout 60) across 32 bounded single-worker jobs (24 forayaml, 8 forayaml-edit) in scheduled CI. - Leak gate:
tools/leak-scan/install-hook.shinstalls the pre-push hook mirroring the requiredleak scanCI check.