Repository navigation
feat(tier3): add selectable NeMo Gym execution backend - #225
Conversation
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the actual Git history and diff at 4564f41. The only nonmerge commit, d51fd32 (chore: start Nemogym integration), is an empty scaffold; the branch has no changed files relative to its base or current main. There is no Nemogym implementation or behavior to validate, so I cannot approve the claimed integration. Leaving this draft open for implementation.
4564f41 to
01e4a0d
Compare
Add `tier3 evaluate --backend harbor|nemo-gym` (default harbor). With nemo-gym, the evals.json cases are generated as the same task folders and run by NeMo Gym's own orchestrator, agent harness and Docker sandbox in a separate pinned process. Rollouts are normalized back into trial results, so the shared collector, scores, lift and reports are reused, and result.json records the backend and Gym version. Unsupported options are rejected before execution with no fallback to Harbor. Also credit SKILL.md reads wrapped in `bash -lc '...'`, which NeMo Gym's Codex agent records, as skill activation. Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
…test The scored activation check now credits `bash -lc 'cat .../SKILL.md'`, so move that case from the lenient-only group to its own test. Signed-off-by: Christopher Kevin <[email protected]>
…kend - Resolve unset options from evals/config.yml as Harbor does and reject config-set features Gym cannot honor (stop_on_pass, timeout_multiplier, agent_runtime_preflight, base_image_mode, custom Dockerfile modes). - Apply --skip-with-skill and --max-cases, and pass one --agent-model string per agent. - Reject --agent-runtime-preflight, and reject unsupported Gym flags before --autopilot writes a dataset. - Write run_config.json and the run_config/attempt_policy/report_status/duration result fields so result discovery finds Gym runs. - Launch Gym with only the host variables a Harbor backend may receive, plus the policy and judge credentials. Signed-off-by: Christopher Kevin <[email protected]>
…ackend Use harbor.agents.<agent>.model and harbor.resources (cpus, memory_mb) when no flag overrides them, reject the Harbor-only config keys Gym cannot honor (task_source native_harbor, agent_workdir, pre_agent_setup, setup_commands, passthrough_env, resources.storage_mb), and list the supported keys in the docs. Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 14 findings (0 P1, 7 P2, 7 P3); 14 posted inline.
Re-reviewed at 6f913c4 (my 10-29 review was of the earlier scaffold). Every inline finding was reproduced with the PR's fake-gym fixtures and independently re-checked.
Status of the earlier Devin threads at this head:
- Fixed:
--skip-with-skill,--max-cases, per-agent model lists,--agent-runtime-preflight, docs config precedence, and most of the configured Gym policy (attempts, threshold, concurrency, grading, workspace mode, include; stop_on_pass/timeout_multiplier/preflight/base_image_mode/native_harbor rejected). The gaps left aredecoy_manifestandruntime_env(inline). - Completed-run discovery:
completed_onlyworks; the remaininglatest-link gap is inline at runner.py:503. - Autopilot before rejected flags: still open for flags that only the runner checks.
tier3 evaluate --backend nemo-gym --autopilot --timeout-multiplier 2(with a resolvablegym) generates evals.json, then exits 1.harbor.timeout_multiplierin config.yml behaves the same way. Thetier3 PATHordering is covered in the cli.py:3121 comment. - Host credentials: the deny-list over
os.environstill forwards unprefixed secrets such as SLACK_BOT_TOKEN, NPM_TOKEN, AZURE_OPENAI_API_KEY, AZURE_CLIENT_SECRET, CI_JOB_TOKEN, ACTIONS_ID_TOKEN_REQUEST_TOKEN, VAULT_TOKEN, NGC_API_KEY, PGPASSWORD and DATABASE_URL, none of which Harbor's docker allowlist passes. The allowlist suggested at runner.py:174 fixes both this and the dropped Docker settings. passthrough_env: still open; see also runner.py:111.
Merge Gym launch errors into results, tolerate truncated rollout JSONL, stage harbor.runtime_env into agent tasks, forward only Harbor's Docker-backend environment allowlist, publish the latest link, record dataset snapshot and publication target, run Gym in its own process group with graceful shutdown, resolve the Gym binary and version robustly, require a policy key for a custom model URL, validate SKILL_EVAL_NEMO_GYM_TIMEOUT_S, reject skill_workspace.decoy_manifest and harbor.timeout_multiplier, skip Harbor runtime preflight for tier3 PATH --backend nemo-gym, and drop duplicated CHANGELOG entries. Signed-off-by: Christopher Kevin <[email protected]>
Skip a config key in nemo_gym_config_errors when its flag is given, read the workflow's environment_kwarg param, and stop rejecting the passthrough_env/setup_commands aliases that load_evals_config already normalizes (passthrough_env now reaches the agent via runtime_env staging). Signed-off-by: Christopher Kevin <[email protected]> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Christopher Kevin <[email protected]> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 24 findings (0 P1, 5 P2, 19 P3); 24 posted inline.
Re-reviewed at 3f289ea: that is 245d268 plus the main merge, which doesn't touch the Gym code. I re-checked every earlier thread with a probe rather than from the replies, then reviewed the whole PR again. Every inline finding below was reproduced and independently re-checked.
Status of my earlier comments:
- Fixed: a truncated
rollouts.jsonlno longer aborts collection. Unprefixed host secrets no longer reach Gym.decoy_manifestis rejected at every entry point before any work, andlatestis published. Also fixed: a relativeSKILL_EVAL_NEMO_GYM_BIN, a custom model URL now needing its own key, the version of a symlinkedgym, validation ofSKILL_EVAL_NEMO_GYM_TIMEOUT_S, and the CHANGELOG duplicates. - Fixed with a gap (follow-ups inline):
- Launch errors now fail the run, but
report.html/tier3 viewstill say succeeded. - The Harbor-only preflights are gone from
tier3 PATH, but so are the generic ones. - The Docker variables reach Gym, but relative paths aren't anchored and named-index uv credentials are dropped.
- The process-group kill works for a timeout and a single Ctrl-C, but not when the leader exits during the grace period or on a second Ctrl-C.
- The dataset snapshot fields match Harbor's, but
publication_targetis not withheld whenincludestages context from outside the skill. runtime_envreaches Claude Code but not Codex.
- Launch errors now fail the run, but
Devin's threads, including the two new ones: all fixed, except that Gym's own env settings are still checked only after the dataset step (covered in the workflow.py comment).
The reformatting in 245d268 matches the pinned ruff (0.15.20, line-length 120). It merges cleanly with #325 and the other open PRs that touch those files: the only conflicts are CHANGELOG.md, and evaluation/options.py with #384/#387. tests/test_nemo_gym_backend.py passes (35), as do the CLI, workflow, normalizer and routing suites. Reverting each fix in a copy makes its cited test fail. The one gap is test_failed_gym_launch_is_reported_not_succeeded, which covers only the no-rollouts case.
Isolate the Gym version probe, stage judge overrides into the verifier, keep partial rollouts as scored arms, let Codex inherit runtime_env, refresh Vertex ADC per launch, harden process cleanup and log redaction, reject MCP servers, native Harbor tasks, URL credentials and Windows before any work, stage every arm once before the first launch, remove staged tasks/jobs as Harbor does, and carry failed status into reports. Signed-off-by: Christopher Kevin <[email protected]>
Scale each staged task's agent, verifier and environment-build timeouts by Harbor's multiplier before Gym runs, since Gym enforces the task's own timeouts. Validate the multiplier as Harbor does and record it in run_config.json. Signed-off-by: Christopher Kevin <[email protected]> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@chrisknvidia, below are answers to both of your questions and a note on the main sync. Main sync. I merged main 1. Without Yes, with one exception that predates the reconcile.
I checked this by running the real
The only difference is the exit code: 1 instead of 2. The errors now come from the engine rather than from a click The exception (on both heads, P3): a bad 2. Scope: what do I think? I agree with the scope. Gym runs in Docker only, fails closed with no Harbor fallback, and rejects everything it can't honor before the run starts. The table above checks each item in your list on the merged head. There are two places where "works the same" doesn't fully hold. Neither one blocks this PR.
Only Codex has run on real Gym. That's fine for an experimental flag, because the docs and CHANGELOG still say the Codex, Claude Code and OpenCode mappings don't establish end-to-end support. I'd keep the "792fa142 candidate" wording until someone other than the author installs from that commit and gets a scored paired run. |
…a run folder
Resolve the judge and harbor.runtime_env environment before
_reserve_run_dir, so an unset ${VAR} or an operator-owned name leaves no
results/ folder behind, as on Harbor. Reject --max-agents and
harbor.max_agents below 1 on the Gym path with Harbor's message.
Signed-off-by: Christopher Kevin <[email protected]>
b7494b3 to
b639ede
Compare
@rng1995, both are fixed in b639ede.
The Gym, Tier 3, CLI, golden and reporting tests pass locally (13,085), and ruff is clean. |
Signed-off-by: Christopher Kevin <[email protected]>
Keeps both Unreleased/Added CHANGELOG entries (NeMo Gym backend and CI onboarding/benchmark PRs from #439). No other files conflicted. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in main through b38b71b (#416, #417, #420, #422, #423, #428, #429, #467). Merged without conflicts; CHANGELOG, docs, decoys.py and eval_core/checks.py auto-merged with both sides' edits in separate hunks. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@chrisknvidia, I checked b639ede and both fixes hold. I ran the real
Main moved twice more, so I merged it into the branch as two signed merges:
Both sides had edited On ed6e27a I ran the Gym, golden, progress, tool-productivity, root-search, checks-routing, plugin-signal, decoy, timeout-recovery, RAGAS-evidence, run-budget and grader tests with click pinned to the locked 8.4.2. All 1,533 passed. The report backend label stays as a follow-up, as agreed. |
Brings in #464 (Harbor 0.25.0) and #466. The only conflict was docs/cli-reference.mdx: keep main's Harbor 0.25.0 --env-mode and --environment-kwarg rows, and this PR's --backend row between them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in #410, #412, #413, #419, #421, #425, #430 and #444. Conflicts: CHANGELOG.md (kept both Unreleased Fixed entries) and evaluation/options.py (kept main's tolerate_baseline_timeouts field and this PR's backend field). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
main's #430 added --tolerate-baseline-timeouts and harbor.tolerate_baseline_timeouts, but only the Harbor runner reads them. After the main sync, a NeMo Gym run accepted either and silently ran without the tolerance, the same gap the budget and baseline-reuse options had. Gym now rejects the option when it is on, from the flag or the config key, before dataset generation, a run folder or a Gym launch, with the same "is not supported with --backend nemo-gym yet" message. Off is Gym's own behavior, so --no-tolerate-baseline-timeouts stays allowed and, as on Harbor, overrides a config key that turns it on. The docs list the new rejected flag and key. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in #407. The only conflict was CHANGELOG.md, where both sides added an Unreleased Added entry; kept both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Approving at 5036eab.
The earlier review items are all fixed:
- The positional
TARGETcheck now reads only the argparsepositional arguments:section (_declares_task_positional), so wrapped--only-taskshelp no longer passes a CLI without the positional. --autopilotwith--backend nemo-gymruns the Gym preflight instead of Harbor's agent-runtime checks.- Baseline reuse,
--compare-toand the budget options are rejected for Gym, including an explicit 0. - b639ede's
runtime_envandmax_agentschecks run before a run folder is reserved.
I synced the branch with main three times (fd57e02, 61feaf4, 5036eab). The conflicts were in CHANGELOG.md, docs/cli-reference.mdx and evaluation/options.py; I kept both sides in each. One sync needed a code change, 218b2dc. #430's --tolerate-baseline-timeouts and harbor.tolerate_baseline_timeouts were accepted on Gym and silently ignored. Gym now rejects them when they're on, before generation, a run folder or a launch. --no-tolerate-baseline-timeouts still overrides a config key that turns it on, as on Harbor. The new tests fail without the change.
I ran a fake-Gym evaluation on the synced head where one baseline attempt fails:
- #407's coverage notice reads "baseline incomplete" and never names a Harbor exception.
- Token usage shows missing counters as partial, never as 0.
- #430 adds no tolerance fields to a Gym run.
- #419 regenerates a Gym report from
result.json. - #464's Harbor 0.25 environment changes never reach the Gym path.
One new P3 is inline, from #407: a Gym run's terminal output points to a tier3-benchmark.md that the Gym backend doesn't write.
Not blocking this approval: native qualification on real Gym (only Codex has been run so far), and the report backend-label follow-up.
The --backend row in the CLI reference and the SKILL_EVAL_NEMO_GYM_BIN row in the environment variables page linked to tier3-live-evaluation.mdx by file path. Published pages need the /skills/skillevaluator/<slug> form, as docs/AGENTS.md requires. Signed-off-by: Christopher Kevin <[email protected]>
When a timed-out gym eval run could not be stopped (killpg refused or the leader was not reaped), the failure was recorded against the arm and the next arm launched beside Gym servers and sandboxes that might still be running. _run_gym now makes one last bounded SIGKILL and reap after a failed stop and checks the group is empty. If it still cannot confirm that, it raises GymCleanupError; the runner reports the agent as failed and aborts instead of starting another arm. Signed-off-by: Christopher Kevin <[email protected]>
…topped Re-raising GymCleanupError ended the evaluation before collection, so the arms and agents that had already finished lost their scores: no result.json, report or latest. Now nothing else is launched beside the group, each skipped arm is recorded as not started, and the run is still collected and saved as failed with the cleanup error. On Ctrl-C, SIGTERM or SIGHUP the interrupt still ends the run, but a failed cleanup progress event now says Gym may still be running, instead of only "Aborted!". _group_is_gone reaps our own zombies in the group before each probe, so SkillEvaluator as PID 1 (or a subreaper) without an init no longer reports an already-dead group as running. New tests cover a member that outlives the leader, a retried EPERM probe, the Linux subreaper case, the interrupt event, and a finished arm kept beside a hung one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
When an earlier arm finished, the summary without --verbose folded the cleanup error into "N failure detail(s)", so with --progress off nothing said that Gym's servers or sandboxes may still be running. Record it as a warning too, which the summary always prints, and record that the arm timed out before its stop failed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in main up to 7a37915. The only conflict was CHANGELOG.md, where both sides added Added and Fixed entries; both sides are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in main up to ba7779a, which prepares v0.9.0. This PR is not part of 0.9.0, so its CHANGELOG entries move to a new Unreleased section above the 0.9.0 release notes. docs/cli-reference.mdx keeps main's site-path links in the tier3 evaluate flag table and adds this PR's --backend row. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
#456 made create-eval-dataset default to --grounding auto, which needs evals/EVAL.md, --prompt or a matching trace, and rewrote Harbor's missing-dataset error to say so. The Gym backend kept its own copy of the old message, which told users to run create-eval-dataset, and that now fails without guidance. Both backends now use one shared message. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
This PR merged while this review was in progress; the reviewed head is still 33ef2cea4352. Two verified findings below need follow-up: verifier rewards can overwrite staged case identity, and normalization omits the custom grader's explanation sidecar.
Reviewed backend capabilities, staging, credential/process handling, rollout normalization, and shared collection/reporting, with existing comments checked for duplicates. Focused backend/integration/autopilot suites passed (177 passed, 1 skipped; installed Harbor 0.24 rather than pinned 0.25). Both findings were independently reproduced through the real normalizer/collector, including the real custom-grader wrapper. No native Gym, Docker, or paid-provider run was performed.
Main synchronization and conflict resolution — 10 November 2026
Current head:
c92e873eeaea7fbc405d8ecfb1233622e4d37282. Merged maind717f22cf6cad94e96891f8efbaa10d24e2b4837, preserved Christopher's concurrent merge2825cd2bd52862db787103664f7ef8b25ddf92c8, and pushed normally with signed-off merge commits. GitHub confirms this head is mergeable.Verification: The first integration tree
20e9886ef69aeac3c7895bfe9aef2403e008de4bpassed the full default suite with four workers: 27,526 passed, 35 skipped. After reconciling Christopher's newer commit and main's baseline-only sufficiency fix, final tree54445d9cd6abb9ad2d9feddda6e650cfc98078eepassed 648 focused regressions, including Gym, autopilot, workflow, command, source-shaped parser, CLI golden and baseline/progress contracts. Counts from separate selections overlap and are not summed as unique tests.Final-tree Ruff, changed-file formatting, wheel/sdist builds, configured source/archive OSS boundaries, public benchmark provenance, pinned Fern and diff checks passed. Fern retained one optional unauthenticated redirect-check warning. Independent subagent reviews and parent-preservation checks passed; main options/report/commands/workflow and the latest baseline fix are byte-identical to Christopher's update. An earlier intermediate Gym subset had one interrupt assertion failure; two exact reruns and the subsequent full suite passed. That original observation remains recorded without claiming a proven baseline cause.
Hosted CI restarted for this final head; no final-head hosted green result is claimed yet. Native Gym runtime qualification remains separate, and existing source/runtime qualification review is not resolved by this merge repair.
Summary
Adds a second Tier 3 execution backend.
skillevaluator tier3 evaluate --backend harbor|nemo-gympicks who runs the cases;harborstays the default and is unchanged.With
--backend nemo-gym:evals.jsonis unchanged and is generated into the same task folders (task.toml,instruction.md,tests/,environment/) as for Harbor.gym eval run <tasks> --agent codex_agent --sandbox docker): its orchestrator, model server, agent harness and Docker sandbox, then the SkillEvaluator verifier (tests/test.sh) in the same sandbox. The Harbor runtime is not used.result.jsonfiles, so the existing collector, scores, lift, activation, reports andresult.jsonare shared.result.jsonrecordsexecution_backend(name, Gymversion,sandbox).SKILL_EVAL_NEMO_GYM_BIN) because it needs Python 3.13.14+. The policy model URL/key come fromSKILL_EVAL_NEMO_GYM_MODEL_URL/SKILL_EVAL_NEMO_GYM_MODEL_API_KEY; keys never appear on the command line, in task folders or in rollouts. Judge credentials reach only the verifier as${NAME}templates.skills_dirtask hook, so only Gym's copy of each task drops it; the skill is still baked into the image at each agent's native path, so the with-skill and baseline arms are identical to Harbor's.--env-mode,--harbor-keep-jobs,--stop-on-pass,--copy-repo, Harbor-only environment kwargs, unsupported agents/grading modes, ...) fail before anything runs. There is no fallback to Harbor.Also: skill activation now credits a SKILL.md read wrapped in a shell (
/bin/bash -lc 'cat .../SKILL.md'), which Gym's Codex agent records. This applies to Harbor runs too; searches inside a wrapper are still not counted.tests/tier3/test_plugin_signals.pypinned the old scored-check behavior forbash -lc 'cat ...', so that case moves from the lenient-only group to its own test.Code:
src/skillevaluator/tier3/nemo_gym/(backend.pyselection and capability checks,runner.pytask staging and Gym invocation,results.pyrollout normalization), wired throughcli.py,EvaluationOptions.backendandtier3/commands.py.Verification
tests/test_nemo_gym_backend.py, wrapped-read cases intests/test_checks_routing.py, CLI golden snapshot)docs/tier3-live-evaluation.mdx,docs/cli-reference.mdx,docs/environment-variables.mdx)make lint(ruff on changed files)make test(full suite after mergingmain; the remaining failures are environment-only and fail identically onmainhere: git-remote identity, CI onboarding and same-inode tests)make buildLive runs with NeMo Gym built from
NVIDIA-NeMo/Gym@792fa142(reports0.7.0rc0), Codex agent, Docker sandbox, both arms:Not covered yet: resumed/retried runs don't yet check that they reuse the original run's backend; Claude Code and OpenCode are mapped (
claude_code_agent,opencode_agent) but only Codex was run end to end.Release Impact
CHANGELOG.mdLink to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/67945dcbfd564cea889a3e0c2ee68013
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/67945dcbfd564cea889a3e0c2ee68013?variant=devin
Requested by: @chrisknvidia