feat(flaky): pass^k multi-trial reliability metric (#13)#21
Merged
Conversation
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
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 #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 inflaky.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_reportnow emitspass^2andpass^(num_runs)insummarywhen 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).