Skip to content

feat(mm_coding_training): add the visual-coding training environment - #6091

Merged
yfw merged 20 commits into
mainfrom
yifuw/mm-coding-training-env
Nov 16, 2026
Merged

yfw merged 20 commits into
mainfrom
yifuw/mm-coding-training-env

Conversation

@yfw

@yfw yfw commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What this PR adds

This PR adds a training environment for four visual-coding task families: Chart2Code, MMSVG (Img2SVG and Text2SVG), Image2Struct LaTeX and Design2Code. The model gets an image or a text task and writes one answer file in Python (Matplotlib), SVG, LaTeX or HTML. A fresh remote sandbox renders the answer. A judge model then scores the task fidelity and the visual fidelity of the rendering. The reward is execution * (0.2 + 0.8 * Q), where Q is the mean of the two judge scores.

Fuxiao Liu wrote the environment. renderer.py, extraction.py and contract.json are adapted from NVIDIA's visual-coding RL research code at revision b0d39e87f3a30391ae5aeaa02a08ff3cc539f9cc: mmrl/render.py, extract_answer in mmrl/artifacts.py, and mmrl/judge_contract.py and mmrl/reward.py. That repository is NVIDIA-internal and has no public URL. NVIDIA releases these files under Apache-2.0.

The PR has two catalog entries:

  • environments/mm_coding_single: one answer from simple_agent.
  • environments/mm_coding_opencode: OpenCode in a task sandbox that the resources server lends through LentSandboxes. The resources server seeds the task, grades the saved answer file and stops the sandbox.

resources_servers/mm_coding_training/configs/mm_coding_mixed.yaml serves both harnesses in one run, for the mixed recipe in NeMo RL.

resources_servers/mm_coding_training/sandbox_image/Dockerfile builds the sandbox image. The image renders Matplotlib, SVG, LaTeX and HTML answers, and it runs OpenCode 1.17.11 for the OpenCode entry.

Two visual environments are already on main. vision2code scores Python code that recreates an image. visual_coding_opencode scores a boxed answer to a question about an image. This environment scores four output formats, and the reward is zero unless the answer renders.

Changes to Gym core

The PR has five small changes to Gym core. Each change has tests. The environment needs changes 1, 3, 4 and 5.

  1. nemo_gym/data/task_data.py and nemo_gym/data/task_materialization.py: _rowidx is now a reserved row key. NeMo RL adds _rowidx to each row to match streamed results. Without this change, the resources server refuses each flat NeMo RL row (the single-answer route) at seed with a 422 error. Typed rows are not affected. Fuxiao Liu wrote this commit.
  2. nemo_gym/rollouts/harness_capabilities/checker.py: the media check of TE-7 ignores the parameter schemas of function tools in the request and in the response, which repeats the request's tools. TE-7 failed for harnesses whose tools take an image_url argument, such as Hermes's vision_analyze. This environment does not need it.
  3. nemo_gym/environment/validation.py: catalog datasets can hold typed {task_id, task_input} rows for a taskset that routes to a single_agent_turn Environment Server. Gym parses each typed row with the task input model of that server. Gym refuses a typed row that also has a top-level responses_create_params. environments/mm_coding_opencode uses typed rows.
  4. nemo_gym/data/dataset_preparation.py: collation keeps a typed row whose taskset is the dataset's taskset, and it refuses a typed row of another taskset. Without this change, gym dataset collate and the data step of gym eval run stop on the OpenCode entry with "Expected a flat dataset row". fern/versions/latest/pages/environment-tutorials/resources-server-apis.mdx now says this.
  5. nemo_gym/eval/rollout_reverification.py: the /verify body of gym eval reverify keeps a saved source_artifact, source_sha256 and source_binding_sha256. Without this change, every reverified OpenCode row comes back masked as session_lost.

What is not in this PR

  • Changes to the shared OpenCode agent: a vision setting (the same as image_input), allow_request_output_limit, compaction.prune and two repeated definitions. The environment uses none of them. mm_coding_multi.yaml sets image_input: true.
  • sandbox_observation(). Only the Codex and Hermes harnesses used it, and they are not in this PR.
  • Test changes that are not related to this environment.

Configuration

resources_servers/mm_coding_training/README.md lists the environment variables. The sandbox image and the judge model have no default. Before a run, build the image, push it and set MM_CODING_SANDBOX_IMAGE to its digest reference. Then set MM_CODING_JUDGE_MODEL. The judge endpoint defaults to https://api.openai.com/v1. The OpenCode entry also needs the SHA-256 pins of the OpenCode binary, ripgrep and the plugin bundle.

Validation

All local runs used CPU only. These checks ran at 08a2c151a1a874bd4c585a90354a1fcaed3bef68, which has the review fixes and Fuxiao Liu's merge of main:

  • uv lock --check in resources_servers/mm_coding_training with uv 0.13.7: passed.
  • pytest resources_servers/mm_coding_training/tests, in the venv from uv sync --locked: 134 passed.
  • pytest tests/unit_tests/data/test_dataset_preparation.py tests/unit_tests/data/test_task_data.py tests/unit_tests/data/test_task_materialization.py: 559 passed. tests/unit_tests/environment: 709 passed. tests/unit_tests/rollouts/harness_capabilities: 289 passed. tests/unit_tests/eval/test_rollout_reverification.py: 250 passed.
  • gym env test mm_coding_single and gym env test mm_coding_opencode: 3 verifier cases each, passed. Both entries need placeholder values for MM_CODING_SANDBOX_IMAGE and MM_CODING_JUDGE_MODEL, and the OpenCode entry also for its MM_CODING_* pins.
  • pre-commit run --all-files: passed, with no rewrites.
  • The tests that aaea78d066 adds: 9 of 12 cases fail with the code of 7b2ef1dfad. The other 3 cover cases that already passed. The two cases that 2b9ddee308 adds fail with the image-data check of aaea78d066.
  • Current main merges into this head with no conflict.

These checks ran at 96d5f920c9. After it, the configs and the data changed only in data/example_rollouts.jsonl, which these checks do not read:

  • gym env validate (5 rows, no warnings) and gym env publish for both entries: passed.
  • gym dataset collate --mode example_validation on the OpenCode entry: 5 rows.
  • gym env validate --strict with mm_coding_training.yaml, mm_coding_multi.yaml and mm_coding_mixed.yaml: exit 0.
  • After 2f768458e7, sandbox_image/Dockerfile did not change, and renderer.py changed only in its header comment. At 2f768458e7, docker build passed, including the dependency preflight of the renderer (renderer.py --check). In that image, with no network, a Matplotlib chart, an SVG, a LaTeX equation and an HTML page rendered to PNG as root and as another user.

CI passed on 08a2c151a1, including the core, sandbox, server-suite, coverage and lock checks.

A smoke at 08a2c151a1 ran the 5 single-answer and the 5 OpenCode examples, 1 rollout each. The policy model was a hosted Super 3.5 VL, so the run used no GPU. The sandboxes were OpenSandbox sandboxes from the image built from sandbox_image/Dockerfile at 96d5f920c9 (digest sha256:6708aba361612f60f56e5b4a0c74220ca8cb25940321f8f0d40dc91a7840951f). sandbox_image/ did not change after it. The judge was an OpenAI-compatible endpoint. All 10 rows were graded, and none was masked. The single-answer rewards were 0.66 to 1.0, and the OpenCode rewards were 0.64 to 1.0. Each OpenCode row made 2 to 5 tool calls and saved its answer file. The image-data check found no image data in the 10 saved sources.

Earlier smokes had the same counts. A smoke at 96d5f920c9 with the same image and judge graded 10 of 10 rows, with none masked. Fuxiao Liu reports a smoke with the fixes of aaea78d066 and the merge of main, with an existing sandbox image: 10 of 10 graded, none masked.

