Skip to content

fix(#116): disclose the computed interval estimator (BC vs BCa) via RelaxationResult.interval_method - #119

Open
marcohost33-maker wants to merge 1 commit into
mainfrom
claude/liouscope-repo-analysis-t5i7z6
Open

fix(#116): disclose the computed interval estimator (BC vs BCa) via RelaxationResult.interval_method#119
marcohost33-maker wants to merge 1 commit into
mainfrom
claude/liouscope-repo-analysis-t5i7z6

Conversation

@marcohost33-maker

Copy link
Copy Markdown
Owner

Summary

Issue #116, option 1 only — the honesty fix, deliberately without changing any computed number. The public surface said "BCa" in at least six places, but the leave-one-out jackknife that supplies the BCa acceleration term runs only for time grids of ≤ 60 points (a latency guard: one extra GLS refit per grid point on top of bootstrap_B), while the default grid has 80 — so the default pipeline always took bca_ci's documented a = 0.0 fallback and computed a bias-corrected (BC) interval. The "a" of BCa is exactly the acceleration; the error direction is not conservative by construction.

This PR makes the run say what it computed:

  • RelaxationResult.interval_method (additive, defaulted): "BCa" (jackknife ran), "BC" (a = 0 fallback), "none" (bootstrap failed or the point estimate was not finite). Default "unreported", so a deserialised pre-The advertised BCa interval is never BCa in the default pipeline: the acceleration term is silently dropped above 60 grid points #116 report stays valid and honest — for it the estimator genuinely was not recorded.
  • The 60-point gate now carries its rationale as a comment at the gate, and bca_ci / the bootstrap module docstrings state the BC fallback explicitly.
  • README (3 places), docs/explanation/no-single-number.md, docs/tutorials/first-diagnostic-run.md (2 places) and the U0 docstring no longer promise BCa unconditionally; U0 (fit_uncertainty) is documented as inheriting the label.
  • CITATION.cff: recorded in the Pending for the next cut block as a labelling correction, per the 2026-08-09 convention — the v0.5.0 abstract is untouched.

Deliberately not included (each changes reported numbers and needs its own anchor review, per the issue): raising/dropping the gate (option 2) and estimating the acceleration from the bootstrap replicates via the empirical-influence / infinitesimal-jackknife form (option 3). #116 stays open for those.

Scope

  • Bug fix (no new feature) — a public-claim/labelling defect; no numerical behaviour change
  • New diagnostic or layer (please link the motivating reference)
  • Performance / sparse-path / numerics improvement
  • Docs / examples / packaging only — the docs half of the change
  • CI / workflow / security
  • Release / packaging / publish evidence

Verification

  • pytest -q passes locally — 678 passed (669 at branch point + 9 new)
  • tests/test_anchors.py unchanged and green (21 passed) — no computed number changes, which is asserted by the full suite passing untouched
  • ruff check src tests benchmarks clean; python -m mypy src/liouscope clean (53 files)
  • .github/scripts/check_claim_safety.py passed (21 public-facing markdown files)
  • If touching MANIFEST_SCHEMA.json: n/a — the run-manifest contract is untouched; the new field is additive with a default on the report dataclass
  • If new external dependency: n/a — none
  • If touching .github/workflows/: n/a
  • If touching claims/docs/release wording: this PR removes an unsupported claim (unconditional BCa) rather than adding one; CITATION.cff pending block updated per DoD item 5
  • If touching branch protection / required checks: n/a

Quality contract

  • No unsupported production-ready / certified / release-complete wording introduced
  • Research disclaimer preserved
  • False-pass and rework risk considered, not only green CI — tests/test_interval_method.py includes a discrimination test (test_acceleration_term_is_live_when_jackknife_supplied) proving the acceleration term genuinely moves the endpoints when supplied, so "BCa" cannot decay into a relabelled BC; the gate location itself is pinned at 60/61 points so the documented wording and the code cannot drift apart silently.

Reproducibility note

No numerical results change: the field is derived from control flow the pipeline already executed. Tests use the fixed amplitude-damped qubit (H = 0, jump σ₋, rate 1.0, rho_0 = |+⟩⟨+|), seed=1, bootstrap_B=10.

Conflict note (open PRs)

#115 adds other additive fields to RelaxationResult and rewrites the default-grid derivation in relaxation.py; this PR's edits there are small and additive (one field, one comment block, one assignment), so the merge either way is a trivial additive resolution. Interaction to keep in mind at merge time: once #115's gap-scaled window lands, the grid stays 80 points, so the default label remains "BC" — the two changes are semantically independent.

Linked issues

Refs #116 (option 1 of 3 — the issue stays open for options 2/3, which change reported numbers and need anchor review).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q8z6iNAyQ6ivP68b1jDeEW


Generated by Claude Code

…ult.interval_method

The public surface advertised BCa intervals unconditionally, but the
leave-one-out jackknife that supplies the BCa acceleration term only runs
for time grids of <= 60 points (a latency guard), while the default grid
has 80 -- so the default pipeline computes a bias-corrected (BC) interval
and nothing said so. This is issue #116 option 1: report which estimator
actually ran ("BCa" / "BC" / "none", default "unreported" for pre-#116
serialised reports), document the gate at the gate, and align the README,
tutorial, no-single-number.md, bootstrap and uncertainty docstrings with
what is computed. No computed number changes; the field is additive and
defaulted. Raising the gate or estimating the acceleration from bootstrap
replicates changes reported numbers and stays open in #116.

Tests: tests/test_interval_method.py (9) pin every reachable label state,
the 60-point gate location, serialisation, the honest default, and include
a discrimination test proving the acceleration term is live when supplied.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8z6iNAyQ6ivP68b1jDeEW
@marcohost33-maker

Copy link
Copy Markdown
Owner Author

Status 2026-09-07 — no issue band added, and that is the deliberate outcome

This PR targets main, so a Closes #N band would work here. I checked whether one belongs and concluded it does not — recording the reasoning so the next reader does not add one by reflex.

#116 must stay open. This PR's own body says so: it implements option 1 of 3 — the honesty fix, RelaxationResult.interval_method, deliberately without changing any computed number — and leaves options 2 (raising or dropping the 60-point jackknife gate) and 3 (estimating acceleration from the bootstrap replicates) explicitly open, because each changes reported numbers and needs anchor review. The body already uses Refs #116 rather than Closes #116, which is exactly right. A Closes band here would close an issue that is two-thirds unresolved. Verified via closingIssuesReferences: this PR closes nothing, and should continue to close nothing.

State, measured:

mergeStateStatus  BEHIND      (mergeable = MERGEABLE, no conflict)
check-runs at cf522a21: 20, of which 10 are test-matrix jobs, 0 non-success
vs pr107-fix@bac5fe0d: 62 commits missing here, 1 unique to this PR

BEHIND under strict status checks, not blocked and not conflicting. Its single unique commit is the additive interval_method field.

What Marco has to decide

At 62 commits behind the #121 head, the green rollup here describes a tree that has since moved a long way. The interaction the body already flags is the live one: #115 rewrites the default-grid derivation in relaxation.py, and this PR's edits there are one field, one comment block, one assignment — additive either way, but the merge order decides who resolves it. Merging #121 (and then #127) first, and updating this branch afterwards, is the ordering that leaves the least to reconcile by hand.

Read-only measurement. No push, no merge, no band added, nothing resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:claude PR authored by Claude Code methodology

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants