Extensible Leaderboard for different categories#657
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.pymodule withLeaderboard,LeaderboardAggregate, andExecutionBasedLeaderboardAggregate. - Adds
EvaluationCategory.aggregate_classand updates CLI/result processing and tests to use the new leaderboard module/types. - Normalizes workflow steps to explicitly use
pwshwhere 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) |
Jiawen-CS
approved these changes
Jun 1, 2026
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.
Extract leaderboard logic out of result summery, and making more generic for different categories.