Rollout evidence: resources_servers/mm_coding_training/data/example_rollouts.jsonl holds the 5 single-answer rollouts of the smoke at 96d5f920c9.

Related

Compatibility

Existing environments do not change. A task payload can no longer carry a field named _rowidx, because change 1 makes it a reserved key. Change 3 adds a row shape and does not change the rows that Gym accepted before. Change 4 changes collation only for typed rows in a dataset with a taskset, which collation refused before. Change 5 adds three keys to the reverify payload, and only this environment saves them.

🤖 Generated with Claude Code

nvlf and others added 5 commits November 12, 2026 15:44
Add a training environment for Chart2Code, MMSVG Img2SVG and Text2SVG,
Image2Struct LaTeX and Design2Code. The model writes one answer file. A
fresh remote sandbox renders it, and a judge model scores the render.
The environment has a single-answer catalog entry with simple_agent and
an OpenCode catalog entry with a lent task sandbox.

Fuxiao Liu wrote this environment in 17 commits, and this commit joins
them. The OpenCode configuration declares image input with image_input.

Signed-off-by: Fuxiao Liu <[email protected]>
[Yi-Fu Wu: removed internal addresses, defaults and evidence documents,
and rewrote the internal README sections]
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
The renderer and the OpenCode route need a sandbox image with Matplotlib,
CairoSVG, TeX Live, Poppler, Playwright Chromium and OpenCode 1.17.11.
Add sandbox_image/Dockerfile. The build runs the dependency preflight of
the renderer, so an incomplete image does not build. The OpenCode binary
and its SHA-256 are the same as in the visual_coding_opencode image.

A local build passed the preflight. Matplotlib, SVG, LaTeX and HTML
inputs rendered with no network, as root and as another user.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
… check

The media check read declared function tools as request content. A tool
whose parameter schema has a property named image_url, such as a vision
tool, then counted as an unresolved image, so check TE-7 failed for a
complete request. Inspect the request without those parameter schemas.

Co-authored-by: Fuxiao Liu <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
The catalog check accepted only flat rollout rows, so it refused the
typed {task_id, task_input} rows of an environment that routes a
taskset to a single_agent_turn Environment Server. Parse those rows
with the task input model of their Environment Server. Refuse a typed
row that also has a top-level responses_create_params.

Co-authored-by: Fuxiao Liu <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 12, 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.

yfw and others added 9 commits November 12, 2026 23:17
The lock was made against a root pyproject.toml with an extra that main does
not have. "Check locks" and every `uv sync --locked` of this server failed.
uv 0.13.7 removes only those entries. No package version changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
`gym env validate` accepts typed `{task_id, task_input}` rows in a dataset
that declares a taskset, but collation sent every row of such a dataset to
`materialize_task`, which refuses a row that is already a task. So
`gym dataset collate` and the data step of `gym eval run` stopped on the
OpenCode entry. Collation now keeps a typed row of the dataset's own taskset
and refuses a typed row of another taskset.

The OpenCode entry also collated the 5 single-answer example rows of the
base config. It now clears that dataset list, so its example split holds
only the 5 OpenCode rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…nvalid

An OpenCode answer could embed the bytes of the reference image, for
example as an SVG data URI or a hex literal that a chart program writes
over render.png. Its render was then an exact copy, and the judge could
give it reward without the task being done. grade_source now refuses a
source with a chained run of 1024 or more base64 or hex characters before
the grading sandbox starts, and scores it as invalid_artifact.

The guard blocks the direct forms. It does not close every copy path, and
the README now says so. The 5 example policy answers pass it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…agent runs

