Skip to content

Add performance diagnostic to diskann-benchmark#744

Open
hildebrandmw wants to merge 4 commits intomainfrom
mhildebr/perf-diagnostic
Open

Add performance diagnostic to diskann-benchmark#744
hildebrandmw wants to merge 4 commits intomainfrom
mhildebr/perf-diagnostic

Conversation

@hildebrandmw
Copy link
Contributor

Add a warning to diskann-benchmark if it looks like the binary was compiled for the x86-64 target CPU instead of x86-64-v3, x86-64-v4, or some other at-least AVX2 compatible CPU.

Also add a warning for aarch64 noting that full SIMD support is not available yet.

With diskann-benchmark being available now on crates.io, I just know that this will be compiled and run with the default x86-64 target CPU, when the preferred target is strongly at least x86-64-v3.

Implementation

Our architecture detection/selection is performed by diskann-wide. As such, we can detect if the whole application has been compiled for an x86-64-v3 compatible target by checking if the compile time architecture diskann_wide::arch::Current is at least diskann_wide::arch::x86_64::V3. To do this comparison, a light-weight, opaque diskann_wide::arch::Level is introduced to allow Architectures to be ordered without instantiating the associated architecture via the Architecture::level associated function.

Checks for compatibility can then be done using

use diskann_wide::{Architecture, arch};
if arch::Current::level() >= arch::x86_64::V3::level() {
    // We're at least AVX2 compatible
}

I think it's reasonable to add this to diskann-wide since diskann-benchmark is not the only crate that may need this functionality and diskann-wide is really the source of truth when it comes to micro-architecture specific functionality.

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

This PR adds a compile-time performance diagnostic to diskann-benchmark by introducing an orderable “capability level” abstraction in diskann-wide, then using that to warn when the benchmark binary appears to be compiled for an insufficient micro-architecture target (notably x86-64 instead of x86-64-v3+), plus an informational warning on aarch64.

Changes:

  • Add arch::Level and Architecture::level() to enable ordering micro-architecture capability without instantiating an Architecture.
  • Implement level() for Scalar, x86_64::V3, and x86_64::V4, plus add ordering tests.
  • Extend diskann-benchmark CLI with --quiet and emit target-related performance warnings.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
diskann-wide/src/helpers.rs Removes dead commented-out cfg_attr block.
diskann-wide/src/arch/x86_64/v3/mod.rs Adds ordering support and exposes V3 capability via level().
diskann-wide/src/arch/x86_64/v4/mod.rs Adds ordering support and exposes V4 capability via level().
diskann-wide/src/arch/x86_64/mod.rs Introduces internal level ordering and tests for the ordering.
diskann-wide/src/arch/mod.rs Adds Level type + Architecture::level() API and related docs.
diskann-wide/src/arch/emulated/mod.rs Implements level() for Scalar.
diskann-benchmark/src/main.rs Adds top-level Cli wrapper with --quiet and emits compile-target warnings; updates tests accordingly.

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

hildebrandmw and others added 3 commits February 7, 2026 14:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 78.84615% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.98%. Comparing base (f3fcaae) to head (e835ba0).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
diskann-benchmark/src/main.rs 68.11% 22 Missing ⚠️

❌ Your patch status has failed because the patch coverage (78.84%) 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     #744      +/-   ##
==========================================
- Coverage   89.01%   88.98%   -0.03%     
==========================================
  Files         428      428              
  Lines       78294    78368      +74     
==========================================
+ Hits        69692    69739      +47     
- Misses       8602     8629      +27     
Flag Coverage Δ
miri 88.98% <78.84%> (?)
unittests 88.98% <78.84%> (?)

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

Files with missing lines Coverage Δ
diskann-wide/src/arch/emulated/mod.rs 100.00% <100.00%> (ø)
diskann-wide/src/arch/mod.rs 83.79% <100.00%> (+0.85%) ⬆️
diskann-wide/src/arch/x86_64/mod.rs 91.62% <100.00%> (+0.76%) ⬆️
diskann-wide/src/arch/x86_64/v3/mod.rs 95.88% <100.00%> (-1.73%) ⬇️
diskann-wide/src/arch/x86_64/v4/mod.rs 23.88% <100.00%> (+1.29%) ⬆️
diskann-wide/src/helpers.rs 100.00% <ø> (ø)
diskann-benchmark/src/main.rs 91.12% <68.11%> (-4.37%) ⬇️

... and 7 files with indirect coverage changes

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

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.

2 participants