Repository navigation
PiPNN 5/6: add HashPrune candidate merging - #1591
Open
weiyaoluo (SeliMeli) wants to merge 2 commits into
Open
weiyaoluo (SeliMeli) wants to merge 2 commits into
weiyaoluo (SeliMeli) wants to merge 2 commits into
Conversation
Merge leaf candidates into bounded direction-hash reservoirs. Expose HashPrune settings through the disk PiPNN configuration. Add direct and HashPrune disk-build coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # diskann-disk/src/build/builder/tests.rs # diskann-disk/src/build/configuration/build_algorithm.rs # diskann-disk/src/build/configuration/mod.rs
weiyaoluo (SeliMeli)
requested review from
a team
and
a balanced review from Copilot
November 11, 2026 08:06
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Tie handling violates the required deterministic candidate order, and CSR conversion lacks regression coverage for unassigned slots and reused scratch flags.
2 open issues
What changed in this PR
Adds optional HashPrune candidate merging to PiPNN’s batch graph builder, extending the disk-build integration while keeping direct merging as the default.
Changes:
- Adds seeded hyperplane sketches and bounded, per-point candidate reservoirs with optional final RobustPrune.
- Converts leaf candidates into symmetric CSR edges while excluding unassigned kernel slots.
- Adds SIMD optimizations, disk integration coverage, and nightly Miri checks.
| File | Description |
|---|---|
diskann/src/graph/pipnn/mod.rs |
Adds HashPrune configuration, validation, and build routing. |
diskann/src/graph/pipnn/lsh.rs |
Generates seeded random-hyperplane sketches. |
diskann/src/graph/pipnn/leaf_build.rs |
Builds symmetric CSR edges for reservoir ingestion. |
diskann/src/graph/pipnn/hash_prune.rs |
Implements locked reservoirs, candidate selection, and extraction. |
diskann/src/graph/pipnn/bf16.rs |
Adds compact distance conversion and tests. |
diskann/src/graph/adjacencylist.rs |
Allows allocation-preserving conversion of unique neighbor vectors. |
diskann/Cargo.toml |
Adds optional HashPrune dependencies to PiPNN. |
diskann-wide/src/doubled.rs |
Optimizes first-set-lane lookup for doubled masks. |
diskann-wide/src/arch/x86_64/v3/i16x16_.rs |
Uses native SIMD instructions for equality masks. |
diskann-disk/src/build/builder/tests.rs |
Tests HashPrune disk builds over MinMax-decoded rows. |
Cargo.lock |
Records the added dependencies. |
.github/workflows/nightly.yml |
Adds strict-provenance Miri checks for sketches and reservoirs. |
Review effort: Balanced
Comment on lines
+498
to
+500
| if state.len >= l_max && dist_key >= state.farthest_dist { | ||
| return false; | ||
| } |
| grow(offsets, point_count + 1, 0); | ||
| offsets[..point_count + 1].fill(0); | ||
| for (source, neighbors) in neighbors.chunks_exact(leaf_k).enumerate() { | ||
| for neighbor in neighbors.iter().filter(|neighbor| neighbor.is_assigned()) { |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## pipnn-stack/04-integration #1591 +/- ##
==============================================================
+ Coverage 92.20% 92.24% +0.03%
==============================================================
Files 621 624 +3
Lines 130490 131750 +1260
==============================================================
+ Hits 120318 121527 +1209
- Misses 10172 10223 +51
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Purpose
This PR adds optional HashPrune candidate merging to PiPNN.
Direct candidate merging remains the default.
Main changes
lsh.rscreates deterministic random-hyperplane sketches.final_prune=truesends reservoir candidates to shared RobustPrune.final_prune=falsereturns the nearest graph-degree candidates.Required invariants
l_maxdoes not exceed the structural reservoir limit.Review order
HashPruneConfigandBuilder::hash_pruneinmod.rs.lsh.rs.hash_prune.rs.hash_prune.rs.leaf_build.rs.Validation
diskannPiPNN library tests pass.Stack
Stack 5/6. Depends on #1291. #1294 adds the benchmark routes.
This PR replaces #1295. The stack order changed, and GitHub closed #1295 as merged. The earlier review of HashPrune is on #1295.