Skip to content

Cover a whole report with a probability boundary at BMF version 1 - #1581

Open
epompeii wants to merge 1 commit into
develfrom
u/ep/correction/detector
Open

epompeii wants to merge 1 commit into
develfrom
u/ep/correction/detector

Conversation

@epompeii

Copy link
Copy Markdown
Member

At BMF version 1, a t-test, z-score, or log-normal boundary covers the whole report, so a report with many lines no longer raises more false alerts.

Each line of a report is checked on its own. At a boundary of 0.99, each line has a 1% chance of a false alert, so a report with 200 lines raises about 2 false alerts on each guarded side when nothing changed. At BMF version 1, 0.99 now means that an unchanged report raises any false alert on that side at most 1 time in 100.

How

  • The family: every check that a corrected model makes in 1 report, on 1 side: each matching threshold, on each line, in each iteration. Bencher counts it, L, after the parse, the measure filter, and the fold, before the first verdict.
  • Each check runs at 1 - (1 - b) / L (Bonferroni), through the existing limit math. The log-normal lower limit keeps its reflection, at that level.
  • The count is conservative: a line with too little history, a refused benchmark, or an ignored benchmark still counts.
  • Each threshold spends its own boundary, so 2 thresholds with different boundaries on 1 report are both bounded.
  • Untouched: BMF version 0 reports, and the percentage, IQR, delta IQR, and Static tests.
  • The boundary row records the level of each corrected side in 2 new columns, lower_level and upper_level, each beside its limit. The console's alert detail shows it beside the boundary, for example t_test · upper_boundary 0.99 · per test 0.99995.
  • Docs: the t-test, z-score, and log-normal pages state the version 1 meaning, with the 200-line example (each line at 0.99995, a normal limit from about 2.33 to about 3.89 standard deviations), and the version 0 meaning. The intro says what a family is. The z-score and log-normal pages say their chance is nominal for a short history.

Tests

Integration tests through the report endpoint, with seeded histories chosen so every level is exact: 1 line keeps its limit; 16 lines spread the boundary, and an outlier that alerts at 1 line does not at 16; iterations count; each threshold spends its own boundary; a line with too little history counts; version 0 is unchanged; percentage, IQR, delta IQR, and Static are unchanged; z-score and log-normal are corrected; the family counts only the checks of corrected models, on lines and metrics they match, after the measure filter; the boundary row and the alert detail carry the levels. A seeded simulation of 2000 unchanged reports of 100 lines at 0.95 gives 4.85% with any false alert, against 99.2% uncorrected. Each new test was shown red on the old code or under a mutation.

2 pinned values in existing tests move with the correction, because their fixtures are BMF version 1 reports with several lines.

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchu/ep/correction/detector
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.41 µs
(+4.07%)Baseline: 5.20 µs
5.47 µs
(98.85%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.22 µs
(+3.70%)Baseline: 5.03 µs
5.29 µs
(98.66%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
27.26 µs
(+1.55%)Baseline: 26.85 µs
28.64 µs
(95.18%)
Adapter::Rust📈 view plot
🚷 view threshold
4.59 µs
(+2.68%)Baseline: 4.47 µs
4.67 µs
(98.25%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.55 µs
(+2.12%)Baseline: 4.46 µs
4.67 µs
(97.54%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii marked this pull request as ready for review November 25, 2026 03:30
@epompeii
epompeii marked this pull request as draft December 1, 2026 19:46
@epompeii
epompeii force-pushed the u/ep/correction/detector branch from 90a0b02 to 7877d7e Compare December 1, 2026 19:46
@bencher-cloud

bencher-cloud Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🐰 Bencher Report

ProjectBencher
Branchu/ep/correction/detector
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.30 µs
(+1.24%)Baseline: 5.23 µs
5.52 µs
(95.86%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.16 µs
(+1.76%)Baseline: 5.07 µs
5.39 µs
(95.79%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
7.60 µs
(-70.03%)Baseline: 25.37 µs
43.94 µs
(17.30%)
Adapter::Rust📈 view plot
🚷 view threshold
4.58 µs
(+1.90%)Baseline: 4.49 µs
4.77 µs
(95.90%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.53 µs
(+1.03%)Baseline: 4.48 µs
4.75 µs
(95.39%)
🐰 View full continuous benchmarking report in Bencher

At BMF version 1, the t-test, z-score, and log-normal tests run each line at its
share of the boundary's chance, counted across the whole report before the first
verdict. A report with many lines no longer raises more false alerts on a side
than its boundary states. A version 0 report and every other test are unchanged.
The boundary row records the level each side was tested at, and the alert detail
shows it.
@epompeii
epompeii force-pushed the u/ep/correction/detector branch from 7877d7e to 70fbc74 Compare December 2, 2026 23:07
@epompeii
epompeii marked this pull request as ready for review December 3, 2026 00:31

This branch has not been deployed

No deployments
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.

1 participant