Repository navigation
feat(swebench): add the SWE-bench Multimodal benchmark - #5611
Conversation
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]>
| @@ -0,0 +1,28 @@ | |||
| config_paths: | |||
| - responses_api_agents/opencode_sandboxed_agent/configs/opencode_sandboxed_agent.yaml | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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 failureswith N > 0 and noIncomplete:line. - p5.js: every
mochaChrome/mochabrowser task printed a Mochapassingsummary.
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]>
|
/ok to test 2a08272 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41946363121 |
…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]>
What changed
Adds SWE-bench Multimodal (dev split) as a benchmark next to SWE-bench Verified and Multilingual, run by the same
swebenchresources server and the sandboxed OpenCode agent.benchmarks/swebench/multimodal/prepare.pywrites the 100 dev tasks ofSWE-bench/SWE-bench_Multimodal(5 JavaScript repositories). Each issue's images (image_assets["problem_statement"]) are downloaded once and attached after the prompt text asinput_imagedata URIs, because the OpenCode sandbox has no internet access.opencode_sandboxed_agentalready uploads such parts and passes them toopencode 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).minimax_prompt.txt, and the rows keep the SWE-bench row format of Multilingual (JSON-encodedFAIL_TO_PASS/PASS_TO_PASS, emptyenvironment_setup_commitanddifficulty).benchmarks/swebench/multimodal/opencode.yamland its manifest mirror Multilingual's.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.swebenchresources server, found in review; both affect only SWE-bench Multimodal rows:image_assets["test_patch"]: 51 reference PNGs in 11 Chart.js dev tasks) withcurl. The request models droppedimage_assets, so those downloads never ran and the tests compared against old or missing references.image_assetsis now a typed request field (SWEBenchImageAssetsintask_data.py). Since the verifier sandbox may have no internet access,prepare.pystores 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.py). Without one,run_instancereports 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'sTaskDatareads back, fetch retry and failure).pytest responses_api_agents/opencode_agent/tests/test_existing_benchmarks.py: 11 passed, including the newswebench/multimodalcase, which resolvesbenchmarks/swebench/multimodal/opencode.yamland checks the agent, resources-server and environment-server bindings.python benchmarks/swebench/multimodal/prepare.pyagainst 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).resources_servers/swebench/task_data.TaskData, andopencode_sandboxed_agent's_parse_user_turnaccepts every user turn (the prompt text plus its images).make_test_spec(..., namespace="swebench")builds a test spec for all 100 dev rows, and eachinstance_image_keyequals the dataset'simagefield (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 setuse_absolute_ipare 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, intest_app.py,TestImageAssets(parsed request to TestSpec, JSON-string assets, rows without bytes rejected, uploads into the verification sandbox only) andTestFailureOnlyGrading(throughrun_instance). Reverting either fix fails these tests.pre-commit run --files <changed files>: passed (the guardwords hook was skipped: private catalog unavailable).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_agentunchanged; 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