镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Adding subview_mut to MatrixMut - #1463

Merged
Aditya Krishnan (arkrishn94) merged 1 commit into
mainfrom
u/adkrishnan/subview-mut
Oct 6, 2026
Merged

Aditya Krishnan (arkrishn94) merged 1 commit into
mainfrom
u/adkrishnan/subview-mut

Conversation

@arkrishn94

@arkrishn94 Aditya Krishnan (arkrishn94) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces a subview_mut method to the recently added MatrixMut trait so that we can copy data in bulk into "subviews" of a mutable matrix.

So copying data from a ref: Ref<'_, T> into a mut: Mut<'_, T> can be done with something like this -

let range = 0..ref.nrows();
let subview = mut.subview_mut(range).ok_or(panic!("incorrect range")); 
subview.as_mut_slice().copy_from_slice(ref.as_slice())

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation preserves existing layout and borrowing contracts, with tests covering range validation and nested writes.

Review effort: Balanced
Findings: None

What changed in this PR

Adds mutable row subviews to MatrixMut, enabling bulk writes into selected matrix rows.

Changes:

  • Adds subview_mut with range validation.
  • Extends tests for boundary cases, zero-column matrices, and nested mutations.
File Description
diskann-utils/​src/​views/​rowmajor.rs Implements mutable subviews and extends subview tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.92%. Comparing base (bab8136) to head (f33ae73).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1463   +/-   ##
=======================================
  Coverage   91.92%   91.92%           
=======================================
  Files         583      583           
  Lines      115876   115903   +27     
=======================================
+ Hits       106523   106549   +26     
- Misses       9353     9354    +1     
Flag Coverage Δ
miri 91.92% <100.00%> (+<0.01%) ⬆️
unittests 91.87% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
diskann-utils/src/views/rowmajor.rs 96.96% <100.00%> (+0.06%) ⬆️

... 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
Aditya Krishnan (arkrishn94) merged commit 8bb80cf into main Oct 6, 2026
32 checks passed
@arkrishn94
Aditya Krishnan (arkrishn94) deleted the u/adkrishnan/subview-mut branch October 6, 2026 18:55
Mark Hildebrand (hildebrandmw) added a commit that referenced this pull request Oct 26, 2026
# DiskANN v0.61.0

## Highlights

- **Quantization:** Added 3-bit spherical quantization with AVX2
acceleration, faster
  spherical encoding, and NEON float32 MinMax kernels.
- **In-memory indexing (experimental):** Added product quantization and
1-8-bit scalar
quantization, unified quantized representations, and AArch64
prefetching.
- **Multi-vector search:** Added `i8 x i8` and MinMax8 x MinMax4 MaxSim
kernels.
- **Fixes:** Preserve virtual start-point out-edges when writing disk
indexes, correctly
round-trip scalar quantization configurations without standard
deviation, and support
  zero-column mutable matrix iterators.

## Breaking changes and upgrading

Changes are concentrated in quantization APIs and experimental/tooling
crates.

* PQ training (#1467) - Training now returns `BasicTable`.
`SimplePivots` was removed.
Replace `flatten()` with `view_pivots().as_slice()` and use
`pivots_for(chunk)` for
  per-chunk access.
* PQ distance tables (#1458) - Change `ProcessInto` bounds to
`ProcessInto<f32>` and calls
from `process_into::<Metric>(...)` to `process_into::<Metric,
f32>(...)`.
* MaxSim kernels (#1429) - Generic kernel/erasure code now requires `T:
MaxSimElement` and
score buffers of `T::Score` (`f32` for floats, `i32` for `i8`). Update
`build_max_sim`
  error handling from `NotSupported` to `BuildMaxSimError`.
* `diskann-inmem` (#1485) - Replace `repr::Spherical` with
`repr::Quantized`. Wrap the
quantizer in `repr::quantized::spherical::Spherical::new(...)` when
configuring it.
  Configuration and `Rerank` types now live under `repr::quantized`.
* `diskann-benchmark-runner` (#1475) - `input::Registered` and public
`Registry::input` were
removed. Use the concrete `Input` implementation's `tag()` and
`example()` methods instead.

## All Changes
* Fix serialization round trip for QuantizationType::SQ without standard
deviation by @arrayka in #1461
* i8 x i8 MaxSim Kernels by @suri-kumkaran in
#1429
* Adding `subview_mut` to `MatrixMut` by @arkrishn94 in
#1463
* Add InsertResult::SuccessUpdate by @metajack in
#1449
* [diskann-quantization] PQ Infrastructure for `diskann-inmem` by
@hildebrandmw in #1458
* [diskann-quantization] Teach PQ training to return a `BasicTable`. by
@hildebrandmw in #1467
* [deps] Run `cargo-update` by @hildebrandmw in
#1452
* Support zero-column mutable matrix iterators by @arrayka in
#1462
* [diskann-quantization] Use `f32::NAN` instead of `core::f32::NAN`. by
@hildebrandmw in #1471
* [diskann-wide] Add `V4::new_checked_miri_uncached`. by @hildebrandmw
in #1480
* [diskann-wide] Add maddubs intrinsic wrappers to V3 and V4 by
@partychen in #1479
* Bump the github-actions group across 1 directory with 5 updates by
@dependabot[bot] in #1482
* [benchmark-runner] Simplify Input representation by @hildebrandmw in
#1475
* [diskann-quantization] Optimize spherical encoding scale search by
@xinyuwen2 in #1478
* [diskann-garnet] Implement XVCREATE, XVIMPORT by @metajack in
#1455
* [diskann-garnet] Support configurable start points and allow importing
start points by @metajack in
#1464
* [diskann-garnet] Add spherical 2-bit and 4-bit quantization by
@metajack in #1465
* [deps] Address depandabot issue 32 by @hildebrandmw in
#1496
* [diskann-disk] Preserve virtual start point out-edges when writing the
disk index by @doliawu in #1483
* [diskann-quantization] Add Neon F32 Minmax Kernels by @pfoxARM in
#1431
* [diskann-garnet] Add macOS arm64 support to NuGet publishing by
@metajack in #1495
* [diskann-disk] Require start points at index initialization. by
@hildebrandmw in #1497
* Expose metric-aware quantizer centroid distance by @cherryrhea in
#1395
* [diskann-inmem] Add support for Product Quantization by @hildebrandmw
in #1469
* Adds aarch64 prefetching into diskann-vector and diskann-inmem by
@pfoxARM in #1408
* [diskann-inmem] Add scalar quantization by @hildebrandmw in
#1484
* Bump the github-actions group with 3 updates by @dependabot[bot] in
#1505
* [diskann-inmem] Spherical Quantization Round 2 by @hildebrandmw in
#1485
* [diskann-quantization] Add SphericalQ 3-bit support and AVX2 kernel by
@xinyuwen2 in #1474
* [muilt-vetor] Add standalone MinMax8 x MinMax4 MaxSim kernel by
@partychen in #1494

## New Contributors
* @cherryrhea made their first contribution in
#1395

**Full Changelog**:
v0.60.0...v0.61.0

Co-authored-by: Mark Hildebrand <mhildebrand@microsoft.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.

5 participants