Move ObjectPool from diskann to diskann-utils#975
Merged
arkrishn94 merged 1 commit intomainfrom Apr 25, 2026
Merged
Conversation
Relocates the object pool module so that it is available to crates that depend on diskann-utils but not diskann (notably diskann-quantization, which will gain pool-aware distance-table allocation in a follow-up). diskann::utils::object_pool stays as a re-export for backwards compatibility. Direct importers in diskann-providers, diskann-disk, and diskann-garnet are switched to use diskann_utils::object_pool directly. Internal diskann users continue to use the re-export.
Contributor
There was a problem hiding this comment.
Pull request overview
Relocates the ObjectPool implementation from diskann into diskann-utils so pooling utilities can be used by crates that depend on diskann-utils without pulling in diskann (e.g., upcoming quantization work).
Changes:
- Removed
diskann::utils::object_poolmodule and updateddiskanncall sites to import pooling types fromdiskann_utils::object_pool. - Added
diskann-utils::object_poolmodule (including tests) and exported it fromdiskann-utils’slib.rs. - Updated direct importers in
diskann-providers,diskann-disk, anddiskann-garnetto usediskann_utils::object_pool.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| diskann/src/utils/mod.rs | Stops exposing object_pool from diskann::utils (public API surface change). |
| diskann/src/graph/search/scratch.rs | Switches AsPooled import to diskann_utils::object_pool. |
| diskann/src/graph/index.rs | Switches ObjectPool/PooledRef import to diskann_utils::object_pool. |
| diskann-utils/src/object_pool.rs | New pooled-object implementation + tests moved into diskann-utils. |
| diskann-utils/src/lib.rs | Exposes the new object_pool module publicly. |
| diskann-providers/src/model/pq/distance/{common,dynamic,innerproduct,l2}.rs | Updates pooling imports to diskann_utils. |
| diskann-providers/src/model/graph/provider/async_/{memory_quant_vector_provider,fast_memory_quant_vector_provider,bf_tree/quant_vector_provider}.rs | Updates ObjectPool import to diskann_utils. |
| diskann-garnet/src/provider.rs | Updates pooling imports to diskann_utils. |
| diskann-disk/src/search/provider/disk_provider.rs | Updates pooling imports to diskann_utils. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #975 +/- ##
==========================================
- Coverage 89.43% 89.42% -0.01%
==========================================
Files 449 449
Lines 83779 83779
==========================================
- Hits 74926 74923 -3
- Misses 8853 8856 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
metajack
approved these changes
Apr 24, 2026
doliawu
approved these changes
Apr 25, 2026
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.
Relocates the object pool module so that it is available to crates that depend on
diskann-utilsbut notdiskann.Warning: This a public API breaking change.
Motivation
Implement pool-aware distance-table allocation for PQ in
diskann-quantization.Direct importers in
diskann-providers,diskann-disk, anddiskann-garnetare switched to usediskann_utils::object_pooldirectly.