Skip to content

feat(swebench): add the SWE-bench Multimodal benchmark - #5611

Merged
yaoyu-33 merged 2 commits into
NVIDIA-NeMo:mainfrom
trintamaki:feat/swebench-multimodal
Nov 5, 2026
Merged

yaoyu-33 merged 2 commits into
NVIDIA-NeMo:mainfrom
trintamaki:feat/swebench-multimodal

Conversation

@trintamaki

@trintamaki trintamaki commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Adds SWE-bench Multimodal (dev split) as a benchmark next to SWE-bench Verified and Multilingual, run by the same swebench resources server and the sandboxed OpenCode agent.

  • benchmarks/swebench/multimodal/prepare.py writes the 100 dev tasks of SWE-bench/SWE-bench_Multimodal (5 JavaScript repositories). Each issue's images (image_assets["problem_statement"]) are downloaded once and attached after the prompt text as input_image data URIs, because the OpenCode sandbox has no internet access. opencode_sandboxed_agent already uploads such parts and passes them to opencode run -f. An asset that is not a PNG, JPEG, GIF or WebP image is left out; its URL stays in the issue text. On the current dev split that is 1 of 162 assets (a link to the marked.js demo page).
  • The prompt is the shared minimax_prompt.txt, and the rows keep the SWE-bench row format of Multilingual (JSON-encoded FAIL_TO_PASS/PASS_TO_PASS, empty environment_setup_commit and difficulty).
  • benchmarks/swebench/multimodal/opencode.yaml and its manifest mirror Multilingual's.
  • README: a short entry for the new benchmark.
  • responses_api_agents/opencode_agent/tests/test_existing_benchmarks.py: the new config joins the binding check that the other SWE-bench OpenCode configs already have.
  • Two grading fixes in the swebench resources server, found in review; both affect only SWE-bench Multimodal rows:
    • Reference images of the test patch. SWE-bench's evaluation script downloads the test patch's binary files (image_assets["test_patch"]: 51 reference PNGs in 11 Chart.js dev tasks) with curl. The request models dropped image_assets, so those downloads never ran and the tests compared against old or missing references. image_assets is now a typed request field (SWEBenchImageAssets in task_data.py). Since the verifier sandbox may have no internet access, prepare.py stores each file's bytes in the row (content_base64). The server uploads them into the verification sandbox only, never the agent's, and the evaluation script copies them into place instead of downloading. A row whose test-patch files lack their bytes is rejected.
    • Failure-only grading. SWE-bench grades Chart.js, marked and p5.js from failures alone, so a suite that never started (a browser that did not launch, a missing test runner) read as resolved. A resolved verdict for these repositories now also needs the test runner's own completion summary (failure_only_grading.py). Without one, run_instance reports the evaluation as not completed, and the sample is masked as a verifier error. A suite that ran and reported failures is graded as before.

No agent code changes. The pinned harness (swebench 4.1.0) already has the environment specs and log parsers for the five dev repositories, and the x86 evaluation images are published under swebench/sweb.eval.x86_64.*.

Why

SWE-bench Multimodal is the standard benchmark for visual software-engineering tasks (issues that show the bug in a screenshot), and Gym has no multimodal SWE benchmark yet.

The test split (480 tasks, 11 repositories) is not included: swebench 4.1.0 has no specs for its repositories (they arrived with swebench 5.x, which changes the harness API). Supporting it is a separate change to the resources server.

Issue: none; this adds a benchmark configuration on existing components.

