Remove direct accessor call in diskann-garnet#1098
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates diskann-garnet to avoid using the Accessor trait (and a per-call Tokio runtime) when implementing DynIndex::search_element, in preparation for the trait simplification work described in #1067. Instead, it centralizes the “read one vector by internal id” logic as an inherent method on GarnetProvider.
Changes:
- Added
GarnetProvider::get_vector(...)as a crate-visible helper for reading a single vector (including the start-point fast path). - Switched
DynIndex::search_elementto useprovider.get_vector(...)directly, removing the Tokio runtime +Accessorusage. - Refactored
FullAccessor::get_elementto delegate toGarnetProvider::get_vector(...)to avoid duplicated logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| diskann-garnet/src/provider.rs | Introduces get_vector and reuses it in the Accessor implementation. |
| diskann-garnet/src/dyn_index.rs | Removes the Accessor/Tokio runtime path and calls GarnetProvider::get_vector directly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (86.36%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1098 +/- ##
==========================================
+ Coverage 89.48% 89.49% +0.01%
==========================================
Files 474 474
Lines 89740 89737 -3
==========================================
+ Hits 80301 80312 +11
+ Misses 9439 9425 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
In preparation for #1067, switch the implementation of
DynIndex::search_elementfrom using theAccessortrait to an inherent method on the underlying provider.