Skip to content

[diskann-wide] Add byte-vector reinterpretations for u32x8 and u64x8 - #1445

Merged
juchen-ms (partychen) merged 5 commits into
microsoft:mainfrom
partychen:juchen-microsoft-simd-reinterpret-support
Sep 30, 2026
Merged

juchen-ms (partychen) merged 5 commits into
microsoft:mainfrom
partychen:juchen-microsoft-simd-reinterpret-support

Conversation

@partychen

@partychen juchen-ms (partychen) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
  • Does this PR have a descriptive title that could go in our release notes?
  • Does this PR add any new dependencies? No.
  • Does this PR modify any existing APIs? Adds trait implementations only.
  • Is the change to the API backwards compatible?
  • Should this result in any changes to our documentation? No separate documentation changes are needed.

Reference Issues/PRs

Extracted from #1394 to land the reusable diskann-wide support independently.

What does this implement/fix? Briefly explain your changes.

Adds bit-preserving SIMD reinterpretations from word lanes to byte lanes:

  • V3: u32x8 → u8x32 and i8x32.
  • V4: u64x8 → u8x64 and i8x64.
  • Matching little-endian Emulated implementations for all four conversions.

Tests follow the existing conversion-test macro and architecture-check conventions. They compare raw bytes using distinct byte positions, signed-byte boundary patterns, and the existing seeded test driver.

The change is limited to diskann-wide. No MaxSim consumers, custom intrinsics, or unrelated refactors are included.

Any other comments?

Local validation passed:

  • cargo test -p diskann-wide
  • cargo fmt --all
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo +nightly miri test -p diskann-wide --lib reinterpret_

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the test macro with explicit architecture-gated tests and an existing-helper-based byte comparison. Use distinct byte positions and signed-boundary offsets so fixed fixtures expose lane/byte transposition.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep architecture-gated macro call sites and the unary test driver. Compare raw bytes and use distinct byte positions instead of a transpose-symmetric fixture.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove special Miri branching and alias imports from the V4 conversion tests. Keep scalar emulation coverage in emulated.rs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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 implementations preserve register bits and include targeted byte-order validation across native and emulated paths.

Review effort: Balanced
Findings: None

What changed in this PR

Adds tested SIMD bit reinterpretation support for additional x86 and emulated vector widths.

Changes:

  • Adds reusable reinterpretation tests.
  • Supports u32x8 and u64x8 reinterpretation into signed and unsigned byte vectors.
  • Adds corresponding emulated implementations.
File Description
diskann-wide/​src/​test_utils/​ops.rs Adds the reinterpretation test macro.
diskann-wide/​src/​emulated.rs Adds emulated reinterpretations and tests.
diskann-wide/​src/​arch/​x86_64/​v3/​conversion.rs Adds 256-bit reinterpretations and tests.
diskann-wide/​src/​arch/​x86_64/​v4/​conversion.rs Adds 512-bit reinterpretations and tests.

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

@partychen juchen-ms (partychen) changed the title Juchen microsoft simd reinterpret support [diskann-wide] Add word-to-byte SIMD reinterpretations Sep 29, 2026
@partychen juchen-ms (partychen) changed the title [diskann-wide] Add word-to-byte SIMD reinterpretations [diskann-wide] Add byte-vector reinterpretations for u32x8 and u64x8 Sep 29, 2026
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.87%. Comparing base (fcf9053) to head (839cb7e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
diskann-wide/src/arch/x86_64/v4/conversion.rs 0.00% 6 Missing ⚠️

❌ Your patch status has failed because the patch coverage (81.25%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1445      +/-   ##
==========================================
+ Coverage   90.58%   90.87%   +0.29%     
==========================================
  Files         568      579      +11     
  Lines      112680   114587    +1907     
==========================================
+ Hits       102069   104132    +2063     
+ Misses      10611    10455     -156     
Flag Coverage Δ
miri 90.87% <81.25%> (+0.29%) ⬆️
unittests 90.64% <81.25%> (+0.29%) ⬆️

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

Files with missing lines Coverage Δ
diskann-wide/src/arch/x86_64/v3/conversion.rs 100.00% <100.00%> (+31.57%) ⬆️
diskann-wide/src/emulated.rs 100.00% <ø> (+1.68%) ⬆️
diskann-wide/src/test_utils/ops.rs 98.46% <100.00%> (+0.04%) ⬆️
diskann-wide/src/arch/x86_64/v4/conversion.rs 0.00% <0.00%> (ø)

... and 38 files with indirect coverage changes

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

Comment thread diskann-wide/src/emulated.rs
Address PR microsoft#1445 review feedback by covering every V3, V4 and Emulated reinterpretation with the existing test macro.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@partychen
juchen-ms (partychen) enabled auto-merge (squash) September 30, 2026 02:26
@partychen
juchen-ms (partychen) merged commit 60db735 into microsoft:main Sep 30, 2026
31 checks passed
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