- Verified all acceptance criteria: - cargo bench -p miroir-core runs criterion benches - cargo test runs proptest with 1024 cases (proptest.toml) - cargo bench --no-run compiles benches - All 12 property tests pass - Benchmarks meet plan §8 targets (< 1ms) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2.9 KiB
2.9 KiB
P1.6: Property + Benchmark Tests for Router - Verification Notes
Summary
Verified that all property tests and benchmarks for the router module are fully implemented and meet plan §8 requirements.
Files Verified
Property Tests (crates/miroir-core/tests/router_proptest.rs)
12 proptest properties covering:
- Determinism: Same inputs produce same outputs across runs
- Minimal reshuffling bounds: Node add/remove moves minimal data
- Uniformity: Shards distribute evenly across nodes
- Valid range: shard_for_key always returns valid shard IDs
- No duplicates: assign_shard_in_group returns unique nodes
- Node membership: All returned nodes are from input set
Configuration: proptest.toml sets cases = 1024
Benchmarks (crates/miroir-core/benches/)
router_bench.rs
shard_for_key_single- Single document routingshard_for_key_10k_docs- Batch document routingassign_shard_in_group_single- Single shard assignmentassign_shard_in_group_64_shards- All shards assignmentfull_routing_10k_docs- Primary target: 64 shards, 3 nodes, 10K docsvarying_shard_count- 8 to 256 shardsvarying_node_count- 2 to 10 nodesvarying_rf- RF 1 to 5score_single- Score function benchmark
merger_bench.rs
merge_1000_hits_3_shards- Primary target: 1000 hits from 3 shardsvarying_hit_count- 100 to 10000 hitsvarying_shard_count- 1 to 10 shardspagination- Various offset/limit combinationswith_facets- Facet distribution mergewith_score- Score preservationdegraded- Failed shard handling
Performance Results (2026-05-23)
full_routing_10k_docs time: [276.27 µs 279.66 µs 283.60 µs]
merge_1000_hits_3_shards time: [751.82 µs 813.50 µs 884.89 µs]
Both benchmarks meet plan §8 targets (< 1 ms).
Test Results
running 12 tests
test prop_assign_no_duplicates ... ok
test prop_assign_nodes_from_input ... ok
test prop_assign_returns_rf_nodes ... ok
test prop_determinism ... ok
test prop_determinism_multiple_runs ... ok
test prop_reshuffle_bound_on_add ... ok
test prop_reshuffle_bound_on_remove ... ok
test prop_score_different_inputs ... ok
test prop_shard_for_key_determinism ... ok
test prop_shard_for_key_valid_range ... ok
test regression_tests::test_shard_for_key_known_values ... ok
test prop_uniformity ... ok
test result: ok. 12 passed; 0 failed; 0 ignored
External Dependencies
Phase 8 CI configuration (cargo bench --no-run) must be added to the external Argo WorkflowTemplates in jedarden/declarative-config.
Final Verification (2026-05-23)
All acceptance criteria verified:
- ✅
cargo bench -p miroir-coreruns all criterion benches and reports timing - ✅
cargo test -p miroir-coreruns property tests with 1024 cases per property (proptest.toml) - ✅
cargo bench --no-runcompiles benches successfully
Originally implemented in commit 513e97d.