Skip to content

Extensible Leaderboard for different categories#657

Merged
haoranpb merged 4 commits into
mainfrom
feature/extensible-leaderboard
Jun 1, 2026
Merged

Extensible Leaderboard for different categories#657
haoranpb merged 4 commits into
mainfrom
feature/extensible-leaderboard

Conversation

@haoranpb

@haoranpb haoranpb commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Extract leaderboard logic out of result summery, and making more generic for different categories.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extracts leaderboard aggregation and persistence into a dedicated module (bcbench.results.leaderboard) and makes leaderboard aggregation extensible across evaluation categories via EvaluationCategory.aggregate_class.

Changes:

  • Introduces a new results/leaderboard.py module with Leaderboard, LeaderboardAggregate, and ExecutionBasedLeaderboardAggregate.
  • Adds EvaluationCategory.aggregate_class and updates CLI/result processing and tests to use the new leaderboard module/types.
  • Normalizes workflow steps to explicitly use pwsh where PowerShell syntax is used.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_type_exhaustiveness.py Adds exhaustiveness coverage for per-category aggregate_class.
tests/test_evaluation_summary.py Updates imports and aggregate tests to use the new leaderboard module/classes.
src/bcbench/types.py Adds EvaluationCategory.aggregate_class to map categories to aggregate implementations.
src/bcbench/results/summary.py Removes embedded leaderboard logic and adds EvaluationResultSummary.combination_key().
src/bcbench/results/leaderboard.py New module implementing leaderboard storage + category-dispatched aggregation.
src/bcbench/results/init.py Re-exports leaderboard symbols from the new module.
src/bcbench/commands/result.py Updates summarize/update/refresh flows to deserialize summaries generically and rebuild aggregates via aggregate_class.
docs/_data/test-generation.json Regenerates leaderboard data to match new aggregate serialization/layout.
docs/_data/bug-fix.json Regenerates leaderboard data to match new aggregate serialization/layout.
.github/workflows/copilot-evaluation.yml Pins shell: pwsh for steps that use PowerShell environment variable syntax.

Comment on lines +99 to +105
instance_resolved: dict[str, list[bool]] = defaultdict(list)
for run in execution_runs:
for instance_id, outcome in run.instance_results.items():
instance_resolved[instance_id].append(outcome)

pass_hat_5: float | None = _calculate_pass_hat_k(instance_resolved, 5, base.num_runs) if base.num_runs >= 5 else None

Comment on lines +154 to +163
def _calculate_pass_hat_k(instance_resolved: dict[str, list[bool]], k: int, num_trials: int) -> float:
if num_trials < k:
return 0.0

total_pass_hat_k: float = 0.0
for results in instance_resolved.values():
success_count = sum(results[:num_trials])
total_pass_hat_k += pass_hat_k(num_trials, success_count, k)

return round(total_pass_hat_k / len(instance_resolved), 3)
Comment thread src/bcbench/results/leaderboard.py
Comment thread src/bcbench/results/leaderboard.py
@haoranpb haoranpb merged commit 6c911fb into main Jun 1, 2026
14 checks passed
@haoranpb haoranpb deleted the feature/extensible-leaderboard branch June 1, 2026 13:19
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