Repository navigation
fix(gdp-pdf): follow Artificial Analysis's document preparation, judge and denominator - #5524
Conversation
…e and denominator Pin LiteParse 2.5.0, the version Artificial Analysis prepares GDP.pdf with, and set English OCR explicitly. LiteParse 2.5.0 has no extract_screenshots option, so pages are rendered through screenshot(). Each manifest records the parser version; a manifest from another version is re-rendered, and prepare warns once when the installed version is not 2.5.0. Judge at medium reasoning effort with a 16,384-token budget. At max_tokens 1024 the judge ran out before writing its verdict, and each such criterion failed the whole row. Add benchmarks/gdp_pdf/report_aa.py, which scores a run over every task and attempt as Artificial Analysis does: missing and failed attempts count as zero, and attempts without a verdict for every criterion are flagged. The benchmark README describes the method and the steps. Scores change (parser version, judge budget), so the benchmark manifest moves to 0.2.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tuomas Rintamaki <[email protected]>
|
/ok to test 8135b59 |
Resolve the conflict with the component pyproject.toml and uv.lock move (NVIDIA-NeMo#4837): the LiteParse 2.5.0 pin moves from requirements.txt to pyproject.toml, and uv.lock is regenerated (only LiteParse changes, from 2.16.0 to 2.5.0). The benchmark README keeps main's prepare text and notes the pinned version. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tuomas Rintamaki <[email protected]>
|
/review |
|
/ok to test 6236233 |
cmunley1
left a comment
There was a problem hiding this comment.
lgtm pending autobot's review
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — the report can replace valid verifier grades with zero, misstate judging completeness, and misread recovered runs.
I inspected all nine changed files and traced document consumption, judge requests, and rollout/recovery artifacts. The inline findings include proposed regression checks; I couldn't execute tests or model rollouts in this read-only review.
RISK — Provide representative rollout and before/after scoring evidence
The PR explicitly says no real rollouts are attached. The parser pin changes policy inputs, the judge defaults change grading, and the new report changes aggregation. Unit tests, synthetic PDF preparation and config validation don't establish that the document-to-policy-to-judge path works or explain its score distribution. The trusted quality bar requires representative real model rollouts; the pinned review rubric also requires profiling evidence for fixed-benchmark scoring changes. This is a validation gap, not a demonstrated runtime failure.
Correction and acceptance: Could you attach matched before/after runs using a vision policy and the configured Luna judge, with the exact config, task selection, repeat count and artifact locations? Report all-pass, mean criterion pass, judge-failure counts, incomplete-verdict counts and fixed-denominator metrics, and explain the intended shifts. Inspect representative answers and verdicts, confirm that the new judge parameters reach the provider, and retain image-first delivery, empty-answer zeros and terminal-input-failure zeros. Keep remaining failures visible in the comparison. No source patch can substitute for this evidence.
Inline comments (escaped v1):
-
benchmarks/gdp_pdf/report_aa.pyline 92: BLOCKER — Preserve valid decimal grades from the verifier.Failure: A complete evaluation with
score="1.0"andpassed=truefails this check, so the report silently replaces its credit with zero and labels itincomplete_judging. That is supported producer output: the verifier parses decimal scores and applies half-up rounding, then serializesstr(score). Its existing tests also support0.99996,0.99994and1.5. Thus the new report disagrees with valid saved GDP grades whose spelling isn't exactly"0"or"1".Correction: Match the verifier's serialized decimal contract, not just the requested judge schema. Import
Decimal,InvalidOperationandROUND_HALF_UPfromdecimal, and replace thiselifblock in_grade()with:elif type(item.get("passed")) is not bool or not isinstance(item.get("score"), str): return None else: try: score = Decimal(item["score"]) if not score.is_finite(): return None expected_pass = score.quantize(Decimal("0.0001"), rounding=ROUND_HALF_UP) >= 1 except (InvalidOperation, ValueError): return None if item["passed"] != expected_pass: return None
Preservation and acceptance: Proposed report regressions should give full credit for
"1","1.0","0.99996"and"1.5", and no credit for"0","0.0"and"0.99994", with matching Boolean verdicts andjudging_complete=true. Retain the existing rounding assertions. Preserve empty-answer evaluations without numeric scores, and keep a nonempty answer with a missing verdict incomplete and zero. This suggested code is source-reasoned, not executed; please verify it before adopting it. -
benchmarks/gdp_pdf/report_aa.pyline 179: RISK — Derive judging completeness from every expected attempt.Failure: For one expected task, no rollouts and
repeats=1, the report returnsmissing: 1butjudging_complete=true. A second reachable case is a saved nonempty answer withmask_sample=true,failure_kind="agent_route_failed"and no evaluations: GDP's agent produces this when verification fails, yet itsfailed_agent_route_failedoutcome also leaves completeness true. Both contradict the documented promise that completeness stays false while an attempt lacks criterion verdicts. Checking only two outcome names misses these cases.Correction: Count every expected attempt without an accepted complete grade as unjudged, while retaining the verifier's explicit empty-answer/terminal-input zeros. With the current outcome branches, replace this assignment with:
unjudged = denominator - sum( outcomes[name] for name in ("graded", "empty_answer", "terminal_input_failure") )Preservation and acceptance: Add proposed cases for the missing attempt and masked verify-transport failure above: both must score zero and return
judging_complete=false. Updatetest_missing_attempt_scores_zeroto expect false rather than its current true assertion. Retain false for judge failures and partial verdicts, true for fully graded runs and verifier-produced empty/terminal-input zeros, and the existing fixed denominator in every case. This suggestion wasn't executed. -
benchmarks/gdp_pdf/report_aa.pyline 118: RISK — Resolve failures even when a task has no successful rollout.Failure: This mapping comes only from the main rollouts. Collector HTTP
/runfailures carry diagnostics without verifier metadata, followed by task/repeat stamps. If every repeat of a task fails this way,_attempt_key()returnsNoneand all its sidecar evidence is discarded. Minimal case: one expected task, an empty main file, and{_ng_task_index: 0, _ng_rollout_index: 0, _ng_failure_class: "agent_run_error"}in the sidecar. With one repeat, the report saysmissing: 1andall_attempts_present=falseinstead of classifying the recorded failure. The score remains zero, but the failure/presence diagnostics are wrong.Correction: Give
summarize()an index-to-task mapping from the run's materialized inputs, or enrich selected failures from those inputs inmain(). For managed runs, the publicRolloutStore.inputs_for()provides that association. Preserve explicitverifier_metadata.task_idprecedence and reject conflicting mappings. Don't substitute prepared-file position: collection honors supplied non-positional indices. Update the CLI documentation if an explicit materialized-input argument is needed; the exact interface choice needs author verification.Preservation and acceptance: Proposed cases should cover an all-failed task with no successful sibling, an empty main file, and a materialized task indexed at 42. Recorded pairs must appear under their failure class and count as present; genuinely absent pairs must remain missing and zero. Retain the existing assertion that an earlier failed try does not replace the selected graded attempt. No tests were executed.
-
benchmarks/gdp_pdf/report_aa.pyline 129: RISK — Select current outcomes before rejecting duplicate task/repeat pairs.Failure: Gym's main JSONL can contain append-only history rather than one current row per pair. A GDP verify failure leaves a masked main-file result; recovery can regrade that saved result, and settlement appends its replacement. Both retain the same task/repeat, so the documented report CLI raises
Duplicate rolloutafter successful recovery. Always preferring a main-file row over a sidecar row can also resurrect an older score after a newer failed execution.Correction: In
main(), read managed runs through the publicRolloutStore.read()and summarize its selected successes and failures. Keep duplicate rejection for genuinely conflicting unmanaged input. Don't use last-line-wins: selection must follow the manifest and execution identity, including a newer reservation with no saved outcome. The existing selection regressions demonstrate why arrival order is insufficient. The integration needs verification rather than a speculative replacement formain().Preservation and acceptance: Add a proposed managed-run check containing a masked GDP result and its settled, fully passing replacement: reporting must succeed, count one logical attempt and award full credit. Retain genuine-duplicate rejection for unmanaged inputs and an earlier sidecar failure followed by a selected success. A newer selected failure must hide an older success, and a newer unresolved reservation must not resurrect the older grade. These checks weren't executed.
-
benchmarks/gdp_pdf/prepare.pyline 417: RISK — Apply parser-version invalidation to example preparation too.Failure: The new version check in
prepare_document()is bypassed byfetch_example_media(): its early cache check calls this structural-only wrapper and skips before reachingprepare_document(). Start with existing example manifests rendered by the previous LiteParse version, install this PR's pinned 2.5.0, and rerun the documented example-fetch command: it renders zero documents and keeps the old extraction. Legacy manifests without provenance are also reused. Thus the migration works for full preparation but not the supported example path.Correction: Make
_manifest_looks_complete()require the installed parser version, while still avoiding a source-PDF hash requirement:return _manifest_is_complete(manifest_path, parser_version=_liteparse_version())Update its docstring accordingly. Adjust the reusable stub manifests in the existing fetch tests to declare matching parser provenance when they represent a reusable cache.
Preservation and acceptance: Proposed fetch regressions should rerender a structurally complete manifest with
parser_version="2.16.0"or no version, then record2.5.0. A complete matching-version manifest must still skip download/render even when its source PDF isn't local; missing page images must still trigger preparation. Retain the existing direct-preparation version-change test and once-only warning behavior. This suggested change is source-reasoned and wasn't executed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Review fixes for the AA report and example preparation: - A criterion's saved score is str() of the judge's decimal, so "1.0" or "0.99996" is a valid grade. The report now applies the verifier's pass rule (half-up to 4 places, at least 1) and checks it against the saved verdict, instead of accepting only "0" and "1". - judging_complete is false while any expected attempt lacks a complete grading: missing and failed attempts and a masked /verify failure count, while an empty answer or an input that never fit stays a final zero. - A run collected by gym eval is read through its RolloutStore, which selects the current outcome of each attempt. A re-verified result that follows the masked one no longer raises "Duplicate rollout". The run's materialized inputs map task indices, so a failure of a task with no successful rollout is attributed to it. Rollouts without a manifest, or with an explicit --failures file, are read as before. - fetch_example_media renders again a manifest from another LiteParse version, or one without a recorded version, as prepare_document does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tuomas Rintamaki <[email protected]>
|
Thanks for the review. c0303dc addresses the five inline findings:
On before/after rollouts: since the previous revision was approved, I haven't run them for this round. If a maintainer wants them before merging, I'll run matched before/after evaluations with a public vision policy and the Luna judge. I'll attach all-pass, mean criterion pass, judge-failure and incomplete-verdict counts and the fixed-denominator report, with the configs and task selection. |
|
/ok to test c0303dc |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE — the five code findings are fixed; the rollout/profiling evidence RISK remains unresolved.
I compared this head with the previous reviewed revision and traced the directly affected contracts. The current source and regression assertions address:
- Decimal grading and judging completeness, while retaining empty-answer and terminal-input zeros.
- Materialized-input failure attribution and selected-outcome loading, including recovered results and unmanaged duplicate rejection.
- Parser-version invalidation for example caches, with regressions for obsolete, missing and matching provenance.
This was a follow-up review, not a fresh whole-PR review. One delegated report wasn't available, so I independently covered its grading/completeness assignment. I couldn't execute tests or model evaluations; the reported test passes weren't independently reproduced.
RISK — Provide representative rollouts and before/after scoring evidence
The systemic finding from review 5792909589 remains unresolved. The description still says rollouts aren't attached, and the author's update confirms that matched before/after evaluations weren't run. The parser preparation changes policy inputs, the judge defaults change grading, and the report changes aggregation. Unit tests, synthetic-PDF preparation and config validation don't establish the real document-to-policy-to-judge behavior or explain its score distribution. The trusted quality bar and review rubric require that evidence. This is a validation gap, not a demonstrated runtime failure.
Correction: Could you attach representative matched baseline/head evaluations using the same vision policy, configured Luna judge, tasks and repeat count? Include the exact revisions, resolved configs, parser provenance and artifact locations. Report all-pass, mean criterion pass, judge-failure counts, incomplete-verdict counts and fixed-denominator metrics for both runs, and explain the intended shifts. No source patch substitutes for these artifacts.
Preservation and acceptance: Inspect representative answers and criterion verdicts to confirm that the real path completes and the score changes are explained. Saved judge requests should show reasoning_effort: medium and max_completion_tokens: 16384. Retain English OCR, 150-DPI preparation and image-first delivery followed by one task/text block. Keep empty answers and terminal-input failures as final zeros; missing, failed and incompletely judged attempts must remain in the denominator and keep judging_complete=false. Leave unresolved failures visible in the comparison. These are requested acceptance checks, not results obtained in this review.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
…outs test_public_api_facades requires code outside the library to import exported names from the package's public API. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tuomas Rintamaki <[email protected]>
|
/ok to test cf87221 |
|
/ok to test 8135b59 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42705440445 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42707284195 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42849741641 |
What does this PR do?
GDP.pdf's document pipeline is built to follow Artificial Analysis's GDP.pdf method, but three settings drift from it:
pyproject.tomlleaves LiteParse unpinned and itsuv.lockresolves it to 2.16.0, whose text extraction differs. This PR pinsliteparse==2.5.0inpyproject.toml, updatesuv.lock(only LiteParse changes) and setsocr_language="eng"explicitly. LiteParse 2.5.0 has noextract_screenshotsoption, so pages are rendered throughscreenshot()(the fallback_page_screenshots()already had). Each manifest records the parser version, a manifest from another version is re-rendered, and prepare warns once when the installed version is not 2.5.0.max_tokens: 1024covers the judge's reasoning too, so the judge can run out before writing its verdict. A criterion that does so fails the whole row, which then leaves the denominator. The judge now runs atreasoning_effort: mediumwithmax_completion_tokens: 16384.<rollouts_stem>_failures.jsonlout.benchmarks/gdp_pdf/report_aa.pyscores a run over every task and attempt from the saved verdicts (it calls no model), reports all-pass, Mean Pass and Mean Pass by domain, and setsjudging_complete: falsewhile any attempt is missing, failed or lacks a verdict. It reads agym evalrun through its rollout store, so a re-judged or re-verified result replaces the one it settles, and it accepts any decimal score the verifier saves. The benchmark README describes the steps (re-judge withgym eval reverify --judge-failed-only, then report).The agent's delivery logic (images first, single text block, reactive DPI backoff and compositing) is unchanged.
Scores move (parser version, judge budget), so
benchmarks/gdp_pdf/manifest.yamlgoes from 0.1.0 to 0.2.0.Validation
pytest resources_servers/gdp_pdf/testsin the environment fromuv sync --locked(LiteParse 2.5.0), with the example manifests rendered locally: 89 passed. Includes the newtest_aa_parity.py(LiteParse settings and provenance, re-render on a version change, the one-time warning, and the report's handling of decimal scores, judge failures, masked verification failures, missing attempts, empty answers, terminal input failures, retries, duplicates, failures of a task with no successful rollout, and a managed run whose masked result was re-verified) and example-fetch tests that re-render manifests from another LiteParse version.pytest responses_api_agents/gdp_pdf_agent/tests(agent unchanged): 75 passed.prepare_document()with the real LiteParse 2.5.0 on a two-page test PDF: OCR text and 150 DPI page images for both pages; the manifest recordsparser_version: 2.5.0andocr_language: eng.gym env validate --config resources_servers/gdp_pdf/configs/gdp_pdf.yaml --config resources_servers/gdp_pdf/configs/judge_model_openai.yaml: config is valid; the judge parameters parse asNeMoGymChatCompletionCreateParamsNonStreaming.pre-commit run --files <changed files>: all hooks pass.Rollouts
Not attached yet. The agent and the verifier's grading logic are unchanged; the change is to document preparation (parser version) and judge parameters, covered by the unit tests and the real LiteParse 2.5.0 prepare above. A full benchmark run on this branch (prepare with LiteParse 2.5.0, a vision model, the Luna judge,
report_aa.pyoutput and the judge-failure count againstmax_tokens: 1024) can follow if reviewers want it.Compatibility and benchmark impact
judge_chat_create_params.max_tokensshould drop that override, sincemax_completion_tokensnow sets the budget.report_aa.pyis optional; Gym's own aggregate is unchanged.Proposed labels:
bug,area:evaluation.Checklist
git commit -s).🤖 Generated with Claude Code