Repository navigation
[P8-16] Use explicit binomial bounds for logical-error reports - #570
Merged
Merged
Conversation
Preserve valid-input Wald fields while providing explicit direct-sampling confidence endpoints. Validate boundary and rare-event coverage, migrate threshold reports, and retain paired decoder comparisons.
ruslan-splynx
marked this pull request as ready for review
October 13, 2026 17:08
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.
Closes #566.
Zero observed logical errors currently produce a Wald
0 ± 0, overstating the evidence. Add explicit two-sided, equal-tailed 95% Clopper–Pearson bounds for direct independent Bernoulli tallies: 0/1000 now yields [0, 0.003682], while zero shots yield [0, 1] and no estimate.The existing Rust result fields and valid-input Wald half-width remain compatible. Add a checked tally constructor and reject invalid/numerically unreliable bound evaluations; the legacy infallible constructor preserves invalid counts with NaN sentinels. Quantiles use bounded bisection over statrs' checked beta function, with stable analytic boundary formulas.
statrswith default features disabled is the only new lockfile package.Threshold CSV appends explicit endpoints/method/evidence metadata. Its plot prefers asymmetric endpoints, omits zero-shot estimates, and shows zero-failure limits separately from the rate curve. Historical CSV widths retain their original meaning with a legacy notice. Comparison reports use named marginal overlap, without equivalence claims; the shared-shot MWPM/PyMatching report retains discordant pairs and uses a conditional exact binomial test instead of assuming independent rates. No weighted/correlated estimator or GPU/hardware API is silently reinterpreted.
Validation:
See
docs/qec/binomial-intervals.mdfor the migration inventory, statistical/numerical limits and reproduction commands, anddocs/perf/data/p8-16-binomial-coverage.jsonfor raw coverage/provenance. This is a statistical-correctness fix, with no execution-speed claim or GPU benchmark requirement. Independent branch from main; no draft #569 changes included. Draft pending CI and final review; no merge requested here.