-
Notifications
You must be signed in to change notification settings - Fork 2
5 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
Sources: REVIEW.md:1-140
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
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
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
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
Sources: REVIEW.md:44-76
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
- 1. Overview
- 1.1. Getting Started & Public API
- 1.2. Release History and Versioning
- 2. Core Runtime: SynapticMesh
- 2.1. Propagation APIs and Tick Semantics
- 2.2. Spike Delay Buffer (Ring Buffer)
- 2.3. Core Types and Error Model
- 2.4. Checkpointing and Serde State Restoration
- 3. Topology Subsystem
- 3.1. SynapticGraph and CSR Representation
- 3.2. Topology Generators
- 3.3. Wiring Rules, Dale's Law and Delay Assignment
- 3.4. Topology Digest
- 4. Sparse Maps and Channel Routing
- 4.1. ChannelRouter and RouterConfig
- 4.2. Neuromodulation and Plasticity
- 4.3. SparseSynapticMap (CSR)
- 5. Testing, Benchmarks and Quality Gates
- 5.1. Propagation Contract Tests
- 5.2. Checkpoint Resume Property Suite
- 5.3. Benchmarks and Unit Test Module
- 6. Build, CI and Project Tooling
- 6.1. Cargo Manifest, Profiles and Dependencies
- 6.2. CI Workflows and Packaging Validation
- 6.3. Code Quality, Licensing and Review Gates
- 7. Glossary