Validation

  • pytest benchmarks/swebench/multimodal/tests: 18 passed (image sniffing, URL parsing, row building with ordered images and a skipped non-image asset, text-only rows, stored test-patch files that the server's TaskData reads back, fetch retry and failure).
  • pytest responses_api_agents/opencode_agent/tests/test_existing_benchmarks.py: 11 passed, including the new swebench/multimodal case, which resolves benchmarks/swebench/multimodal/opencode.yaml and checks the agent, resources-server and environment-server bindings.
  • python benchmarks/swebench/multimodal/prepare.py against the Hub: 100 rows written; 94 rows carry images, 161 images attached (154 PNG, 4 JPEG, 3 GIF), one non-image asset skipped; 51 test-patch files stored (all PNG, 471 KB in total).
  • Every prepared row validates as resources_servers/swebench/task_data.TaskData, and opencode_sandboxed_agent's _parse_user_turn accepts every user turn (the prompt text plus its images).
  • swebench 4.1.0 make_test_spec(..., namespace="swebench") builds a test spec for all 100 dev rows, and each instance_image_key equals the dataset's image field (swebench/sweb.eval.x86_64.*:latest, published on Docker Hub).
  • pytest tests/unit_tests/environment tests/unit_tests/test_cli_main.py: 759 passed, 1 failed. The failure, test_every_repo_benchmark_appears_in_listing, is local to the test machine: its hostname does not resolve, so 10 existing configs that set use_absolute_ip are skipped (252 discovered, 242 listed). The new config resolves and is listed.
  • pytest resources_servers/swebench/tests: 66 passed. New: test_failure_only_grading.py (completed suites accepted; Chrome failing to start, Firefox-only, disconnected, skipped or empty Karma runs, a missing Jasmine, Incomplete: Jasmine runs and p5.js browser suites without a summary rejected) and, in test_app.py, TestImageAssets (parsed request to TestSpec, JSON-string assets, rows without bytes rejected, uploads into the verification sandbox only) and TestFailureOnlyGrading (through run_instance). Reverting either fix fails these tests.
  • Parsed request to TestSpec on all 100 prepared dev rows: the evaluation scripts of the raw rows download 51 files; after request parsing, all 51 are restored from the uploaded bytes and none is downloaded. Before this change, request parsing dropped all 51.
  • The completion checks against gold-patch logs of every Chart.js (22), marked (14) and p5.js (16) dev task, from our own earlier evaluations with the official evaluation scripts (46 runs): every gold run passes the check, except four p5.js tasks in the two runs where Chromium failed to launch. Those are the false positives this change removes.
  • pre-commit run --files <changed files>: passed (the guardwords hook was skipped: private catalog unavailable).
  • Pending: a golden-patch run of the dev split through this server (resources_servers/swebench/apply_golden_patch.py), which needs x86 sandboxes.

Rollout evidence

N/A: no agent code changes, and the resources-server changes affect only how SWE-bench Multimodal rows are graded. The benchmark reuses opencode_sandboxed_agent unchanged; the checks above confirm that the agent and the server accept every prepared row and that the harness builds each task's test spec against the published image.

Compatibility

New benchmark only; existing benchmarks and their results are unchanged.

🤖 Generated with Claude Code

Add the dev split of SWE-bench/SWE-bench_Multimodal (100 JavaScript tasks)
next to SWE-bench Verified and Multilingual, run by the same swebench
resources server and the sandboxed OpenCode agent.

The prepare script downloads each issue's images and attaches them to the
user turn as input_image data URIs, because the OpenCode sandbox has no
internet access; opencode_sandboxed_agent already passes such parts to
`opencode run -f`. Assets that are not PNG, JPEG, GIF or WebP images are
left out and keep their URL in the issue text.

The test split is not prepared: the pinned harness (swebench 4.1.0) has no
environment specs for its repositories.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tuomas Rintamaki <[email protected]>
@copy-pr-bot

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

@trintamaki
trintamaki marked this pull request as ready for review November 4, 2026 19:01
@@ -0,0 +1,28 @@
config_paths:
- responses_api_agents/opencode_sandboxed_agent/configs/opencode_sandboxed_agent.yaml

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.

Please wire this new benchmark through opencode_agent and Environment Server sessions instead of adding another dependency on the deprecated opencode_sandboxed_agent path. single_agent_turn_legacy can preserve the current flat JSONL rows while orchestrating sessions; task execution should remain in the Resources-owned sandbox.

This needs two prerequisites: typed SWE-bench Resources sessions returning SandboxAccess (existing work: #4277, dependent on #4302), and multimodal support in OpenCode's session adapter, which currently rejects images. Preserve image staging/attachments and the model's image-capability configuration; changing only the YAML path would not work.

Please make those prerequisites explicit, update the recipe, manifest, allowlist and binding test together, and include an image-bearing end-to-end model smoke demonstrating image delivery, verification and cleanup before marking this ready.

@yaoyu-33 yaoyu-33 Nov 4, 2026 •

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.

I checked the current interfaces and opened a draft directly against this branch: trintamaki#1. It uses opencode_agent + single_agent_turn with taskset routing. The two contract gaps are implemented using primitives already present, so #4277/#4302 are not required dependencies.

The commits separate SWE-bench sessions, generic OpenCode image support, and recipe wiring, so we can either merge them here or upstream the shared pieces first. Real smokes verify image-byte delivery and task/verifier cleanup. Calypso ran Jest and correctly returned 0. Correction after inspecting the actual verifier log: Chart's raw reward 1 is a false positive: both browsers failed to start, but the inherited scorer reported success. Its required reference-image metadata is also dropped at the Resources boundary. These verifier issues remain outside the harness migration and block treating scores as valid. The chart model turn also reached its smoke output-length limit. Full evidence and limitations are in the draft.

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

Two verifier correctness findings independent of the harness migration.

# Minor tweaks on the formatting to match that of SWE Bench
row["FAIL_TO_PASS"] = json.dumps(row["FAIL_TO_PASS"])
row["PASS_TO_PASS"] = json.dumps(row["PASS_TO_PASS"])
return row

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.

[P1] Preserve the verifier's reference-image fixtures

This returned row preserves image_assets, but SWEBenchSeedSessionRequest / SWEBenchVerifyRequest discard that undeclared field before make_test_spec(body.model_dump()). Comparing all 100 dev rows before/after this boundary removes 51 required fixture downloads across 11 Chart.js tasks. For chartjs__Chart.js-10157, four updated PNGs correspond to its four FAIL_TO_PASS visual assertions; the textual test patch contains only binary-file markers, so those cannot restore the required image bytes. Grading then uses old or missing references. Direct make_test_spec(raw_row) validation bypasses this failure.

Please preserve typed image_assets.test_patch metadata through the Resources requests and deliver those fixtures to the verifier, with a parsed-request-to-TestSpec regression and golden-patch check. If verifier sandboxes have no egress, pre-stage the fixture bytes as well; retaining URLs alone is insufficient.

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.

Thanks, fixed in 2a08272. image_assets is now a typed field of the swebench requests (SWEBenchImageAssets in task_data.py), so it reaches make_test_spec. Since the verifier sandbox may have no egress, prepare.py also downloads each test_patch file and stores its bytes in the row (content_base64). The server uploads them into the verification sandbox only (not the agent's) and replaces each curl -o <path> <url> line of the eval script with a copy from the upload. A row whose test-patch files lack bytes is rejected.

On the 100 prepared dev rows, the request-parsed TestSpec now restores all 51 files (none dropped, no curl left), and every image key is unchanged. Regression tests: TestImageAssets in resources_servers/swebench/tests/test_app.py (parsed request to TestSpec, rows without bytes rejected, uploads into the verification sandbox only). The golden-patch run through the server is still pending; I'll add it to the description when it's done.

- resources_servers/swebench/configs/swebench.yaml

swebench_multimodal_opencode_resources_server:
_inherit_from: swebench_resources_server

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.

[P1] Reject successful grades when the JavaScript test suite never starts

This pairing inherits swebench==4.1.0's fail-only grading: tests absent from the parsed results count as passing. With real task markedjs__marked-1262, a controlled missing-Jasmine run emitted No such file or directory plus both test markers, exited 0, and the real scorer returned resolved=True for all four FAIL_TO_PASS tests. Gym accepts that report as completed. The companion migration smoke also reports a real Chart.js false positive: both browsers failed to start, yet reward was 1.

Please require evidence that the intended suite actually executed before accepting fail-only success, and regression-test startup/collection failures. Infrastructure startup errors should produce an invalid/masked grade. Simply rejecting every empty parsed map would also reject legitimate clean fail-only runs. This is an inherited verifier defect exposed by the new benchmark, independent of the harness migration.

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 2a08272. For the three failure-only repositories, a resolved verdict now also needs the runner's own completion summary (resources_servers/swebench/failure_only_grading.py):

  • Chart.js: Chrome's Karma run executed every planned test (Executed N of N, N > 0). Firefox can't stand in, since the parser reads Chrome failures only, and a run with skipped tests doesn't count.
  • marked: Jasmine printed N specs, M failures with N > 0 and no Incomplete: line.
  • p5.js: every mochaChrome/mocha browser task printed a Mocha passing summary.

Without that summary, run_instance reports the evaluation as not completed, so the sample is masked as a verifier error instead of graded. A clean fail-only run with an empty parsed map still passes, and a run that reported failures is graded as before.

I checked the rules against gold-patch logs of every Chart.js, marked and p5.js dev task from our earlier evaluations with the official eval scripts (46 runs). Every gold run passes, except four p5.js tasks in the two runs where Chromium failed to launch, which is exactly the false positive you describe. Tests: test_failure_only_grading.py (startup failures, missing Jasmine, Incomplete: runs, partial or skipped Karma runs) and TestFailureOnlyGrading in test_app.py, which goes through run_instance.

…ted failure-only suites

Two grading fixes for SWE-bench Multimodal rows in the swebench resources server.

Reference images: SWE-bench's evaluation script downloads the test patch's binary files
(image_assets["test_patch"], 51 reference PNGs in 11 Chart.js dev tasks), but the request models
dropped image_assets, so the tests compared against old or missing references. image_assets is now
a typed request field. prepare.py stores each file's bytes in the row, the server uploads them into
the verification sandbox only, and the evaluation script copies them into place instead of
downloading, so the verifier needs no internet access. Rows whose test-patch files lack bytes are
rejected.

Failure-only suites: SWE-bench grades Chart.js, marked and p5.js from failures alone, so a suite
that never started read as resolved. A resolved verdict for these repositories now also needs the
test runner's completion summary; without it the evaluation is reported as not completed and the
sample is masked as a verifier error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tuomas Rintamaki <[email protected]>
@yaoyu-33
yaoyu-33 enabled auto-merge November 5, 2026 00:46
@yaoyu-33

yaoyu-33 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/ok to test 2a08272

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@yaoyu-33
yaoyu-33 added this pull request to the merge queue Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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

Merged via the queue into NVIDIA-NeMo:main with commit 1a253ae Nov 5, 2026
61 of 64 checks passed
yaoyu-33 added a commit that referenced this pull request Nov 5, 2026
…ped-seed

Merges the parent branch, which now includes main (the SWE-bench Multimodal benchmark, #5611). Its test_assets
now reach only the verifier sandbox, and the typed seed keeps the task sandbox free of them. TaskData keeps
image_assets optional, so the schema test no longer expects it to be required.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 2a082728 Deployed Nov 5, 2026 by copy-pr-bot[bot] via release / finalize / notify #10209
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.

2 participants