PiPNN 2/6: extract shared RobustPrune - #1288
Conversation
There was a problem hiding this comment.
Pull request overview
This PR factors DiskANN’s robust-prune logic into a dedicated diskann::graph::prune module, updates the graph index to call the new provider-independent kernel, and adds targeted correctness tests plus a Criterion benchmark to validate and measure pruning behavior.
Changes:
- Moved/rewrote the robust-prune kernel into
diskann/src/graph/prune.rswith explicit error handling (RobustPruneError) and supporting scratch/context types. - Updated
DiskANNIndexpruning path to delegate toprune::robust_pruneand plumb errors through existingANNError/ListErrormachinery. - Added prune integration test cases and a
robust_pruneCriterion benchmark; updated mutation-testing exclusions.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
diskann/src/graph/test/cases/prune.rs |
New integration-style prune behavior tests using the test provider. |
diskann/src/graph/test/cases/mod.rs |
Registers the new prune test module. |
diskann/src/graph/prune/tests.rs |
New unit tests for the provider-independent robust-prune kernel and error plumbing. |
diskann/src/graph/prune.rs |
New prune kernel module (policy, scratch/context, robust_prune, list error types). |
diskann/src/graph/mod.rs |
Exposes the new prune module from graph. |
diskann/src/graph/internal/prune.rs |
Removes the previous internal prune implementation/types. |
diskann/src/graph/internal/mod.rs |
Stops exporting the removed internal prune module. |
diskann/src/graph/index.rs |
Switches occlusion/prune implementation to call the new prune::robust_prune and handles its Result. |
diskann/Cargo.toml |
Adds Criterion as a dev-dependency and registers a robust_prune benchmark (gated by testing). |
diskann/benches/robust_prune.rs |
Adds a Criterion benchmark for pruning across candidate sizes, prune kinds, and saturation. |
Cargo.lock |
Records the new Criterion dependency. |
.cargo/mutants.toml |
Updates mutant exclusions to include a robust-prune mutation pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pub mod prune; | ||
|
|
| exclude_re = [ | ||
| "diskann-pipnn/src/(leaf|partition)_kernel\\.rs:.*Target<.*V4", | ||
| "diskann-pipnn/src/(leaf|partition)_kernel\\.rs:.*Target<.*Neon", | ||
| "diskann-pipnn/src/leaf_kernel\\.rs:.*replace < with <= in pair_distance", | ||
| "diskann-pipnn/src/partition_kernel\\.rs:.*replace \\* with / in process_(unary|binary)", | ||
| "diskann-pipnn/src/leaf_kernel\\.rs:.*replace > with >= in .*run_simd", | ||
| "diskann/src/graph/prune\\.rs:[0-9]+:17: replace < with <= in robust_prune", | ||
| ] |
|
@SeliMeli please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Extracts Vamana RobustPrune into a provider-independent kernel without changing selection semantics.
Review key points
Stack 2/6: #1287 → #1290