feat(experiments): test-case-weighted rollups (aggregate per test case before pooling)#753
Merged
Conversation
…e before pooling) Roll up evaluation metrics two-level: average each test case over its attempts (pass@1), then aggregate across test cases, so a test case run k times counts once instead of over-weighting the pool (this also fixes medians/percentiles, previously taken over the wrong distribution). Group key is test_case_id, falling back to session_id when absent so unlabeled runs pool per-attempt exactly like the old flat rollup. Cost/latency use the per-attempt average within a test case. Add a test_case_count rollup field (distinct test cases) on the evaluation response, sortable; swap the leaderboard "Run Count" column to "Total test cases"; and update the Avg-cell tooltip to describe the test-case-weighted mean transparently. ASE-561 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: shanaiabuggy <[email protected]>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughEvaluation rollups now expose ChangesEvaluation rollup metrics
Sequence Diagram(s)sequenceDiagram
participant Client
participant EvaluationAPI
participant ClickHouse
Client->>EvaluationAPI: Request evaluations sorted by test_case_count
EvaluationAPI->>ClickHouse: Read evaluation rollup data
ClickHouse-->>EvaluationAPI: Return test_case_count rollup
EvaluationAPI-->>Client: Return sorted evaluation response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
|
shanaiabuggy
commented
Jul 17, 2026
…ollups Address review: filter blank test_case_ids upstream in the rollup CTEs (uniqExactIf for the count, WHERE test_case_id != '' in the per-session CTEs) and key the grouping directly on test_case_id, instead of the session_id fallback in the key helper. Blank sessions no longer inflate test_case_count or show up as per-attempt pseudo-test-cases; run_count still counts every ingested run. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: shanaiabuggy <[email protected]>
BrianNewsom
approved these changes
Jul 17, 2026
Signed-off-by: shanaiabuggy <[email protected]>
Signed-off-by: shanaiabuggy <[email protected]>
shanaiabuggy
enabled auto-merge
July 17, 2026 20:35
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.
What
Two-level ("test-case-weighted") rollups for the Experiments leaderboard — ASE-561.
When a test case is run k times, metrics are now rolled up per test case first (pass@1 = mean over its attempts), then aggregated across test cases — so a heavily-retried test case counts once instead of dominating the pool. This also corrects medians/percentiles, which were previously computed over the wrong distribution (all attempts vs. per-test-case values).
Changes
Backend (
evaluation_rollup_repository.py)test_case_idwhen set, elsesession_id— so unlabeled runs pool per-attempt exactly like the old flat rollup (no empty-string bucket collapse), and there's no hard requirement ontest_case_id.test_case_countrollup field (distinct test cases) on the evaluation response, sortable.Frontend (Studio)
test_case_count), sortable.Mean cost over 2 test cases — each test case averaged over its attempts.SDK regenerated for the new
test_case_countfield.Testing
test_case_iddegrade case (pools per attempt).Note
run_count(total attempts) stays on the API and still feeds the tooltip's context; only the leaderboard column moved to test cases.🤖 Generated with Claude Code
Summary by CodeRabbit
Summary by CodeRabbit
New Features
test_case_countto evaluation and rollup responses, exposed as a sortable “Total test cases” metric in experiment group tables.Bug Fixes
test_case_idno longer contribute to test-case-weighted metrics (test_case_countreturns 0).Tests