Skip to content

fix: correct pass^k metric naming and comments - #22

Merged
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
passhatk-desc-change
Aug 19, 2026
Merged

fix: correct pass^k metric naming and comments#22
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
passhatk-desc-change

Conversation

@YoungKo

@YoungKo Young Ko (YoungKo) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the naming of the pass^k metric in the thinkingbox/cli/agg_main.py file to clarify that it is a "biased" metric rather than "unbiased". Function and variable names, field names, and documentation are updated accordingly to maintain consistency throughout the codebase.

Metric renaming and consistency updates:

  • Renamed the unbiased_pass_power_k This pull request updates the computation and reporting of the "pass^k" metric in thinkingbox/cli/agg_main.py` to clarify its estimator and naming. The changes standardize the metric as a deliberately biased estimator, rename related variables and methods for clarity, and update all relevant usages throughout the codebase.

Metric computation and estimator clarification:

  • Renamed the function pass_power_k_unbiased to pass_power_k and updated its docstring to clarify that it uses a biased estimator ((c/n)^k) instead of the unbiased estimator, explaining the rationale for this choice.
  • Updated the aggregation logic to use the new pass_power_k function when computing per-test-case results.

Variable and field renaming:

  • Renamed the Metrics model field from unbiased_pass_power_k to pass_power_k to reflect the new metric definition.
  • Updated the assignment of aggregated results to use the new pass_power_k field instead of unbiased_pass_power_k.

Output and reporting:

  • Updated the metrics printing logic to use the new pass_power_k field for displaying "Pass^k" results._power_kfield in theMetricsmodel topass_power_k` to reflect the correct nature of the metric being calculated.
  • Renamed the function pass_power_k_unbiased to pass_power_k, and updated its docstring to remove references to "unbiased". [1] [2]
  • Updated all usages of the old function and field names in the aggregate_results function to use the new names (pass_power_k and pass_power_k). [1] [2]
  • Updated the print_metrics function to use pass_power_k instead of unbiased_pass_power_k for output.

@YoungKo
Young Ko (YoungKo) requested review from a team and a lite review from Copilot August 19, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates how the CLI aggregator names and explains the pass^k metric, renaming the previously “unbiased” pass^k field/function to reflect that the implementation is a deliberately biased estimator and ensuring aggregation/output uses the updated symbol names.

Changes:

  • Renamed the Metrics field from unbiased_pass_power_k to pass_power_k.
  • Renamed pass_power_k_unbiased(...) to pass_power_k(...) and updated the docstring to describe the biased estimator (c/n)^k.
  • Updated aggregation and printing to use the new pass_power_k field/function.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread thinkingbox/cli/agg_main.py
Comment on lines +229 to +238
pass^k is defined as the probability that a test case passes in all of k independent runs. It is calculated as (mean pass rate) ** k, i.e., the k-th power
of the fraction of runs that passed.

This differs from pass@k, which is the probability that at least one of k runs passes.
pass@k is computed as 1 minus the probability that all k runs fail, whereas pass^k is the
probability that all k runs succeed.

Unlike pass@k, we deliberately use a biased estimator for pass^k. An unbiased estimator is (c choose k)/(n choose k),
but it is zero whenever c < k, providing little differentiation among difficult cases. We instead use (c/n)^k, which retains a
non-zero signal even when c > 0.
mean_pass_ci_high: float = 0.0
unbiased_pass_at_k: list[tuple[int, float]] = Field(default_factory=list)
unbiased_pass_power_k: list[tuple[int, float]] = Field(default_factory=list)
pass_power_k: list[tuple[int, float]] = Field(default_factory=list)
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit c360142 into main Aug 19, 2026
7 checks passed
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.

3 participants