The OpenCode Environment Server had no max_concurrent_episodes. Every row
was seeded at once and got a 4-CPU, 16 GiB task sandbox, but OpenCode runs
8 sessions at a time. Rows past the first 8 held their sandbox while their
10800 s deadline ran. The server now admits 8 episodes, and the others wait
with no sandbox and no running deadline (queue_timeout_seconds: 86400).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
`gym eval reverify` and the end-of-run re-judgment build the /verify body
from a fixed list of saved keys. A judge failure of the OpenCode route
saves `source_artifact`, `source_sha256` and `source_binding_sha256`, but
the list did not carry them. Reverify opens a fresh session, so every
reverified OpenCode row came back masked as session_lost. The payload now
keeps the three fields, and the server grades the saved source again.

A session test runs a real judge failure through `_build_verify_payload`
and a fresh-session /verify call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…ncelled

When a client disconnect or a deadline cancelled /verify during a render,
the unshielded `await sandbox.stop()` in the finally block was cancelled
too. The grading sandbox then stayed up until its 14400 s TTL. The stop now
runs in a shielded anyio scope with the 120 s bound that LentSandboxes uses
for its own stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…is unusable

The single-answer seed did not read the reference image. With a wrong
MM_CODING_REFERENCE_ROOT, every image task was seeded and then masked as
verifier_error at /verify, so 4 of the 5 benchmarks stopped training and
the run went on. The seed now checks the reference as the OpenCode seed
does and answers 422 for a missing or changed image. A reference that
changes after the seed is still masked at /verify.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Both `\s*` in the fence pattern matched newlines. On a completed reply
with an unclosed fence, the failed match tried every split of the blank
lines, so the time grew with the cube of their count: 5000 blank lines took
about 30 s, on the event loop, and every other verify, seed and close of
the server waited. The fence whitespace now stays on one line, and leading
blank lines are removed in a separate anchored step. The extracted source
is the same as before, except that blank lines before the closing fence
stay in it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…at this code

The 5 example rollouts came from an earlier version of this code and had no
`evaluation_completed` field. The new rows are the 5 single-answer
rollouts of a smoke at 96d5f92, with Super 3.5 VL as the policy model,
OpenSandbox grading sandboxes and an OpenAI-compatible judge. All 5 were
graded, with rewards from 0.64 to 1.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7b4e27d

@yfw yfw added area:data Datasets, preparation, task formats, and materialization area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@yfw yfw left a comment

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.

SHIP. You can mark this PR ready for review after CI passes. The commits after 2f76845 fix each comment of this review, and a smoke ran at the fixed code.

The comments below point at 2f76845. This summary is for the head 7b4e27d. The design of the environment is sound. The resources server lends the OpenCode task sandbox with a model_only network. Grading reads the answer file, so any harness with shell and file tools can solve the task. The seed and close hooks are typed, and a test runs the resources session contract.

These commits fix the comments below:

  • f41ea5f regenerates the component lock.
  • 20ee5fb keeps typed rows in collation. It also empties the base dataset list of the OpenCode entry, so that entry collates only its 5 OpenCode rows.
  • a842821 scores an answer that carries image data as invalid.
  • 9b0cbd1 admits only as many OpenCode episodes as the agent runs.
  • 7545a05 keeps the saved source fields in the reverify payload.
  • 9c60548 stops the grading sandbox after a cancelled render.
  • 86fe76b refuses a single-answer seed whose reference image is unusable.
  • 96d5f92 matches code fences in linear time.

Each fix in Python has a test that fails without it. "Check locks" passes with the new lock, and gym dataset collate writes 5 rows for each catalog entry. At this head, the 124 server tests pass. The example rollouts now come from a smoke at 96d5f92, and the judge graded all 5 rows.

Process: DCO, Lint, copyright-check, secrets-detector, "Check locks", the core tests, the sandbox tests and 7 of the 8 server-suite shards pass at this head. When this summary was written, server-suite shard 4 was still running. The non-blocking harness conformance job fails with all 11 harnesses "unavailable", and each of its probe jobs passes. "Autobot lock-freshness" fails as an advisory. main changed only the import-linter list in the root pyproject.toml, and after a merge with main the component lock still passes uv lock --check.

