Repository navigation
feat(noncomp)!: select fixed execution automatically - #610
Conversation
Add owned reusable programs, execution overrides, lazy explanations, and optional driver statistics. Reuse the existing fixed eligibility and batch policy, with validated trajectory fallback and compilation counts collected at their source. Exercise the public Python surface with independent joint-distribution checks, lifetime and concurrency tests, fallback diagnostics, and migration examples. BREAKING CHANGE: noncomp.sample now defaults to final_status=False and can select fixed execution, changing seeded rows. Add final_status=True to retain detailed status; use execution="trajectory", final_status=True to retain the previous execution path. Refs #573 Assisted-by: Codex (GPT-6) <noreply@openai.com>
|
🐤 Performance CanaryNo material performance changes detected. All 22 benchmarks remained within 5% of the base. View 22 benchmark results
Compared Environment and method
|
Assisted-by: Codex (GPT-6) <noreply@openai.com>
Assisted-by: Codex (GPT-6) <noreply@openai.com>
|
|
||
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class NonComputationalStats: |
There was a problem hiding this comment.
This class and its description (alongside the c++ ones) are a bit confusing. What value is it providing? Is it worth keeping?
| an error may therefore arise during sampling. Invalid circuit/model contracts | ||
| always raise instead of silently triggering fallback. | ||
|
|
||
| ### Migration from earlier releases |
There was a problem hiding this comment.
I'd ionly keep the brief "final_status" = true detail. We don't expect seeded samples to keep rows across releases.
| requirements. Detailed status can remain eligible if restoring resets erase | ||
| the unresolved leaked labels. See the | ||
| [fixed representation](../theory/noncomputational.md#fixed-execution) | ||
| for the exactness argument. |
There was a problem hiding this comment.
Rather then "for the exactness argument" say "for details on which circuits and noise combinations are eligible for fixed sampling" or similar.
| rows. Different strategies, batch configurations, or status requests can | ||
| produce different rows with the same correct joint distribution. | ||
|
|
||
| ## Trajectory continuations |
There was a problem hiding this comment.
This section is a bit confusing after just coming after the fixed sampling section added above. Should it better open with something like "When a circuit is ineliglbe for a fixed smapler, the prpared trajcetory may still compile ..." ?
Stepping back, is the flow of this page still good with these new sections?
Assisted-by: Codex (GPT-6) <noreply@openai.com>
Summary
Eligible leakage/loss requests previously needed a private binding to use fixed execution. Route public
noncomp.samplethrough an owned prepared program so existing measurement workflows automatically use scalar or packed fixed execution, with general trajectories as the fallback. Refs #573; follows merged #609.noncomp.compile,NonComputationalProgram, and optionalNonComputationalStats. Programs own their inputs and selected strategy; each sampling call owns workers and RNG. The convenience function repeats preparation without a cross-call cache.execution="auto","fixed", and"trajectory". Reuse the existing fixed eligibility rules and batch policy. Explicit packing rejects a trajectory selection, including zero-shot requests. Invalid circuit/model contracts propagate instead of becoming fallback reasons.Breaking change
noncomp.samplenow defaults tofinal_status=False, returningNonefor that field. Addfinal_status=Truewhen consuming detailedQubitStatusvalues. Existing positional arguments, measurement/detector/observable/herald semantics,symbols(), and three-array unpacking remain supported.This PR does not expand fixed eligibility. Timing-based
tune, broader channel coverage, GPU support, and noncomputational survivor/importance sampling remain follow-ups.Test plan
test_cpu_replay_rejects_non_boolean_values[0]accepts the string"0"in an untouched GPU-reference binding on this local Python 3.14 environment. The same isolated failure reproduces with the pre-PR installed build; the other six values pass. Tracked separately in Reject string record entries in the CPU replay binding #611. No GPU-reference code is changed here.Public prepared benchmark checks used surface d3/d5, three rounds, leakage probability 0.003, Clifford/single-T variants, 1,000 shots, one worker, three alternating repetitions. Packed medians were 1.74-1.89 ms at d3 and 5.60-6.01 ms at d5, approximately 2.9-3.3x faster than scalar fixed sampling. Preparation is reported separately; these are matched-output local checks, not deltakit-stim parity claims.
A separate d7/r7 single-T, 10,000-shot check alternated stats off/on for six repetitions: medians were 303/306 ms, with overlapping run-to-run variation. No timing assertions are added to tests.
Contributor agreement
Assisted-by:trailer.