Remove unnecessary distance function implementations.#1008
Open
hildebrandmw wants to merge 2 commits intomainfrom
Open
Remove unnecessary distance function implementations.#1008hildebrandmw wants to merge 2 commits intomainfrom
hildebrandmw wants to merge 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes now-redundant DistanceFunction overload impls (previously used to smooth over extra reference layers / Vec<u8> wrappers) after distance computations were moved to flow through ElementRef rather than Element.
Changes:
- Removed several
DistanceFunctionimpls forDistanceComputerthat accepted&&[u8]/&Vec<u8>wrappers. - Removed
DistanceFunction/PreprocessedDistanceFunctionimpls that adaptedarc_swap::Guard<Arc<Vec<u8>>>to slices in the in-memory quant provider. - Updated affected tests to pass
&[u8](via.as_slice()/ deref) and adjusted trait imports accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
diskann-providers/src/model/pq/distance/dynamic.rs |
Drops wrapper DistanceFunction impls for DistanceComputer (keeping the core slice-based impls). |
diskann-providers/src/model/graph/provider/async_/memory_quant_vector_provider.rs |
Removes Guard-based distance trait impls; updates tests/imports to use slice-based calls. |
diskann-providers/src/model/graph/provider/async_/fast_memory_quant_vector_provider.rs |
Updates tests to pass &[u8] directly instead of &&[u8]. |
diskann-providers/src/model/graph/provider/async_/bf_tree/quant_vector_provider.rs |
Updates tests to pass &[u8] (via .as_slice()) for quant distance comparisons. |
💡 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 #1008 +/- ##
=======================================
Coverage 89.49% 89.50%
=======================================
Files 448 448
Lines 84118 84090 -28
=======================================
- Hits 75282 75263 -19
+ Misses 8836 8827 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
harsha-simhadri
approved these changes
May 2, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Remove unnecessary distance function implementations. These are no longer needed now that distance computations are plumbed through
ElementRefinstead ofElementdirectly.