Skip to content

feat(cli): gym dev compare, the per-task parity report (M17) - #4257

Merged
adil-a merged 1 commit into
adasif/harbor-m16-overlayfrom
adasif/harbor-m17-compare
Oct 21, 2026
Merged

adil-a merged 1 commit into
adasif/harbor-m16-overlayfrom
adasif/harbor-m17-compare

Conversation

@adil-a

@adil-a adil-a commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

RFC M17, the temporary parity command. gym dev compare <old rollouts.jsonl> <new rollouts.jsonl> joins rows by task, counts identical, flipped (old-win and new-win), masked and missing, prints the losing side's verifier output for every flip, and writes a JSON summary with --json PATH or on stdout with gym --json dev compare. It replaces the audit scripts used for the Terminal Bench 2.1 and 4 parity runs and is the gate before an old server is deleted (M39). It lives under gym dev as a migration aid.

  • nemo_gym/rollout_compare.py: loading (with the <name>_failures.jsonl sidecar folded in as masked rows), task identity detection (_ng_task_id, task_name, legacy prefixes, --key), per-side taskset keying with ambiguous ids reported rather than guessed, classification, repeats compared on the mean, verifier output from verifier_logs_dir (resolved against each file's directory or --logs-root) or the embedded test_output, a separate bucket for flips where a side reports an agent error ("rerun before counting").
  • nemo_gym/cli/dev.py, nemo_gym/cli/main.py: command wiring; positional paths and quoted options reach the config verbatim (non-ASCII, spaces, backslashes, ${).
  • Input errors (unreadable file, non-numeric reward, missing key) exit 1 with the file, line and task named; an unwritable --json path exits 1 before anything is printed; an unreadable verifier log is reported per flip and the report continues; NaN and infinite rewards are masked.
  • Docs: fern/versions/latest/pages/reference/cli-commands.mdx.

Testing

76 tests in tests/unit_tests/test_dev_compare.py, 300 across the CLI suite. On the Terminal Bench 2.1 parity v3 files it reproduces the hand audit exactly: 72 identical, 14 flipped (8 old-win, 6 new-win), 1 flipped with an agent error, 2 masked, 0 missing, and every flip's verifier tail matches the audit byte for byte. Two review rounds with refutation and reproduction, 22 findings, all fixed.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuhezhang-ai yuhezhang-ai 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.

Reviewed M17 at ee485666 against M16 (#4256, 4e9672df). Please address attempt reconciliation, anonymous-failure matching/rendering, and run-specific verifier-log lookup before relying on this report as the migration gate. I reproduced the issues below with focused fixtures; the displayed-average suggestion is non-blocking.

These findings concern M17's handling of existing M16 records. Focused tests and lint passed, but the reproduced cases need coverage. Validation used saved-record fixtures; I did not repeat the production parity runs.

Comment thread nemo_gym/rollout_compare.py Resolved
Comment thread nemo_gym/rollout_compare.py Resolved
Comment thread nemo_gym/rollout_compare.py Resolved
Comment thread nemo_gym/rollout_compare.py Resolved
Comment thread nemo_gym/rollout_compare.py Resolved
@adil-a
adil-a removed this pull request from stack #3808 October 14, 2026 00:54
@adil-a
adil-a added this pull request to stack #4583 October 14, 2026 00:55
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch from ee48566 to 6398074 Compare October 14, 2026 01:07
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch 2 times, most recently from fc10a8a to 5e2d867 Compare October 14, 2026 01:39
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch from 5e2d867 to 49df761 Compare October 14, 2026 15:02
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch from 49df761 to 02f40d5 Compare October 14, 2026 16:29
@adil-a
adil-a marked this pull request as ready for review October 14, 2026 16:49
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch from 02f40d5 to 004bf21 Compare October 14, 2026 17:00
@adil-a

adil-a commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 004bf21

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot removed the sla:author-overdue Author response is over the one-business-day SLA label Oct 19, 2026
@adil-a
adil-a force-pushed the adasif/harbor-m17-compare branch from ea1b9f2 to 673187c Compare October 20, 2026 00:20
@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 673187c

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bd95952

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ff22bba

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7924b86

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Status at the new head 7924b86. All five threads are answered inline and four are resolved: superseded failures are dropped before grouping, masked entries render with an absent side, verifier logs resolve against the losing row's own run, and masked placeholders are left out of the mean. The anonymous-failure thread had a second case, a side holding only anonymous sidecar failures, which now borrows the other side's key or falls back to _ng_task_id with every row listed as a masked unknown (tests/unit_tests/test_dev_compare.py covers both directions and both sides anonymous). The module is now the nemo_gym/rollout_compare package after the split.

yuhezhang-ai
yuhezhang-ai previously approved these changes Oct 20, 2026

@yuhezhang-ai yuhezhang-ai 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.

Rechecked M17 at 7924b86f against its immediate parent, M16 (#4256, b7ede71b). All previous findings are fixed, including anonymous-only failure inputs without an explicit --key.

Validation: 389 comparison/CLI tests and 20 saved reproductions and targeted controls passed. The previously failing CLI fixture now succeeds in both text and JSON modes; focused lint and formatting checks also passed.

Approving the M17 changes. The failing Harbor partial-evaluation CI test also fails on #4256 and still needs resolution before merge.

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 76d8b5c

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 14a7162

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4f6a3ab

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c3d5a2c

ffrujeri
ffrujeri previously approved these changes Oct 21, 2026

@ffrujeri ffrujeri 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.

Approving c3d5a2c3. gym dev compare is self-contained in nemo_gym/rollout_compare. The join handles the cases that matter for parity reports: a namespace prefix only one side carries, task IDs that recur across tasksets (reported as ambiguous rather than guessed), anonymous sidecar failures kept out of the join, and repeated rows compared on the mean reward with a note. Compare and CLI suites pass locally (356 passed), and CI is green apart from the non-blocking conformance probes.

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a4df217

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5e27c4f

`gym dev compare OLD NEW [--logs-root DIR] [--tail N] [--json PATH]` joins two rollout files by
task and reports identical, flipped (old-win / new-win), flipped (agent error), masked and missing
tasks, with the verifier output tail for every flip read under each row's `verifier_logs_dir`.
It is the gate before a legacy server is retired in favour of its Harbor-path replacement.

Review hardening carried over: `--json` to an unwritable path is one error line and exit 1; the
root `gym --json` toggle prints the summary on stdout; paths and quoted options reach the command
verbatim (a `${` is escaped through the Hydra merge); a side is keyed by taskset only when it
spans more than one and a plain side joins on task id; a scored row that carries a
`failure_kind` with `mask_sample` false counts as measured (the Harbor environment server scores
a verifier timeout or a missing reward file that way); and a sidecar failure that names no task
stays out of the vote and is listed as masked.

Squashed from the previous branch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Adil Asif <adasif@nvidia.com>
@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2cf15a4

@ffrujeri ffrujeri 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.

Re-approving 2cf15a40 after the restack. git range-diff shows the patch is identical to the c3d5a2c3 I approved.

@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/39688243980

This branch was previously deployed

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

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants