Skip to content

[minmax] Refactor full query#770

Merged
arkrishn94 merged 2 commits intomainfrom
u/adkrishnan/minmax-full-slice
Feb 12, 2026
Merged

[minmax] Refactor full query#770
arkrishn94 merged 2 commits intomainfrom
u/adkrishnan/minmax-full-slice

Conversation

@arkrishn94
Copy link
Contributor

@arkrishn94 arkrishn94 commented Feb 12, 2026

Refactor full precision queries for minmax to use Slice and its variants.

Copy link
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

Refactors MinMax full-precision query handling to use the shared meta::slice abstractions (Slice/PolySlice and borrowed variants), reducing bespoke query container code and aligning query handling with the rest of the quantization metadata-slice patterns.

Changes:

  • Replaces the bespoke FullQuery struct in MinMax with slice::PolySlice and introduces FullQueryRef / FullQueryMut.
  • Updates MinMax distance function impls and the MinMax quantizer to operate on FullQueryRef/FullQueryMut and Slice accessors (vector(), meta()).
  • Adds Reborrow/ReborrowMut support for owning PolySlice and updates benchmark wiring accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
diskann-quantization/src/minmax/vectors.rs Replaces FullQuery struct with PolySlice aliases; updates distance functions and tests to use FullQueryRef and slice accessors.
diskann-quantization/src/minmax/quantizer.rs Updates full-precision query compression to take FullQueryMut and write via vector_mut() / meta_mut().
diskann-quantization/src/minmax/multi/meta.rs Formatting-only change (blank line).
diskann-quantization/src/minmax/mod.rs Re-exports new FullQueryRef/FullQueryMut alongside FullQuery.
diskann-quantization/src/meta/slice.rs Adds Reborrow / ReborrowMut impls for owning PolySlice to produce SliceRef/SliceMut.
diskann-benchmark/src/backend/exhaustive/minmax.rs Updates exhaustive benchmark to use FullQueryRef and allocate FullQuery via new_in.
Comments suppressed due to low confidence (1)

diskann-quantization/src/minmax/vectors.rs:168

  • The doc comment for FullQueryMeta describes the inner product as between X = ax * X' + bx and Y, but the implementation for full-precision queries applies a/b from y.meta() (the quantized vector), not from the query. Please update the formula/variable names to match the code path (full-precision query vs quantized data vector) to avoid confusion.
/// The inner product between `X = ax * X' + bx` and `Y` for d-dimensional
/// vectors X and Y is:
/// ```math
/// <X, Y> = <ax * X' + bx, Y>
///        = ax * <X', Y> + bx * sum(Y).

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

@arkrishn94
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.98%. Comparing base (87a0757) to head (1071f89).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
diskann-quantization/src/minmax/quantizer.rs 83.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #770   +/-   ##
=======================================
  Coverage   88.98%   88.98%           
=======================================
  Files         428      428           
  Lines       78365    78415   +50     
=======================================
+ Hits        69730    69781   +51     
+ Misses       8635     8634    -1     
Flag Coverage Δ
miri 88.98% <94.87%> (+<0.01%) ⬆️
unittests 88.98% <94.87%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
diskann-benchmark/src/backend/exhaustive/minmax.rs 100.00% <ø> (ø)
diskann-quantization/src/meta/slice.rs 99.50% <100.00%> (+0.03%) ⬆️
diskann-quantization/src/minmax/vectors.rs 94.77% <100.00%> (+0.69%) ⬆️
diskann-quantization/src/minmax/quantizer.rs 91.55% <83.33%> (-0.63%) ⬇️

... and 21 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 23ab1cd into main Feb 12, 2026
22 checks passed
@arkrishn94 arkrishn94 deleted the u/adkrishnan/minmax-full-slice branch February 12, 2026 16:10
hildebrandmw added a commit that referenced this pull request Feb 13, 2026
## What's Changed

### API Breaking Changes
* Remove the `experimental_avx512` feature. by @hildebrandmw in
#732
* Use VirtualStorageProvider::new_overlay(test_data_root()) in tests by
@Copilot in #726
* save and load max_record_size and leaf_page_size for bftrees by
@backurs in #724
* [multi-vector] Verify `Standard` won't overflow in its constructor. by
@hildebrandmw in #757
* VirtualStorageProvider: Make new() private, add new_physical by
@Copilot in #764
* [minmax] Refactor full query by @arkrishn94 in
#770
* Bump diskann-quantization to edition 2024. by @hildebrandmw in
#772

### Additions
* [multi-vector] Enable cloning of `Mat` and friends. by @hildebrandmw
in #759
* adding bftreepaths in mod.rs by @backurs in
#775
* [quantization] Add `as_raw_ptr`. by @hildebrandmw in
#774

### Bug Fixes
* Fix `diskann` compilation without default-features and add CI tests.
by @hildebrandmw in #722

### Docs and Comments
* Updating the benchmark README to use diskann-benchmark by @bryantower
in #709
* Fix doc comment: Windows line endings are \r\n not \n\r by @Copilot in
#717
* Fix spelling errors in streaming API documentation by @Copilot in
#715
* Add performance diagnostic to `diskann-benchmark` by @hildebrandmw in
#744
* Add agents.md onboarding guide for coding agents by @Copilot in
#765
* [doc] Fix lots of little typos in `diskann-wide` by @hildebrandmw in
#771

### Performance
* [diskann-wide] Optimize `load_simd_first` for 8-bit and 16-bit element
types. by @hildebrandmw in #747

### Dependencies
* Bump bytes from 1.11.0 to 1.11.1 by @dependabot[bot] in
#723
* [diskann] Add note on the selection of `PruneKind` in
`graph::config::Builder`. by @hildebrandmw in
#734
* [diskann-providers] Remove the LRU dependency and make `vfs` and
`serde_json` optional. by @hildebrandmw in
#733

### Infrastructure
* Add initial QEMU tests for `diskann-wide`. by @hildebrandmw in
#719
* [CI] Skip coverage for Dependabot. by @hildebrandmw in
#725
* Add miri test coverage to CI workflow by @Copilot in
#729
* [CI] Add minimal ARM checks by @hildebrandmw in
#745
* Enable CodeQL security analysis by @Copilot in
#754

## New Contributors
* @backurs made their first contribution in
#724
* @arkrishn94 made their first contribution in
#770

**Full Changelog**:
0.45.0...0.46.0
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