Skip to content

5 Testing Benchmarks and Quality Gates

Raul Cardenas Montoya edited this page Sep 19, 2026 · 1 revision

Testing, Benchmarks and Quality Gates

Relevant source files

The following files were used as context for generating this wiki page:

The synaptic-wiring codebase relies on a multi-tiered validation architecture encompassing contract tests, property-based checkpoint-resume harnesses, Criterion-based performance benchmarks, and strict CI/local quality gates. These mechanisms ensure zero-allocation runtime guarantees, determinism across topological state transitions, and strict adherence to the Minimum Supported Rust Version (MSRV) [REVIEW.md:7-15] and packaging constraints [REVIEW.md:44-56].

For detailed technical breakdowns of specific test suites and benchmarking harnesses, see the child pages:

graph TD
    sub5[Testing and Quality Gates]
    sub5 -->|Contract Verification| Sub51["Propagation Contracts\n(tests/propagate_contract.rs)"]
    sub5 -->|Property Testing| Sub52["Checkpoint Resume\n(tests/checkpoint_resume)"]
    sub5 -->|Performance Tracking| Sub53["Criterion Benchmarks\n(benches/propagate.rs)"]
    sub5 -->|Human/CI Quality Bar| Sub54["Quality Gates\n(REVIEW.md)"]

    style sub5 fill:none,stroke:#000,stroke-width:2px
    style Sub51 fill:none,stroke:#000,stroke-width:1px
    style Sub52 fill:none,stroke:#000,stroke-width:1px
    style Sub53 fill:none,stroke:#000,stroke-width:1px
    style Sub54 fill:none,stroke:#000,stroke-width:1px
Loading

Sources: REVIEW.md:1-140


5.1 Propagation Contract Tests

Propagation contract tests validate the core tick semantics, zero-allocation runtime pathways, and output correctness of the synaptic mesh under diverse workload patterns. These tests enforce that hot-path execution does not dynamically allocate memory and that state transitions follow deterministic routing rules.

For a complete breakdown of contract requirements, buffer management, and allocation guarantees, see Propagation Contract Tests.

Sources: REVIEW.md:1-140


5.2 Checkpoint Resume Property Suite

The checkpoint-resume property suite (tests/checkpoint_resume) provides property-based testing harness recipes, random case generation, comparison logic, and automated failure shrinking. It validates that serializing and deserializing mesh states via JSON and postcard formats preserves topological integrity and runtime state across arbitrary state boundaries.

For implementation details on seeded case generation, environment variable configuration via CHECKPOINT_RESUME_CASES, and regression fixtures, see Checkpoint Resume Property Suite.

Sources: REVIEW.md:78-93


5.3 Benchmarks and Unit Test Module

Performance stability is maintained through the Criterion benchmarking suite (benches/propagate.rs) running under the dedicated bench profile configuration. In addition to external benchmarks, in-crate unit and integration tests (src/tests.rs) provide continuous validation of foundational data structures.

For configuration details regarding the bench profile, optimization flags, and benchmark harness structures, see Benchmarks and Unit Test Module.

Sources: REVIEW.md:27-42


Quality Gates and CI Enforcement

Human and automated quality gates enforce strict consistency across build profiles, MSRV pins, dependency graphs, and package layouts. Developers must execute mandatory validation commands prior to PR submission [REVIEW.md:4-5, 66-76].

graph TD
    GateCheck[Mandatory Local Checks] --> Format["cargo fmt --check\n(REVIEW.md:72)"]
    GateCheck --> Test["cargo test --locked\n(REVIEW.md:74)"]
    GateCheck --> Lint["cargo clippy --all-features -- -D warnings\n(REVIEW.md:75)"]
    GateCheck --> Package["cargo package --locked\n(REVIEW.md:51)"]

    style GateCheck fill:none,stroke:#000,stroke-width:2px
    style Format fill:none,stroke:#000,stroke-width:1px
    style Test fill:none,stroke:#000,stroke-width:1px
    style Lint fill:none,stroke:#000,stroke-width:1px
    style Package fill:none,stroke:#000,stroke-width:1px
Loading

Sources: REVIEW.md:44-76

Build Profiles and MSRV Pinning

Cargo.toml defines four specific build profiles (dev, test, release, and bench) tuned for compilation speed, test throughput, binary release optimization, and profiling retention respectively [REVIEW.md:27-39]. Furthermore, the MSRV is strictly pinned to 1.98.1 across Cargo.toml, rust-toolchain.toml, README.md, and CI workflow configurations to prevent toolchain drift [REVIEW.md:7-15].

Sources: REVIEW.md:7-42

Clone this wiki locally