Skip to content

[minmax] Expose minmax heterogeneous distance api#833

Merged
arkrishn94 merged 4 commits intomainfrom
u/adkrishnan/expose-hetero-minmax
Mar 16, 2026
Merged

[minmax] Expose minmax heterogeneous distance api#833
arkrishn94 merged 4 commits intomainfrom
u/adkrishnan/expose-hetero-minmax

Conversation

@arkrishn94
Copy link
Copy Markdown
Contributor

@arkrishn94 arkrishn94 commented Mar 16, 2026

I missed exposing the public api for minmax distance functions from #798.

Bumped version to 0.49.1

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 exposes heterogeneous MinMax distance support by generalizing MinMax distance trait impls (and related multi-vector distances) from a single bitrate const generic to separate (N, M) bitrates, enabling e.g. MinMax<8> queries against MinMax<4/2/1> documents as introduced in #798.

Changes:

  • Generalize MinMaxIP, MinMaxL2Squared, MinMaxCosine, and MinMaxCosineNormalized to accept different bitrates for left/right operands.
  • Update MinMax multi-vector MaxSim/Chamfer implementations and tests to cover heterogeneous (8,4), (8,2), (8,1) cases.
  • Adjust heterogeneous InnerProduct test labels to pass lazy_format!(...) by value.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
diskann-quantization/src/minmax/vectors.rs Makes MinMax single-vector distance impls heterogeneous via (N, M) const generics.
diskann-quantization/src/minmax/multi/max_sim.rs Extends MinMax multi-vector distances to heterogeneous bitrates and adds tests for them.
diskann-quantization/src/bits/distances.rs Minor test harness update to pass lazy_format! without borrowing.

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

You can also share your feedback on Copilot code review. Take the survey.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 94.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.10%. Comparing base (85e5e48) to head (a5ddc51).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
diskann-quantization/src/minmax/multi/max_sim.rs 88.46% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #833      +/-   ##
==========================================
- Coverage   89.11%   89.10%   -0.01%     
==========================================
  Files         443      443              
  Lines       83354    83359       +5     
==========================================
+ Hits        74278    74280       +2     
- Misses       9076     9079       +3     
Flag Coverage Δ
miri 89.10% <94.00%> (-0.01%) ⬇️
unittests 88.94% <94.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
diskann-quantization/src/bits/distances.rs 98.93% <100.00%> (ø)
diskann-quantization/src/minmax/vectors.rs 94.77% <100.00%> (+0.03%) ⬆️
diskann-quantization/src/minmax/multi/max_sim.rs 98.10% <88.46%> (+0.03%) ⬆️

... and 6 files with indirect coverage changes

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

@arkrishn94 arkrishn94 merged commit 72fc467 into main Mar 16, 2026
24 checks passed
@arkrishn94 arkrishn94 deleted the u/adkrishnan/expose-hetero-minmax branch March 16, 2026 21:40
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.

5 participants