Skip to content

fix(ifeval): give prepared rows a stable task_id - #4610

Merged
iguehring-nvidia merged 2 commits into
mainfrom
iguehring/ifeval-task-id
Oct 15, 2026
Merged

iguehring-nvidia merged 2 commits into
mainfrom
iguehring/ifeval-task-id

Conversation

@iguehring-nvidia

Copy link
Copy Markdown
Contributor

What does this PR do?

Gives every prepared IFEval row a stable task_id: the source row's key from the upstream input_data.jsonl (unique for all 541 rows).

Until now the rows carried only id, the row's position. Gym selects and plans tasks by task_id, problem_id or instance_id, never by position, so IFEval could not be planned (gym eval plan --benchmark ifeval refused 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 source key does not.

id is kept unchanged, so nothing that reads it changes. Same approach as #4135 for TB2.1.

Validation

  • New test benchmarks/ifeval/tests/test_prepare.py: prepared rows carry the source key as task_id (download mocked).
  • pytest benchmarks/ifeval/tests: 1 passed.
  • pre-commit run on the changed files: pass.
  • Real run: gym eval plan --benchmark ifeval --out plan.json downloads 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_id field; re-run gym eval prepare --benchmark ifeval to pick it up.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification. N/A: the prepare script's docstring lists the new field; no documented behaviour changes.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass). Ran on the changed files.
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

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]>
@iguehring-nvidia iguehring-nvidia self-assigned this Oct 14, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

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.

@iguehring-nvidia
iguehring-nvidia marked this pull request as ready for review October 15, 2026 12:41
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team and anwithk October 15, 2026 12:42
@iguehring-nvidia

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"]),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id stay clean,
  • a misspelled task_di is 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]>
@iguehring-nvidia

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@iguehring-nvidia
iguehring-nvidia added this pull request to the merge queue Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38742458401

Merged via the queue into main with commit d1dcf2d Oct 15, 2026
49 of 54 checks passed
@iguehring-nvidia
iguehring-nvidia deleted the iguehring/ifeval-task-id branch October 15, 2026 13:43
ekellbuch pushed a commit to ekellbuch/Gym that referenced this pull request Oct 16, 2026
…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]>
iguehring-nvidia added a commit that referenced this pull request Nov 23, 2026
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.
rystewart-nvidia pushed a commit to rystewart-nvidia/Gym that referenced this pull request Nov 23, 2026
)

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]>
khazic pushed a commit to khazic/Gym-lao that referenced this pull request Nov 24, 2026
…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]>

This branch was previously deployed

1 inactive deployment
public — c459dc96 Deployed Oct 15, 2026 by copy-pr-bot[bot] via release / finalize / notify #5464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants