Skip to content

Properly feature-gate diskann-benchmark#1245

Open
hildebrandmw wants to merge 3 commits into
mainfrom
mhildebr/gate-diskann-benchmark
Open

Properly feature-gate diskann-benchmark#1245
hildebrandmw wants to merge 3 commits into
mainfrom
mhildebr/gate-diskann-benchmark

Conversation

@hildebrandmw

Copy link
Copy Markdown
Contributor

This is a follow-up to #1242 to move diskann-benchmark to the new feature gated feature.

A summary of the updated error messages is shown below:

When trying to load bf-tree inputs

Command

cargo run --package diskann-benchmark -- \
    run \
    --input-file ./diskann-benchmark/example/graph-index-bftree-stream.json \
    --output-file temp.json

Before

Error: while processing input 1 of 1

Caused by:
    Unrecognized input tag: "graph-index-stream-bftree-full-precision"

After

Error: while processing input 1 of 1

Caused by:
    use of the "graph-index-stream-bftree-full-precision" input is gated behind the feature "bftree"

When trying to run a gated benchmark

Command

cargo run --package diskann-benchmark -- \
    run \
    --input-file ./diskann-benchmark/example/graph-index-spherical-quantization.json \
    --output-file temp.json

Before

...
Closest matches:

    1. "graph-index-spherical-quantization":
        - Requires the "spherical-quantization" feature

    2. "spherical-exhaustive-search":
        - expected tag "exhaustive-spherical-quantization" - instead got "graph-index-build-spherical-quantization"

    3. "minmax-exhaustive-search":
        - expected tag "exhaustive-minmax-quantization" - instead got "graph-index-build-spherical-quantization"


Error: could not find a benchmark for all inputs

After

No active benchmarks are registered for tag "graph-index-build-spherical-quantization"

Found 1 gated benchmark matching this input:

    * "graph-index-spherical-quantization" (requires the feature "spherical-quantization")

Error: could not find a benchmark for all inputs

Input Discovery

When running cargo run --package diskann-benchmark -- inputs --all, the following is now displayed

Available input kinds are listed below:
    disk-index
    exhaustive-minmax-quantization
    exhaustive-product-quantization
    exhaustive-spherical-quantization
    flat-search
    graph-index-build
    graph-index-build-pq
    graph-index-build-spherical-quantization
    graph-index-build-sq
    graph-index-dynamic-run
    metadata-index-build
    multi-vector-op
    graph-index-build-bftree-full-precision (requires the feature "bftree")
    graph-index-build-bftree-spherical-quantization (requires the feature "bftree")
    graph-index-stream-bftree-full-precision (requires the feature "bftree")
    graph-index-stream-bftree-spherical-quantization (requires the feature "bftree")

@hildebrandmw hildebrandmw force-pushed the mhildebr/gate-diskann-benchmark branch from 94349e7 to 6f2053a Compare July 10, 2026 18:08
@hildebrandmw hildebrandmw marked this pull request as ready for review July 10, 2026 18:09
@hildebrandmw hildebrandmw requested review from a team and Copilot July 10, 2026 18:09

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.

Pull request overview

