Skip to content

BufferedFnPtr and take UnalignedSlice.#1113

Open
hildebrandmw wants to merge 2 commits into
mainfrom
mhildebr/buffered-fn-ptr
Open

BufferedFnPtr and take UnalignedSlice.#1113
hildebrandmw wants to merge 2 commits into
mainfrom
mhildebr/buffered-fn-ptr

Conversation

@hildebrandmw
Copy link
Copy Markdown
Contributor

An oversight from #981.

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 fixes an oversight from #981 by extending BufferedDistance so it can evaluate distances against potentially unaligned input buffers via UnalignedSlice, aligning diskann’s buffered query-distance wrapper with the updated diskann-vector unaligned-distance API.

Changes:

  • Import AsUnaligned and UnalignedSlice from diskann_vector.
  • Add PreprocessedDistanceFunction<UnalignedSlice<'_, T>> impl for BufferedDistance<T, U>, forwarding through Distance::call_unaligned.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +241 to +245
impl<T, U> PreprocessedDistanceFunction<UnalignedSlice<'_, T>> for BufferedDistance<T, U> {
#[inline(always)]
fn evaluate_similarity(&self, x: UnalignedSlice<'_, T>) -> f32 {
self.f.call_unaligned((&*self.query).as_unaligned(), x)
}
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.53%. Comparing base (f8bbf3e) to head (890faf6).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1113      +/-   ##
==========================================
+ Coverage   89.46%   90.53%   +1.07%     
==========================================
  Files         482      482              
  Lines       91092    91108      +16     
==========================================
+ Hits        81497    82488     +991     
+ Misses       9595     8620     -975     
Flag Coverage Δ
miri 90.53% <100.00%> (+1.07%) ⬆️
unittests 90.50% <100.00%> (+1.38%) ⬆️

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

Files with missing lines Coverage Δ
diskann/src/utils/vector_repr.rs 80.72% <100.00%> (+0.12%) ⬆️

... and 39 files with indirect coverage changes

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

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