[diskann-disk] Decouple buffer memory alignment from disk block_size#984
Draft
doliawu wants to merge 1 commit intomicrosoft:mainfrom
Draft
[diskann-disk] Decouple buffer memory alignment from disk block_size#984doliawu wants to merge 1 commit intomicrosoft:mainfrom
doliawu wants to merge 1 commit intomicrosoft:mainfrom
Conversation
wuw92
reviewed
Apr 28, 2026
Contributor
|
For awareness, this PR overlaps with @hildebrandmw's review direction on #965: #965 (review) His two concrete asks there both touch this PR:
|
wuw92
approved these changes
Apr 28, 2026
wuw92
reviewed
Apr 28, 2026
DiskSectorGraph previously allocated sectors_data aligned to block_size (typically 4096), conflating the on-disk stride with the reader's hardware/OS memory-placement requirement. Move the requirement where it belongs: declare it on the reader as AlignedFileReader::MEMORY_ALIGNMENT (default PowerOfTwo::V1; direct-I/O readers override to PowerOfTwo::V512) and have the buffer allocator honor that. Drop the per-request alignment check from AlignedRead::new — that constraint is the caller's responsibility (DiskSectorGraph's offsets and lengths are already block_size-aligned by construction). Making construction infallible cleans up call sites. Refresh VertexProvider / VertexProviderFactory docs to drop stale references to ANNWrapper and JetVertexProvider. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c2da97c to
ab9e3fb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #984 +/- ##
==========================================
- Coverage 89.42% 89.42% -0.01%
==========================================
Files 448 448
Lines 83743 83713 -30
==========================================
- Hits 74890 74857 -33
- Misses 8853 8856 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DiskSectorGraph previously allocated sectors_data aligned to block_size (typically 4096), conflating the on-disk stride with the reader's hardware/OS memory-placement requirement. Move the requirement where it belongs: declare it on the reader as
AlignedFileReader::MEMORY_ALIGNMENT(default 1; direct-I/O readers override to 512) and have the buffer allocator honor that.Drop the per-request alignment check from AlignedRead::new — that constraint is the caller's responsibility (DiskSectorGraph's offsets and lengths are already block_size-aligned by construction). Making construction infallible cleans up call sites.
Add PowerOfTwo::new_or_panic for use in const trait-item declarations, since Result::unwrap is not const-stable for this E.
Refresh VertexProvider / VertexProviderFactory docs to drop stale references to ANNWrapper and JetVertexProvider.