Generated by Claude Code

Comment thread nemo_gym/environment/validation.py Resolved
@yfw
yfw marked this pull request as ready for review November 13, 2026 18:55
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

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

Thanks for preparing the public version. I reproduced three reward-correctness cases: valid compact SVG code is rejected, missing-answer zeros are dropped during full reverification, and oversized candidate renders are retried then masked. Please address these before approval.

For clarity, the SVG issue is new in the public-release changes. The other two grading gaps existed before the public port and were missed in my earlier review. I also left smaller checker, documentation and source-attribution requests.

Focused environment and core tests pass. The reduced reproductions exercise the verifier with external sandbox/judge transports mocked; I did not rerun live rollouts. The final head still needs its applicable CI.

Comment thread nemo_gym/data/dataset_preparation.py Resolved
nvlf added 2 commits November 13, 2026 18:05
Recognize encoded raster headers instead of rejecting long drawing commands. Retain a task/response-bound empty-source receipt for measured missing artifacts so full reverification keeps their zeros. Treat successfully rendered candidates exceeding image limits as measured execution failures while retaining infrastructure masks. Cover echoed response tool schemas and document typed taskset collation. Regression probes fail on 7b2ef1d and pass with these fixes.

Signed-off-by: Fuxiao Liu <[email protected]>
Resolve the three overlapping regions in environment validation by keeping the typed taskset route map alongside Harbor target metadata, and retaining both validation helpers. Targeted merged-tree regressions: 2207 passed, 81 skipped; a 2-second OpenCode start-wait failure was retained and its full 234-case session suite passed separately. All-file pre-commit passed. Real smoke is being run separately on this exact merged source snapshot.

Signed-off-by: Fuxiao Liu <[email protected]>
@FuxiaoLiu

Copy link
Copy Markdown

@yfw @yuhezhang-ai I validated public head 7b2ef1df and prepared follow-up fixes without changing this PR's branch or opening another PR.

The fixes are available on this branch:

  • aaea78d0 addresses the three reward-correctness findings: recognize encoded raster headers instead of rejecting long compact SVG commands; retain a task/response-bound empty-source receipt for missing/invalid final files so full reverification preserves their measured zeros; classify successfully rendered candidates over the documented byte/pixel budgets as execution failures, while keeping dependency/transport failures masked. It also covers echoed response.tools schemas and updates the taskset-collation documentation.
  • 357e680f merges main 7f2a6634 and resolves the three overlapping regions in environment/validation.py, keeping both typed-taskset routing/validation and Harbor-target handling. This branch includes the current PR head and can be adopted after review; I do not have upstream push permission.

