Repository navigation
test: make exact validation sensitive to rare branches - #620
Draft
bachase-agent wants to merge 2 commits into
Draft
bachase-agent wants to merge 2 commits into
bachase-agent wants to merge 2 commits into
Conversation
Compare outcome probabilities relatively, retain tiny joint outcomes, and bound reference omissions. Add analytic rare-event and negative-control coverage without changing production precision policies. Assisted-by: Codex (GPT-6) <noreply@openai.com>
Contributor
|
Use the existing opaque NaN and infinity helpers so Clang cannot fold invalid test constants away. Round omitted-mass bounds toward a finite maximum and check their upward rounding under optimized arithmetic. Assisted-by: Codex (GPT-6) <noreply@openai.com>
This branch has not been deployed
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.
Summary
Exact validation could accept a missing or misweighted outcome below its
1e-9absolute tolerance, skip conditional expectation checks on that outcome, and discard joint weights below1e-15during aggregation. The new negative controls reproduced all four failures before the helper changes.Compare outcome and discarded probabilities relatively, check conditional probes on every positive cluster, retain positive representable joint weights, and reject invalid distributions or underflowed probability products. The dense oracle now reports an explicit omitted-mass bound, uses a configurable conditional Born cutoff defaulting to
1e-18, and retains positive Pauli/readout noise branches. Comparisons report inconclusive references when the combined omission bound exceeds the fixture's budget. Production numerical policies are unchanged.The compact analytic corpus covers rare Born outcomes and their joint probabilities down to about
6e-32, categorical/correlated/readout noise, postselection, aggregation, invalid inputs, and corrupt conditional expectations. Python enumeration gains configurable pruning and signal-relative precision checks, with analytic population/loss/transition fixtures and explicit checks against existing statistical bands. The contributor guide explains the precision contracts and their limits.Closes #612.
Test plan
expensive. Local builds: GCC 13.3 Debug and Clang 18.1.3 Release with fast-math and assertions enabled; generic CPU baseline.test_noncomp_fixed.py,test_noncomp_oracle.py,test_noncomp_trajectory_tvd.py, andtest_noncomp_enumerator_precision.py, including the expensive trajectory cases.e1f0edcf, includingrelease-cpp-smoke, every cross-platform job, andci-gate: successful run.The reference cutoff calibration covers both FP64 and FP32 policies without claiming GPU execution. Omitted-mass bounds account for deliberate pruning, not arbitrary floating-point roundoff; the rare fixtures use independent, well-conditioned analytic weights. Larger/nonrepresentable cases fail instead of silently certifying lost support.
Runtime evidence and merge prerequisite
Local measurements on an 8-vCPU AMD EPYC 9554P Linux VM, three wall-clock repetitions per command:
The original ten new C++ cases alone took 0.0074, 0.0066, and 0.0068 seconds. All new cases remain in regular CI; no new matrix axes or scheduled jobs are introduced. Baseline is
5fc87ec2; these are local subset timings, not hosted job totals or build-time measurements.Keep this PR in draft until #612's hosted-cost requirement is satisfied: compare baseline and incremental wall time, runner/build configuration, and repetitions for
build-and-test (default/scalar),release-cpp-smoke,gcc-release-cpp,cross-platform (Linux arm64/macOS/Windows),package-smoke, and scheduledcoverage/sanitizer jobs as applicable. Set numeric additional-time budgets from those measurements and include any other validation-stream additions on the same jobs. This local result does not establish a Windows Debug budget or a universal CI limit.Contributor agreement
Assisted-by:trailer.