Repository navigation
fix(ifeval): give prepared rows a stable task_id - #4610
Conversation
Prepared IFEval rows only carried a positional id, so they could not be selected by id (gym eval run --task-ids) or planned (gym eval plan refuses rows without task_id, problem_id or instance_id). Use the source row's key, which stays the same when the source file is reordered. Signed-off-by: Ingo Guehring <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — one RISK: prepared IFEval rows now fail strict task-data validation because the owning schema does not declare the new field.
Reviewed both changed files and traced preparation, planning/materialization, and verifier/schema consumers. The source-key mapping preserves positional id, prompts, and scoring fields. Static review only; tests and the upstream download were not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex
| prompt = entry["prompt"] | ||
| row = { | ||
| "id": idx, | ||
| "task_id": str(entry["key"]), |
There was a problem hiding this comment.
RISK — Declare the new identity field in the owning task-data schema
Failure / blast radius: Validate either row produced by the new mocked-download test with TaskDataValidator and the instruction-following TaskData adapter. The result is unknown_keys == {"task_id": 1} and report.clean == False. task_id is deliberately not globally reserved, and the validator marks undeclared extras as unknown. Consequently, collation with task_data_validation="error" raises on every newly prepared IFEval row; default warning mode also reports all rows as schema drift. The otherwise-valid prepared rows should remain clean under their owning schema.
Correction: Keep this stable identity, but add its dependent declaration to instruction-following TaskData. Suggested insertion after id (not executed; verify before adopting):
task_id: Optional[str] = Field(
default=None,
description="Stable upstream task identifier when provided.",
json_schema_extra={"consumed_by": ["provenance"]},
)Optional and Field are already imported. Making this optional preserves older instruction-following datasets without task_id; retain the required integer id and both top-level and nested verifier-metadata formats. Do not globally exempt arbitrary task_id fields or disable unknown-key validation.
Acceptance — proposed checks, not run: Extend the preparation test to validate both output rows through TaskDataValidator using TypeAdapter(TaskData): expect report.clean, rows == 2, and unknown_keys == {}, while retaining the existing task_id, positional id, and kwargs assertions. Strict collation of those rows must succeed. Repeat validation without task_id, with verifier fields nested and then top-level: both must remain clean. Add an undeclared task_di key: it must still be reported as unknown and rejected by strict collation.
There was a problem hiding this comment.
Fixed in c459dc9: resources_servers/instruction_following/task_data.py now declares task_id: Optional[str] (as arc_agi and bigcodebench do), so older datasets without it stay valid.
benchmarks/ifeval/tests/test_prepare.py now also checks with validate_jsonl_rows and the instruction-following TaskData that:
- prepared rows are clean (no unknown keys),
- rows without
task_idstay clean, - a misspelled
task_diis still reported as unknown.
pytest benchmarks/ifeval/tests tests/unit_tests/test_task_data.py: 392 passed; pre-commit passes on the changed files.
Prepared IFEval rows now carry `task_id`, but the instruction_following TaskData schema did not declare it, so task-data validation reported it as an unknown key on every row and strict collation would refuse them. Declare it as an optional string, like arc_agi and bigcodebench do, and check prepared rows against the schema in the prepare test. Signed-off-by: Ingo Guehring <[email protected]>
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — LGTM — no reliability concerns.
The prior RISK is resolved: TaskData now declares optional task_id, retaining the required positional id and compatibility with older rows. The regression tests assert clean validation with and without task_id, preserve source-key identity, and check that task_di remains unknown.
Compared against the previously reviewed head and traced the fix through normalization, strict-validation handling, and verifier contracts. No unresolved prior findings or escalation-eligible regressions found. Static review only; tests and the upstream download were not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38742458401 |
…o#4683) ## What does this PR do? Gives every prepared AutomationBench row a stable `task_id`: `<task_name>/<example_id>` (e.g. `sales.multi_hop_lookup/501`), unique for all 600 tasks. Gym selects and plans tasks by `task_id`, `problem_id` or `instance_id`. Prepared AutomationBench rows carried none of them, so `gym eval plan --benchmark automationbench` refused the benchmark and its tasks could not be selected by id. `example_id` alone is not enough: it repeats across domains (570 distinct values over 600 rows). Prefixing the task name makes it unique. `task_idx` and `example_id` are kept unchanged, so nothing that reads them changes. Same approach as NVIDIA-NeMo#4610 for IFEval. `task_id` is also declared as an optional field in the verifiers_agent task-data schema (`responses_api_agents/verifiers_agent/task_data.py`). Without it, task-data validation reports `task_id` as an unknown key on every row. The committed `data/example.jsonl` rows gain the same field, so they match what `prepare.py` now writes. ## Validation - New test `benchmarks/automationbench/tests/test_prepare.py` (environment load mocked): prepared rows carry `task_name/example_id` as `task_id`; ids stay unique when `example_id` repeats across domains; prepared rows and `data/example.jsonl` are clean under the verifiers_agent schema. The two schema tests fail without the schema change. - `pytest benchmarks/automationbench/tests`: 8 passed. `pytest responses_api_agents/verifiers_agent/tests`: 23 passed. - `pre-commit run --all-files`: pass. - `gym env test +entrypoint=responses_api_agents/verifiers_agent +should_validate_data=true`: 23 passed. - Real run: `gym eval plan --benchmark automationbench --out plan.json` prepares the data and writes a plan with 600 tasks and 600 unique ids (`finance.airtable_expense_approval/4026`, …). On `main` the same command is refused because the rows have no id field. - `gym eval plan --benchmark automationbench --task-ids sales.multi_hop_lookup/501` plans exactly that task. - The full prepared file (600 rows) is clean under the verifiers_agent schema. ## Rollouts N/A: only the prepared rows gain a field; prompts, environment arguments and grading are unchanged. ## Compatibility and benchmark impact None for scores. Prepared files gain a `task_id` field; re-run `gym eval prepare --benchmark automationbench` to pick it up. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Documentation added or updated, or N/A with justification. N/A: no documented behaviour changes; the schema field carries its own description. - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format checks pass). - [x] New source files include the required Apache-2.0 SPDX header. - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). Signed-off-by: Ingo Guehring <[email protected]>
Gym plans and selects tasks by `task_id`, `problem_id` or `instance_id`. BIRD rows carried only `id`, the row's position, so `gym eval plan --benchmark birdbench` refused all 1534 rows and its tasks could not be selected by id. Each prepared row now carries `task_id`, the `question_id` of the upstream dev.json entry, which does not change if rows are reordered. For the train split, build_uberset gives each original row its position in train.json as `question_id`, as the verified rows already carry, so every row has one. The bird_sql task-data schema gains the optional field. Same approach as Signed-off-by: Ingo Guehring <[email protected]> #4610 for IFEval.
) Gym plans and selects tasks by `task_id`, `problem_id` or `instance_id`. Litmus-Bench rows carried none, so `gym eval plan --benchmark litmus-bench` refused all 2056 rows and its tasks could not be selected by id. Each prepared row now carries `task_id`, the row's `metadata.uuid`, which the release already guarantees unique and which does not change if rows are reordered. The litmus_agent task-data schema gains the optional field, and the provenance fingerprint covers the id rule so a cached file without it is prepared again. Same approach as NVIDIA-NeMo#4610 for IFEval. Signed-off-by: Ingo Guehring <[email protected]>
…IDIA-NeMo#6647) * fix(ifbench): give prepared rows a stable task_id Gym plans and selects tasks by `task_id`, `problem_id` or `instance_id`. IFBench rows carried only `id`, the row's position, so `gym eval plan --benchmark ifbench` refused all 300 rows and its tasks could not be selected by id. Each prepared row now carries `task_id`, the `key` of the upstream IFBench_test.jsonl row. It is unique for all 300 rows and does not change if the file is reordered, which a positional id would not survive. `id` is kept unchanged because the resources server's request requires it. The ifbench task-data schema gains the optional field, as IFEval's did. Same approach as NVIDIA-NeMo#4610 for IFEval. Signed-off-by: Ingo Guehring <[email protected]> * test(ifbench): run the task_id test under the core unit suite The test sat in benchmarks/ifbench/tests, which core pytest does not collect (testpaths is tests). It now lives in the existing tests/unit_tests/benchmarks/test_ifbench_prepare.py, reduced to the one assertion that matters: prepared rows carry the source key as task_id and keep id. Signed-off-by: Ingo Guehring <[email protected]> * fix(birdbench): give prepared rows a stable task_id Gym plans and selects tasks by `task_id`, `problem_id` or `instance_id`. BIRD rows carried only `id`, the row's position, so `gym eval plan --benchmark birdbench` refused all 1534 rows and its tasks could not be selected by id. Each prepared row now carries `task_id`, the `question_id` of the upstream dev.json entry, which does not change if rows are reordered. For the train split, build_uberset gives each original row its position in train.json as `question_id`, as the verified rows already carry, so every row has one. The bird_sql task-data schema gains the optional field. Same approach as Signed-off-by: Ingo Guehring <[email protected]> NVIDIA-NeMo#4610 for IFEval. * fix(ioi26): give prepared rows a unique task_id Gym plans and selects tasks by `task_id`, `problem_id` or `instance_id`. IOI 2026 rows carry `problem_id`, but it names the problem, and a problem has one row per scored subtask or band, so `gym eval plan --benchmark ioi26` refused the plan: task ids are not unique (all six problems). Each prepared row now carries `task_id`, the problem and the subtask label (`ballmachine-01-star`, `magiccity-band-6-10`), unique across the 41 rows. `problem_id` stays what the grader looks the problem up by. The competitive_coding_challenges task-data schema gains the optional field. Signed-off-by: Ingo Guehring <[email protected]> --------- Signed-off-by: Ingo Guehring <[email protected]>
What does this PR do?
Gives every prepared IFEval row a stable
task_id: the source row'skeyfrom the upstreaminput_data.jsonl(unique for all 541 rows).Until now the rows carried only
id, the row's position. Gym selects and plans tasks bytask_id,problem_idorinstance_id, never by position, so IFEval could not be planned (gym eval plan --benchmark ifevalrefused it) and its tasks could not be selected by id. A positional id would also name a different task if the upstream file were reordered; the sourcekeydoes not.idis kept unchanged, so nothing that reads it changes. Same approach as #4135 for TB2.1.Validation
benchmarks/ifeval/tests/test_prepare.py: prepared rows carry the sourcekeyastask_id(download mocked).pytest benchmarks/ifeval/tests: 1 passed.pre-commit runon the changed files: pass.gym eval plan --benchmark ifeval --out plan.jsondownloads and prepares the data and writes a plan with 541 tasks (1000,1001,1005, …), where it was refused before.Rollouts
N/A: only the prepared rows gain a field; prompts, verifier metadata and grading are unchanged.
Compatibility and benchmark impact
None for scores. Prepared files gain a
task_idfield; re-rungym eval prepare --benchmark ifevalto pick it up.Checklist
pre-commit run --all-files) (so CI lint/format checks pass). Ran on the changed files.git commit -s) (so the DCO check passes).