Validation on merged source tree cfaeec838f7855edf9dd4f7b836658045ef2294f:

  • New regression probes: 9 fail / 3 pass before the fixes, then pass after the fixes. Existing embedded-raster rejection cases still pass.
  • Component + media-checker regressions: 168 passed. Official gym env test --resources-server mm_coding_training +should_validate_data=true passed, including locked component setup and data validation. All-file pre-commit passed (the private guardword catalog is unavailable in this public checkout, so that hook's private scan was skipped).
  • Expanded merged-tree regression: 2,207 passed / 81 skipped with one 2-second OpenCode activation-wait timeout; the entire 234-case session suite passed on isolated recheck. Original failure logs are retained; no timeout or test assertion was relaxed.
  • Independent remote Linux CPU regression: 2,086 passed / 2 skipped, with exact source hashes and tracked-file inventory verified, and sandbox cleanup confirmed. The initial harness run exposed two test-environment issues (missing Git inventory and an extra discovery root); those logs are retained, and the rerun changed only the harness setup, not candidate code or test assertions.
  • Fresh hosted Nemotron 3.5 Super VL functional smoke: 5 single + 5 OpenCode examples, all measured, execution successful, 0 masked; no policy resampling. Independent retained-byte audit checked 30 policy calls, 10 original judge replies, task-image SHA, source/render/score bindings, unchanged reward arithmetic, and service/sandbox cleanup.
  • Two additional real remote CPU renderer probes passed: a compact 300-repeat SVG path renders, and a successfully rendered 1280×25100 HTML candidate returns a measured size-limit execution failure.

Limits / remaining items:

  1. My real smoke reused a compatible pre-existing pinned sandbox image; it does not independently rebuild or recertify the new public Dockerfile. This is functional environment evidence, not native learner/checkpoint-recovery acceptance.
  2. I left the source-attribution request open: could you confirm the approved release-safe source URL/revision/license reference for the adapted renderer, extractor and judge contract? I have not reintroduced private source URLs or invented a public upstream.
  3. The original PR still needs these fixes adopted, re-review, and the applicable full NVIDIA CI on its final upstream head. Current basic checks are green, but I do not treat those, the fork (which has no NVIDIA check runs), or older-head CI as final-head full-CI approval. No merge was performed.

yfw and others added 2 commits November 13, 2026 17:10
A check of the decoded header misses image data that does not start a
chain with a known image header. Two such answers get a reward:

- an HTML data URL with a space after its first 16 characters (the data
  URL standard removes spaces before decoding),
- raw RGB pixels, or compressed pixels, in a Python answer.

Count a chain only when one of its runs has a character outside SVG path
data instead. Path data uses only the command letters, digits, "+" and
"e", so compact paths still render. The tests add the two answers above.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…iles

The code provenance rule asks for the source URL, revision and license
in the header of each file with adapted code. renderer.py and
extraction.py now name their source file, the revision
b0d39e87f3a30391ae5aeaa02a08ff3cc539f9cc and the Apache-2.0 license.
The source repository is NVIDIA-internal and has no public URL, so the
headers say that in place of a URL. contract.json is JSON and has no
comments, so the README gives the same revision for all three files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @FuxiaoLiu. I added your two commits to this branch as they are (aaea78d066 and 357e680f3e). I added two commits after them:

  • 2b9ddee308 changes the image-data check. The header check in aaea78d066 misses image data that does not start a chain with a known image header, for example an HTML data URL with a space after its first 16 characters, or raw or compressed pixels in Python. The check now counts a chain only when one of its runs has a character that SVG path data does not use. Your compact path test still passes, and the two cases above are now in test_answer_carrying_image_bytes_is_model_zero.
  • 08a2c151a1 records the source revision and the license in the two file headers, the README and the PR description. The source has no public URL, so they say that.

Current main merges into this head with no conflict, so I did not merge it again.

@yfw

yfw commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 08a2c15

@yfw
yfw requested a review from yuhezhang-ai November 14, 2026 01:21
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 14, 2026 01:21
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 16, 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 08a2c151a1a874bd4c585a90354a1fcaed3bef68 against current main / merge-base 7f2a6634deaeee2d8e11dfdd5e5aec2233744f7f.

All six earlier comments are addressed: compact SVG drawing code is accepted, missing-answer zeros survive full reverification, oversized candidate renders get a measured execution-failure zero, echoed tool schemas are handled, the collation documentation matches the implementation, and release-safe source provenance is recorded. I found no remaining confirmed code defect in these fixes or the additional image-data check.

Validation:

  • 1,095 component and relevant core tests passed.
  • The three original reproductions plus three size/error-classification controls passed. These use isolated external sandbox/judge transports; they are not live rollouts.
  • Eight image-data cases matched the expected classifications, and the five retained single-answer sources pass the final guard.
  • Full NVIDIA CI passed on this exact head, including core, sandbox, server-suite, coverage and lock checks. The PR description's statement that this head still needs CI can now be updated.

One validation item remains before approval: the latest reported real smoke predates 2b9ddee308, which changes which answers receive an invalid-artifact zero. The component's validation instructions require a real model/remote-renderer/judge smoke on the reviewed revision. Please record a small representative smoke covering both the single-answer and OpenCode routes with the final guard, including the revision, sandbox image, completed/masked counts and inspected verifier results. The attribution-only change in 08a2c151 does not itself need another model run.

The earlier code findings are cleared; I am holding approval only for that final live-validation evidence.

@yfw

yfw commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @yuhezhang-ai. The smoke ran at 08a2c151a1a874bd4c585a90354a1fcaed3bef68, with the final image-data check. All 10 rows were graded, and none was masked.

  • Revision: 08a2c151a1a874bd4c585a90354a1fcaed3bef68. One Gym run served both routes from environments/mm_coding_opencode/config.yaml.
  • Rows: the 5 single-answer examples and the 5 OpenCode examples, 1 rollout each.
  • Policy model: hosted Super 3.5 VL through the inference_provider model server. The run used no GPU.
  • Judge: an OpenAI-compatible endpoint, the same judge as the smoke at 96d5f920c9.
  • Sandbox: OpenSandbox, with an image built from sandbox_image/Dockerfile at 96d5f920c9 (digest sha256:6708aba361612f60f56e5b4a0c74220ca8cb25940321f8f0d40dc91a7840951f). sandbox_image/ did not change after 96d5f920c9. The server uploads its own renderer.py to each sandbox, so the renderer of this head ran.
  • Counts: 10 of 10 rows have evaluation_completed=true and execution=1.0. 0 rows are masked, and both failure files are empty.
Task Single answer OpenCode
Chart2Code 0.912 0.90
MMSVG Img2SVG 0.70 0.78
MMSVG Text2SVG 1.0 1.0
Image2Struct LaTeX 0.66 0.64
Design2Code 0.82 0.86

What I inspected in each row:

  • The saved source matches its source_sha256. Each OpenCode row also has source_binding_sha256. Each row with a reference image has reference_sha256. Text2SVG has no reference image.
  • embeds_image_data returns false for all 10 saved sources. No source has a base64 or hex run of 32 or more characters, so the check had nothing to count. The tests cover the cases that it refuses or accepts: test_answer_carrying_image_bytes_is_model_zero and test_compact_svg_path_is_graded_like_spaced_drawing_code.
  • The judge reasons match the sources. For example, both LaTeX answers use a portrait article page with a page number, and the judge gave visual fidelity 0.25 and 0.2 for that. Both Chart2Code answers keep the default Matplotlib axes, and the judge named the numeric y-axis ticks and the extra spines.
  • Each OpenCode row made 2 to 5 tool calls, saved its answer file and finished in 76 to 119 seconds. The single-answer rows took 31 to 46 seconds.
  • The server log has no traceback, no masked verification, no HTTP 4xx or 5xx status and no failed sandbox stop.

I updated the Validation section of the PR description with this smoke and the CI result on this head.

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

Thanks, this closes the remaining validation request. The reported smoke covers both routes on the reviewed 08a2c151 revision with the final image-data check, and records completed grading, source bindings, judge inspection and cleanup.

All six earlier review comments are addressed, and full NVIDIA CI passes on this revision. I have no further blocking review comments.

@yfw

yfw commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d0703ea

@yfw
yfw enabled auto-merge November 16, 2026 17:32
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 16, 2026 17:33
@yfw
yfw added this pull request to the merge queue Nov 16, 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/43922595156

Merged via the queue into main with commit 2197dcd Nov 16, 2026
80 checks passed
@yfw
yfw deleted the yifuw/mm-coding-training-env branch November 16, 2026 18:04
qiaochuz-nv added a commit that referenced this pull request Nov 16, 2026
Conflict in tests/unit_tests/data/test_task_data.py: both sides appended tests
at the end of the file. Kept the PR's TestFindServerDirRejectsOutputOnlyDirs
and TestExternalCwdThroughTheProcessor and main's
test_rl_stream_index_is_not_part_of_task_schema (#6091).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: qiaochuz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:data Datasets, preparation, task formats, and materialization area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants