Repository navigation
feat (gdpval): report coverage breakdown by sector and occupation (#12) - #20
Vineetiitg wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
lucianommartins
left a comment
There was a problem hiding this comment.
Thanks for picking up #12, @Vineetiitg. The three-stage coverage layout is clear, and the change is genuinely verdict-preserving (request payloads, sample_key, filtering, and scoring stay untouched, and the canonical_sync.py fingerprint matches).
Before we merge, there are four things to address (details inline):
- Remove the duplicated test block in
tests/test_gdpval.py(lines 559-693 repeat lines 419-557 verbatim, triggeringruffF811) and the unusedbaseimport (F401). - Add
merge_shards(results)ingbench/third_party/eval_suites/gdpval.pyso shardedgbench --mergeruns recomputecoverageandmacro_win_rate_by_*_pctacross the union of traces instead of moving them tomerge_unreconciled_fields(or keeping a stale shard average). Refreshcanonical_sync.pyafterward. - Update the
14 of 25/25 of 25/22 of 44numbers indocs/evals/gdpval.mdandweighting_note: those came from the 185-rowdeliverable_filesmetadata check in #12 rather than the final 181 text-renderable tasks. Either verify counts against the 181-task set or state the non-uniform drop behavior qualitatively. - Expand
tests/test_gdpval.pyto cover macro-vs-pooled divergence, 0 scored tasks (Nonewithheld, never0.0),JUDGE_OUTAGE/ failed generations,no_text_rendering, missing/Nonesectorandoccupationfallback to"Unknown", andmerge_shards.
Minor title note: we can normalize the commit title to feat(gdpval): report coverage breakdown by sector and occupation (#12) (no space before () and squash on merge. Once updated, I will approve the CI workflow runs.
|
|
||
|
|
||
|
|
||
| # --------------------------------------------------------------------------- # |
There was a problem hiding this comment.
All three new tests (test_loader_retains_sector_and_occupation_in_sample_metadata, test_make_scorer_computes_coverage_end_to_end, and test_run_gdpval_full_pipeline_coverage_reporting) are pasted twice back-to-back starting here (repeating lines 419-557).
Python overwrites the earlier definitions and ruff flags F811.
Please delete this second copy.
| """Execute the real _make_scorer async pipeline with position-swapped judging, | ||
| verifying that coverage tracks starting, reference-eligible, and scored stages. | ||
| """ | ||
| from gbench.runners.eval_suites import base |
There was a problem hiding this comment.
minor/lint: base is imported here but unused in this test (ruff F401). Please remove this line.
| assert meta["occupation"] == "Software Developers" | ||
|
|
||
|
|
||
| def test_make_scorer_computes_coverage_end_to_end(): |
There was a problem hiding this comment.
Right now the tie fixture gives 1.0 in both sectors, so macro == pooled == 1.0. Please add test cases covering:
- Unequal sector/occupation sizes with different win rates so macro and pooled win rates diverge (including
wins_only_rate/ losses). 0scored tasks (allNO_REFERENCE,JUDGE_OUTAGE, or failed generation), confirmingwin_rate is Noneandmacro_win_rate_by_*_pctis omitted/None(never0.0, no division by zero).no_text_renderingtracking (n_files > 0withtext=None).- Missing,
None, or emptysector/occupationfalling back to"Unknown". - Sharded
merge_shards(results)reconciliation.
|
|
||
|
|
||
| def compute_coverage( | ||
| sample_traces: List[Dict[str, Any]], |
There was a problem hiding this comment.
Because gdpval.py does not define merge_shards, gbench --merge falls back to generic_merge (gbench/merge.py:580-585). Neither coverage nor macro_win_rate_by_*_pct is in its handled set, so:
coveragegets stripped from the merged result and dumped intomerge_unreconciled_fields.macro_win_rate_by_*_pctis either stripped or, if two shards happen to share the same rounded macro percentage over different denominators, silently kept with the wrong number (for example, shard 1 with1/1and0/2->50.0%and shard 2 with1/9and8/9->50.0%, while the true union macro is(2/10 + 8/11) / 2 = 46.36%).
Please add a merge_shards(results) function (following gbench/third_party/eval_suites/gpqa.py) that calls generic_merge, recomputes compute_coverage over the merged sample_traces, pops those three keys from merge_unreconciled_fields, and refreshes canonical_sync.py (python gbench/runners/eval_suites/canonical_sync.py --refresh-code-fp).
| by_occupation = dict(sorted(by_occupation.items())) | ||
|
|
||
| sec_rates = [v["win_rate"] for v in by_sector.values() if v["win_rate"] is not None] | ||
| macro_sec = round(sum(sec_rates) / len(sec_rates), 4) if sec_rates else None |
There was a problem hiding this comment.
Optional nit: averaging the already 4-decimal-rounded v["win_rate"] values can introduce slight double-rounding drift across 44 occupations. Computing macro_sec and macro_occ from the raw (wins + ties) / comparisons ratios and rounding at the end avoids that.
| "weighting_note": ( | ||
| "Headline win_rate is a pooled micro-average over all scored comparisons. " | ||
| "Because reference eligibility drops tasks non-uniformly across sectors " | ||
| "(e.g., Information retains 14 of 25 tasks while Manufacturing retains 25 of 25), " |
There was a problem hiding this comment.
In #12, 14 of 25, 25 of 25, and 22 of 44 came from the 185-row deliverable_files metadata check rather than the final 181 text-renderable tasks (before the 4 no_text_rendering drops). Could you either verify the exact counts on the 181-task renderable set or phrase this qualitatively (for example, that reference eligibility drops tasks non-uniformly across sectors and occupations, so groups with higher retention carry more weight in the pooled score)?
| across sectors (e.g. at the pinned revision, Information retains 14 of 25 tasks while Manufacturing | ||
| retains 25 of 25; 22 of 44 occupations lose tasks), sectors with higher retention contribute more |
There was a problem hiding this comment.
Same note as in gdpval.py: 14 of 25, 25 of 25, and 22 of 44 came from the 185-row metadata check in #12 rather than the final 181 renderable tasks. Please either verify these counts against the 181-task set or state the non-uniform retention effect without fixed counts.
Closes #12
Overview
Following up on the suggestion in #12 regarding the task mix shift across sectors/occupations:
This PR adds a breakdown by sector and occupation so users can see how the task mix changes across stages and how that affects the final score.
Key Changes
sectorandoccupationfromopenai/gdpvalonto each task trace.coveragereport with counts by sector and occupation for:no_deliverable_shippedvsno_text_rendering).macro_win_rate_by_sector_pct,macro_win_rate_by_occupation_pct) alongside the headline pooled score.tests/test_gdpval.pytesting the real_make_scorerandrun_gdpvalpipeline, and updateddocs/evals/gdpval.md.