miroir/notes/miroir-cdo.6.md
jedarden 1458145a28 P1.6: Verify property tests and benchmarks for router
- Verified all 12 proptest property tests pass with 1024 cases
- Verified all 9 criterion benchmarks run successfully
- Full routing pipeline for 10K docs: 272 µs (well under 1ms target)
- CI includes `cargo bench --no-run` for compilation check

Acceptance criteria:
- ✓ cargo bench runs all criterion benches
- ✓ cargo test runs property tests with 1024 cases (proptest.toml)
- ✓ CI compiles benchmarks on every build

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 09:06:52 -04:00

1.6 KiB

P1.6 Property + Benchmark Tests Verification

Summary

Verified that all property tests and criterion benchmarks for the router are in place and functional.

Acceptance Criteria Met

1. Criterion Benchmarks ✓

  • cargo bench -p miroir-core --bench router_bench runs successfully
  • 9 benchmarks covering:
    • shard_for_key_single: 28 ns avg
    • shard_for_key_10k_docs: 268 µs avg
    • assign_shard_in_group_single: 114 ns avg
    • assign_shard_in_group_64_shards: 12.2 µs avg
    • full_routing_10k_docs: 272 µs avg (well under 1ms target)
    • Varying shard counts: 8, 16, 32, 64, 128, 256
    • Varying node counts: 2, 3, 4, 5, 8, 10
    • Varying replication factors: 1, 2, 3, 5
    • score_single: 23 ns avg

2. Property Tests ✓

  • cargo test -p miroir-core --test router_proptest runs successfully
  • 12 property tests covering:
    • Determinism (single and multiple runs)
    • shard_for_key determinism and valid range
    • Minimal reshuffling bounds on add/remove
    • Uniformity across nodes
    • Return count validation (exactly RF nodes)
    • Node from input validation
    • No duplicates validation
    • Score function differentiation
  • proptest.toml configured for 1024 cases per property

3. CI Integration ✓

  • k8s/argo-workflows/miroir-ci.yaml line 124 includes cargo bench --no-run
  • Benchmarks compile on every CI build

Files Verified

  • crates/miroir-core/benches/router_bench.rs - Criterion benchmarks
  • crates/miroir-core/tests/router_proptest.rs - Proptest property tests
  • crates/miroir-core/src/router.rs - Router implementation with tests
  • proptest.toml - Proptest configuration (1024 cases)