This PR updates diskann-benchmark to use diskann-benchmark-runner’s native gated/partially-gated registration APIs (introduced in #1242), improving discoverability and diagnostics when benchmarks/inputs are unavailable due to missing Cargo features.

Changes:

  • Removes the legacy stub_impl!-based approach and replaces it with Registry::{register_partially_gated, register_gated} across benchmark modules.
  • Makes bftree benchmarks always “present” at the module level while registering gated placeholders when the bftree feature is disabled.
  • Updates UX tests/assertions in main.rs to match the new gated-feature error message wording.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
diskann-benchmark/src/utils/mod.rs Removes the old stub_impl! macro used for feature-gated benchmark stubs.
diskann-benchmark/src/multi_vector/mod.rs Switches multi-vector gating from stub benchmarks to register_partially_gated.
diskann-benchmark/src/main.rs Updates test expectations to match new “feature …” error message wording.
diskann-benchmark/src/index/mod.rs Always includes bftree module and delegates gating behavior into bftree::register_benchmarks.
diskann-benchmark/src/index/inmem/spherical.rs Uses register_partially_gated when spherical-quantization is disabled.
diskann-benchmark/src/index/inmem/scalar.rs Uses register_partially_gated when scalar-quantization is disabled.
diskann-benchmark/src/index/inmem/product.rs Uses register_partially_gated when product-quantization is disabled.
diskann-benchmark/src/index/bftree/mod.rs Adds bftree-disabled path registering fully-gated input+benchmark placeholders.
diskann-benchmark/src/exhaustive/spherical.rs Uses register_partially_gated when spherical-quantization is disabled.
diskann-benchmark/src/exhaustive/product.rs Uses register_partially_gated when product-quantization is disabled.
diskann-benchmark/src/exhaustive/minmax.rs Uses register_partially_gated when minmax-quantization is disabled.
diskann-benchmark/src/disk_index/mod.rs Uses register_partially_gated when disk-index is disabled.

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

Comment thread diskann-benchmark/src/multi_vector/mod.rs
Comment thread diskann-benchmark/src/index/bftree/mod.rs
Comment thread diskann-benchmark/src/index/bftree/mod.rs
Comment thread diskann-benchmark/src/index/bftree/mod.rs Outdated
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (61616f6) to head (c3b5a45).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
diskann-benchmark/src/index/bftree/mod.rs 73.33% 4 Missing ⚠️
diskann-benchmark/src/disk_index/mod.rs 75.00% 1 Missing ⚠️
diskann-benchmark/src/exhaustive/minmax.rs 75.00% 1 Missing ⚠️
diskann-benchmark/src/exhaustive/product.rs 66.66% 1 Missing ⚠️
diskann-benchmark/src/exhaustive/spherical.rs 75.00% 1 Missing ⚠️
diskann-benchmark/src/index/inmem/product.rs 66.66% 1 Missing ⚠️
diskann-benchmark/src/index/inmem/scalar.rs 66.66% 1 Missing ⚠️
diskann-benchmark/src/index/inmem/spherical.rs 66.66% 1 Missing ⚠️
diskann-benchmark/src/multi_vector/mod.rs 75.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (75.00%) 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    #1245      +/-   ##
==========================================
+ Coverage   90.11%   91.12%   +1.00%     
==========================================
  Files         507      510       +3     
  Lines       96776    96799      +23     
==========================================
+ Hits        87214    88208     +994     
+ Misses       9562     8591     -971     
Flag Coverage Δ
miri 91.12% <75.00%> (+1.00%) ⬆️
unittests 91.09% <75.00%> (+1.30%) ⬆️

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

Files with missing lines Coverage Δ
diskann-benchmark/src/index/mod.rs 100.00% <ø> (ø)
diskann-benchmark/src/main.rs 91.64% <100.00%> (ø)
diskann-benchmark/src/utils/mod.rs 95.71% <ø> (+10.15%) ⬆️
diskann-benchmark/src/disk_index/mod.rs 83.33% <75.00%> (-16.67%) ⬇️
diskann-benchmark/src/exhaustive/minmax.rs 83.33% <75.00%> (-16.67%) ⬇️
diskann-benchmark/src/exhaustive/product.rs 83.33% <66.66%> (-16.67%) ⬇️
diskann-benchmark/src/exhaustive/spherical.rs 83.33% <75.00%> (-16.67%) ⬇️
diskann-benchmark/src/index/inmem/product.rs 83.33% <66.66%> (-16.67%) ⬇️
diskann-benchmark/src/index/inmem/scalar.rs 83.33% <66.66%> (-16.67%) ⬇️
diskann-benchmark/src/index/inmem/spherical.rs 83.33% <66.66%> (-16.67%) ⬇️
... and 2 more

... and 44 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.

3 participants