Skip to content

Remove AlignedBoxWithSlice in favor of Poly<[T], AlignedAllocator> directly#908

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/remove-alignedboxwithslice
Draft

Remove AlignedBoxWithSlice in favor of Poly<[T], AlignedAllocator> directly#908
Copilot wants to merge 4 commits intomainfrom
copilot/remove-alignedboxwithslice

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

  • Understand the current state of aligned_alloc and AlignedSlice usage
  • Add AlignedSlice<T> type alias and aligned_slice convenience function to diskann-quantization::alloc
  • Add tests for the new function in diskann-quantization
  • Update diskann-providers to re-export from diskann-quantization (backward compat) and update common/mod.rs
  • Update diskann-disk callers to import from diskann_quantization::alloc
  • Update diskann-tools callers to import from diskann_quantization::alloc
  • Update diskann-disk and diskann-providers bench files
  • Delete diskann-providers/src/common/aligned_allocator.rs
  • Run clippy, fmt — all clean
  • Run parallel_validation and address feedback
  • Final validation — all checks pass

Copilot AI linked an issue Apr 6, 2026 that may be closed by this pull request
…aligned_alloc constructor

- Replace AlignedBoxWithSlice<T> struct with type alias AlignedSlice<T> = Poly<[T], AlignedAllocator>
- Add aligned_alloc<T>() constructor function
- Replace split_into_nonoverlapping_mut_slices() with standard chunks_mut()
- Replace memcpy() with standard copy_from_slice()
- Replace as_slice()/as_mut_slice() with direct Deref/DerefMut access
- Update all usages in diskann-providers, diskann-disk, and diskann-tools

Agent-Logs-Url: https://github.com/microsoft/DiskANN/sessions/03833fc4-6079-4233-b63d-96e1a0eb246d

Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove AlignedBoxWithSlice and replace with Poly Remove AlignedBoxWithSlice in favor of Poly<[T], AlignedAllocator> directly Apr 6, 2026
Copilot AI requested a review from harsha-simhadri April 6, 2026 20:55
Copilot AI and others added 2 commits April 6, 2026 22:29
…ntization::alloc

- Add `AlignedSlice<T>` type alias and `aligned_slice()` convenience function
  to `diskann-quantization::alloc` with `AllocatorError` return type (no
  ANNError coupling)
- Add tests for the new function in diskann-quantization
- Update diskann-disk source, tests, and benchmarks to import from
  diskann_quantization::alloc
- Update diskann-tools to import from diskann_quantization::alloc
- Update diskann-providers bench files to import from diskann_quantization::alloc
- Keep backward-compatible re-exports in diskann-providers::common
- Delete diskann-providers/src/common/aligned_allocator.rs

Agent-Logs-Url: https://github.com/microsoft/DiskANN/sessions/602b854a-223a-423c-a053-70c24744a4a5

Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
…h.rs error handling

Agent-Logs-Url: https://github.com/microsoft/DiskANN/sessions/602b854a-223a-423c-a053-70c24744a4a5

Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@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.

Get rid of AlignedBoxWithSlice.

2 participants