ruvector/crates/ruvector-diskann
rUv c7aed50817
fix(diskann): seed test RNGs to fix flaky test_diskann_basic (#397)
`test_diskann_basic` and the other random-data tests in
`crates/ruvector-diskann/src/index.rs` used `rand::thread_rng()`, so
each CI run drew different vectors. The test asserts that the nearest
neighbour of `vec-42` is `vec-42` itself; with unfavourable random
draws the ANN graph traversal happened to settle on a near-duplicate
(seen on main as `left: "vec-364"` vs `right: "vec-42"`) and the
assertion failed.

Fix: replace `thread_rng()` with `StdRng::seed_from_u64(0xD15CA77)` in
`random_vectors()`, `test_recall_at_10`, and `test_scale_5k`. Output
is fully deterministic across runs and platforms; verified locally
with three repeats of `test_diskann_basic` and the full lib-test suite
(17/17 passing in 49.6s).

No production-code changes; tests-only.

Co-authored-by: ruvnet <ruvnet@gmail.com>
2026-04-27 01:53:18 -04:00
..
src fix(diskann): seed test RNGs to fix flaky test_diskann_basic (#397) 2026-04-27 01:53:18 -04:00
Cargo.toml chore(workspace): clippy-clean every crate under -D warnings + fmt + repair pre-existing broken benches 2026-04-25 17:00:20 -04:00