Skip to content

feat(flaky): pass^k multi-trial reliability metric (#13)#21

Merged
amitpaz1 merged 1 commit into
mainfrom
feat/issue-13-pass-hat-k
Jun 26, 2026
Merged

feat(flaky): pass^k multi-trial reliability metric (#13)#21
amitpaz1 merged 1 commit into
mainfrom
feat/issue-13-pass-hat-k

Conversation

@amitpaz1

Copy link
Copy Markdown
Member

Closes #13.

What: pass^k = the unbiased probability that all k of k trials pass — reliability under repetition (the complement of pass@k). Uses the Tau-bench estimator C(passed,k)/C(total,k) (sample k of the observed trials without replacement), reusing the existing multi-run aggregation in flaky.py.

How:

  • pass_hat_k(passed, total, k)k=1 ⇒ pass rate; fewer than k passes ⇒ 0.0; too few trials to draw from ⇒ nan (never fabricated).
  • reliability_at_k(result, k) (per case) + reliability_summary(cases, ks) (mean over cases, nan-skipping).
  • build_multi_run_report now emits pass^2 and pass^(num_runs) in summary when enough trials exist.

Tests: 9 (k=1=pass-rate, all-pass=1, unbiased C(c,k)/C(n,k), <k passes=0, insufficient=nan, k<1 raises, per-case + summary, report wiring). pytest 9/9, mypy + ruff clean.

Pure-stats, additive (only adds keys to the report summary).

pass^k = the unbiased probability that ALL k of k trials pass — reliability under
repetition, the complement of pass@k. Uses the Tau-bench estimator
C(passed,k)/C(total,k) (sample k of the observed trials without replacement),
reusing the existing multi-run aggregation (flaky.py).

- flaky.py: pass_hat_k(passed,total,k) (k=1 ⇒ pass rate; <k passes ⇒ 0.0;
  too few trials ⇒ nan, never fabricated) + reliability_at_k(result,k) +
  reliability_summary(cases,ks). build_multi_run_report now emits pass^2 and
  pass^(num_runs) in summary when enough trials exist.

Tests: test_pass_hat_k.py (9: k=1=pass-rate, all-pass=1, unbiased C(c,k)/C(n,k),
<k passes=0, insufficient=nan, k<1 raises, per-case + summary, report wiring).
pytest 9/9, mypy + ruff clean (venv).

Closes #13.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tXZpN29akdmG8AEjgSZwk
@amitpaz1
amitpaz1 merged commit 81ac7af into main Jun 26, 2026
4 checks passed
@amitpaz1
amitpaz1 deleted the feat/issue-13-pass-hat-k branch June 26, 2026 09:11
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.

pass^k multi-trial reliability metric (reuses Welch's t-test plumbing)

1 participant