Skip to content

Remove unnecessary distance function implementations.#1008

Open
hildebrandmw wants to merge 2 commits intomainfrom
mhildebr/remove-unnecessary-impls
Open

Remove unnecessary distance function implementations.#1008
hildebrandmw wants to merge 2 commits intomainfrom
mhildebr/remove-unnecessary-impls

Conversation

@hildebrandmw
Copy link
Copy Markdown
Contributor

Remove unnecessary distance function implementations. These are no longer needed now that distance computations are plumbed through ElementRef instead of Element directly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DistanceFunction impls for DistanceComputer that accepted &&[u8] / &Vec<u8> wrappers.
  • Removed DistanceFunction / PreprocessedDistanceFunction impls that adapted arc_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.

Comment thread diskann-providers/src/model/graph/provider/async_/memory_quant_vector_provider.rs Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.50%. Comparing base (45428af) to head (124dcd6).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1008   +/-   ##
=======================================
  Coverage   89.49%   89.50%           
=======================================
  Files         448      448           
  Lines       84118    84090   -28     
=======================================
- Hits        75282    75263   -19     
+ Misses       8836     8827    -9     
Flag Coverage Δ
miri 89.50% <100.00%> (+<0.01%) ⬆️
unittests 89.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ovider/async_/fast_memory_quant_vector_provider.rs 98.46% <100.00%> (ø)
...ph/provider/async_/memory_quant_vector_provider.rs 98.26% <100.00%> (-0.10%) ⬇️
diskann-providers/src/model/pq/distance/dynamic.rs 91.30% <ø> (+4.38%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants