Repository navigation
[benchmark] Add support for regression checks and reporting - #1521
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Quantized benchmark registrations bypass regression checks, and saved regression output discards configured tolerance limits, leaving them unavailable when infrastructure errors prevent a result report.
2 open issues
What changed in this PR
Adds reusable regression checking and reporting to diskann-benchmark-runner, then adopts it for in-memory integration tests and benchmark comparisons.
Changes:
- Introduces hierarchical and tabular reports with aggregated pass/fail status, serialization, and numeric tolerances.
- Replaces integration tests’ custom
Matchmachinery with shared reports. - Adds build-time, QPS, and recall regression checks for inmem2 benchmarks.
| File | Description |
|---|---|
diskann-inmem/integration/support/check.rs |
Replaces custom matching infrastructure with shared reports. |
diskann-inmem/integration/index/tests.rs |
Migrates recall and search-stat checks to reports. |
diskann-inmem/integration/index/runner.rs |
Uses finished reports for regression results. |
diskann-inmem/integration/index/object.rs |
Migrates search and counter comparisons to reports. |
diskann-benchmark/src/index/inmem2/quantized/mod.rs |
Adds quantized benchmark regression implementations. |
diskann-benchmark/src/index/inmem2/full.rs |
Registers full-precision benchmarks for regression checks. |
diskann-benchmark/src/index/inmem2/benchmark/mod.rs |
Combines build and search tolerances and reports. |
diskann-benchmark/src/index/inmem2/benchmark/knn.rs |
Adds QPS and recall comparisons in tabular reports. |
diskann-benchmark/src/index/inmem2/benchmark/build.rs |
Adds build-time and inserted-vector checks. |
diskann-benchmark-runner/src/utils/fmt.rs |
Supports forced nesting and formatter size queries. |
diskann-benchmark-runner/src/report/tolerance.rs |
Implements and tests absolute and relative tolerances. |
diskann-benchmark-runner/src/report/mod.rs |
Implements and tests reports, checks, tables, and rendering. |
diskann-benchmark-runner/src/lib.rs |
Exposes the report module. |
diskann-benchmark-runner/Cargo.toml |
Adds serialization and testing dependencies. |
Cargo.lock |
Records updated dependency resolution. |
Review effort: Balanced
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1521 +/- ##
==========================================
- Coverage 91.05% 91.02% -0.04%
==========================================
Files 602 605 +3
Lines 124137 125494 +1357
==========================================
+ Hits 113039 114237 +1198
- Misses 11098 11257 +159
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Mark Hildebrand (hildebrandmw)
force-pushed
the
mhildebr/inmem-regression
branch
from
October 28, 2026 00:24
fef1402 to
018178c
Compare
Mark Hildebrand (hildebrandmw)
requested review from
a team
and
a balanced review from Copilot
October 28, 2026 00:24
Mark Hildebrand (hildebrandmw)
force-pushed
the
mhildebr/inmem-regression
branch
2 times, most recently
from
October 29, 2026 15:28
fe0750c to
669326b
Compare
Aditya Krishnan (arkrishn94)
approved these changes
Oct 29, 2026
Magdalen Dobson Manohar (magdalendobson)
approved these changes
Oct 30, 2026
Magdalen Dobson Manohar (magdalendobson)
left a comment
Contributor
There was a problem hiding this comment.
Looks, good, just caught typos
Introduce structured reports, tolerance checks, and formatting support for benchmark regression comparisons. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 017dabda-82ba-4916-a6a1-b5fc91f70ac7
Replace integration-specific match reporting with the benchmark runner report API while preserving deterministic regression checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 017dabda-82ba-4916-a6a1-b5fc91f70ac7
Compare build time, search throughput, and recall against configurable tolerances for full-precision and quantized benchmarks.
Mark Hildebrand (hildebrandmw)
force-pushed
the
mhildebr/inmem-regression
branch
from
October 30, 2026 17:19
669326b to
db567e4
Compare
Aditya Krishnan (arkrishn94)
approved these changes
Oct 30, 2026
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.


diskann-benchmark-runnerhas supportedRegressiontests for a while, but they are kind of hard to write. This attempts to make that easier by adding some infrastructure indiskann-benchmark-runnerfor collecting hierarchical pass/fail results, rolling up the overall success, and displaying results.The final result is far from perfect, but useable enough that it's not worth investing more time into. Plus, I have a whole host of other things that I need to be working on.
This PR is broken into three commits:
Commit 1
This is the big one, including two new big modules in
diskann-benchmark-runner:report/mod.rsandreport/tolerance.rs.tolerances.rsThis introduces fairly robust tools for doing regression checks with tolerance. The checks include:
MaxRelativeDecrease: Set a bound on how much a value can decrease relative to a baseline using the formula[0, 1]and the values being compared must be positive (no zeros allowed) and finite. All Rust's built-in numeric types up to 64-bits are supported.MaxRelativeIncrease: The flip of the previous one. Here, success isMaxAbsoluteIncrease/MaxAbsoluteDecrease: More straight-forward. An absolute number on how much values can increase or decrease by.These values serialize by their name, so the tolerance JSON files are a bit more clear. For example, the tolerance file for the newly added regression tests for inmem2 look like the this:
{ "input": { "type": "", "content": {} }, "tolerance": { "type": "inmem2-build-and-search-tolerance", "content": { "build": { "build_time": { "max-relative-increase": 0.05 } }, "search": { "qps": { "max-relative-decrease": 0.05 }, "recall": { "max-absolute-decrease": 0.01 } } } } }This provides a really nice chain of custody:
lower_is_better/higher_is_betterhelp show at the callsite the rough direction that is expected.report/mod.rsThis adds a
Reporttype that can consist of:Check.Reportswith associated keys.Table, which is an alternate presentation ofChecks that can make better use of horizontal space.Checks are leaf values that can display themselves, serialize themselves, and report success or failure. This PR includes several built-in checks:LowerIsBetter/HigherIsBetter: Checks based ontolerance.rs.I did my best to make the presentation of the final
Reportpalatable. I'll be the first to say that my skills in text-based presentation are sorely lacking. I'll accept "correct but adequate".General Flow
Since our benchmark output structs are generally hierarchical, the goal of
Reportis to make it relatively straight forward to have a unified type that can reflect the structure of the output types, point paths to all failing checks, and present the results in an okay manner.Commit 2
This replaces the checks in
diskann-inmem's integration test withReport. Largely,Reportis a souped up version of theMatchthat was previously used.Commit 3
Adds regression checks for built time, QPS, and recall for
diskann-inmemindiskann-benchmark. This hopefully shows that it is relatively straight-forward to add these checks.