Repository navigation
Add SWE-bench Verified external eval - #445
Conversation
Runs an agent per instance in the prebuilt SWE-bench image, extracts its patch, and grades it in a fresh container with the upstream swebench log parsers. External evals can now declare package extras for Beaker jobs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…verflow Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ng tree Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A session command that hit its timeout used to raise and leave the shell busy, so every later command in the session timed out too. The executor now interrupts the session (or recreates it) and returns a failed result. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The streaming executor abandons a command after a few slow status polls, which under load cut off test runs well before the eval timeout. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e errored Running the dataset's raw eval script skipped the test exit-code check that rejects logs reporting passes from a failed test run. Also pin swebench exactly, record it and the full run settings in metadata, and fix smaller review items. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Docker Hub's anonymous pull limit stops a full run partway through, and every image stays on disk. Epoch AI mirrors all 500 Verified images on GHCR, which needs no login. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
pdasigi
left a comment
There was a problem hiding this comment.
I ran this branch (b760f2d) over all 500 SWE-bench Verified instances with Qwen3.5-9B and Qwen3-8B to check parity with published numbers. Results first, then the issues I hit (also left inline).
Parity results
Settings: PR defaults (bash + submit tools, thinking off, max_turns=100, max_tool_output_chars=10000, agent_timeout=3600, GHCR images), max_concurrency=8 per node, 4 repo shards per model, one run each. Qwen3.5-9B used max_model_len=131072; Qwen3-8B ran at its native 40K context.
| Model | Resolved | Patch applied | Empty patch | Ended at max_turns |
|---|---|---|---|---|
| Qwen3.5-9B | 257/500 = 51.4% | 92.0% | 8.0% | 466/500 |
| Qwen3-8B | 3/500 = 0.6% | 6.6% | 93.4% | 241/500 |
Qwen3.5-9B against the published SWE-bench Verified numbers (Qwen's own model card has none):
| Source | Harness | Published | This PR |
|---|---|---|---|
| Microsoft Agent Lightning v1.0 (arXiv 2608.17528) | mini-SWE-agent-style bash loop, thinking off, 40 turns, 10k-char observation cap | 41.8 | 51.4 |
| Xiaomi MiMo-V2.6 report, Table 7 | mini-swe-agent (thinking/sampling unstated) | 60.6 | 51.4 |
| Xiaomi MiMo-V2.6 report, Table 6 | unstated, avg@3 | 60.0 | 51.4 |
So the bash-only agent here lands between the two bash-only baselines: above the one whose settings match this PR most closely (thinking off, tighter turn cap), and ~9 points under the mini-swe-agent number, which was most likely run with thinking on. Thinking mode can't be tested on this branch yet (see issue 3).
Qwen3.5-9B breakdown: by difficulty <15 min 68.6%, 15 min–1 h 46.7%, 1–4 h 4.8%; by repo scikit-learn 71.9%, django 52.4%, sympy 52.0%, sphinx 29.5%. 14 instances errored (11 test_log_unparsed from patches that break imports, 3 eval_timeout); all count as unresolved, which is right.
Qwen3-8B: 3/500, consistent with the 1/11 in the PR description. It greps and lists files and almost never edits: 196 instances ended with a reply and no tool call, 241 hit the turn cap, 60 overflowed the 40K context. Tool calls parse fine (checked raw vLLM responses), so this is the model, not the harness.
Variance note: a node failure forced the 97-instance sphinx shard to run twice. 51 vs 50 resolved, but only 72/97 instances had the same outcome, so single-run numbers carry a few points of noise.
Beaker experiments (workspace ai2/olmo-instruct)
Qwen3.5-9B: django, sympy+pytest+requests+seaborn+flask (stopped after the image-build hang below; 103 finished instances recovered from the log), sphinx+sklearn+xarray (restarted by Beaker after a node cordon, the second job completed), matplotlib+astropy+pylint, requests rerun (the 2 hung instances).
Qwen3-8B: django (stopped after the same hang; 230 instances recovered from the log), sympy+pytest+misc, sphinx+sklearn+xarray, matplotlib+astropy+pylint, django-16667 rerun.
Thinking-mode debug run with SDK response logging: qwen3.5-9b-swebench-debug-think-v4.
Issues
- Image build has no timeout and sits outside
agent_timeout. Three instances (psf__requests-1766,psf__requests-2317,django__django-16667) hung in "Building swerex image" for 6+ hours, which kept two shards open indefinitely. Because per-instance results are only written when the whole run finishes, I had to kill those jobs and recover the finished instances from logs. Inline comment with a suggestion. submitdoesn't end the run. It's a plain tool that returns a string, so Qwen3.5-9B calls it 15–30 times and runs to the turn cap on 466/500 instances. Score is unaffected (the patch is extracted from the worktree anyway) but each instance burns the full 100 turns, ~10 min. Inline comment.- Thinking mode is unusable with Qwen3.5 on the
openai_agentsscaffold. Withenable_thinking=trueand vLLM'sqwen3reasoning parser, every instance ends after one tool call with an empty patch. From the SDK response log: on turn 2 the model emits its<tool_call>inside an unclosed<think>block, the parser returns it as reasoning withtool_calls=[], and the SDK treats that as a final answer. Two scaffold-level causes: vLLM 0.19.1 returns the field asreasoning, which openai-agents 0.20 never reads (it only looks atreasoning_content), and the SDK only replays reasoning across turns for DeepSeek models, so earlier assistant turns render with empty think blocks. Not introduced by this PR, but it means the parity comparison to the thinking-on published numbers can't be made yet. Fix belongs in the shared scaffold (mapreasoningtoreasoning_content, enable reasoning replay for self-hosted servers).
Everything else in the pipeline held up: grading in a fresh container, patch extraction against the worktree snapshot, and per-repo/difficulty metrics all looked correct across 1000 instance runs.
…progress per instance Addresses review on #445: - Image pulls and builds run under a time budget that kills stuck podman processes; an instance that runs out counts as unresolved (image_timeout). - The openai_agents scaffold can end a run when a named tool is called; SWE-bench ends on submit() by default. - Each finished instance is appended to a progress file, and resume_from skips instances an earlier run already finished. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve conflicts with #459 (Terminal-Bench 2.1 parity): - executor: keep main's interrupt_session handling of timed-out session commands, which replaces this branch's equivalent change. - image: keep main's pristine mode and platform detection, and apply this branch's time budget to every subprocess image resolution runs, including the new base-image pull for platform detection. remove_swerex_image and the tag hash account for pristine. - README: keep both the SWE-bench and Terminal-Bench sections. - pyproject/uv.lock: main's dev extras plus swebench; lock regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
@gregorybchris one more thing worth knowing about before this merges, separate from the review above. This is information for you to weigh, not a request for changes: which scaffold SWE-bench should default to is your call. There is a tmax-parity agent in the repo now#459 added the This PR's How the two agent loops compare
My readThe agent loop and the grader are separable, and this PR's grader is the stronger half either way: patch extraction against a pre-agent snapshot, a fresh container, and the pinned upstream Either default is defensible. If it helps, I can do the vanillux wiring on a branch off this PR and run the 3-seed Qwen3.5-9B comparison against 44.0, but that's your decision to make. |
vanillux is the agent Terminal-Bench uses and the one behind tmax's SWE-bench Verified numbers. It gets the bare issue text and a single bash tool, recovers from replies without a tool call, samples at 0.7/0.95/16k, and leaves thinking to the chat template. openai_agents stays available with its SWE-agent-style prompt and 100 turns. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main's docs overhaul removed the per-benchmark README sections, so the SWE-bench Verified docs move to the benchmark's own README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
@pdasigi Thanks, switched the default to |
Description
Adds SWE-bench Verified as an external eval,
swe_bench_verified. An agent fixes each GitHub issue in the instance's prebuilt image, its changes are collected as a patch, and the patch is graded in a fresh container with the upstream harness's test script and log parsers.References
swebenchpackage, pinned toswebench==5.0.2.SWE-bench/SWE-bench_Verified, pinned to revision78f471bf655a3137b2e8a75af1501690ec009ec3.vanilluxscaffold, the port of tmax'sVanillux2Agentthat Terminal-Bench already uses. tmax reports 44.0 ± 2.0 for Qwen3.5-9B with it on Harbor'sswe-bench/swe-bench-verifiedtasks (arXiv 2606.23321, Table 4).How it works
testbedconda environment at/testbed.vanillux(default): the agent gets the issue text as is, the way Harbor's tasks state it. It has onebashtool and 64 steps, and samples at temperature 0.7, top_p 0.95 and 16384 max tokens. Thinking is left to the chat template.scaffold=openai_agents: an SWE-agent-style prompt withexecute_bash_sessionandsubmit(), 100 turns, thinking off and the server's sampling defaults. The run ends when the agent callssubmit().git apply,--3way,--reject,patch --fuzz=5).swebench'sget_eval_report.resolve_rateis the primary metric, with rates by repo and by difficulty.swe_bench_verified_progress.jsonlas it completes, andresume_fromskips instances an earlier run finished.swe_bench_verified_predictions.jsonl.oracle=truegrades the reference patches instead of running a model.ghcr.io/epoch-research/swe-bench.eval.x86_64.<id>), which needs no login. Docker Hub's anonymous pull limit stalls a run after about 100 images.image_source=datasetuses the official Docker Hub images instead.Deviations from the references
django__django-10097: it isn't equivalent to the official image. 7 FAIL_TO_PASS tests fail on it.Changes outside the new module
ExternalEval.extras: an external eval can declare package extras for Beaker jobs. SWE-bench needs the newswebenchextra, added inpyproject.tomlwith itsuv.lockentries.openai_agentsscaffold: adds two opt-in run options, and other evals are unchanged.max_tool_output_charstruncates tool output.stop_at_toolsends the run when a named tool is called, and is part of the agent cache key.get_swerex_image: takes an optionaltimeoutcovering every pull, build and push it runs. When the time is up, it kills the stuck subprocess. The default stays no timeout.remove_swerex_image: deletes a derived image and its base image, so disk use stays flat over a full run.swe_bench/README.md, sincemain's README no longer has per-benchmark sections.Affected results
None. This adds a new eval and changes no existing spec or suite. The
openai_agentsandget_swerex_imagechanges are opt-in, and their defaults keep the current behavior.Type of Change
swebenchextra,swebench==5.0.2)Validation
uv run ruff check src/ tests/anduv run ruff format --check src/ tests/: clean.uv run ty check src/: one warning inexecutor.pythat is also onmain.uv run pytest tests/ --ignore=tests/integration -v: 3710 passed, 35 skipped.tests/evals/external/benchmarks/test_swe_bench_external.py,tests/core/harness/test_sandbox_image_timeout.py,tests/core/harness/test_sandbox_image_cleanup.py,tests/core/harness/test_openai_agents_scaffold.pyandtests/cli/beaker/test_launch.py.Beaker runs. All runs are in workspace
ai2/olmo-instruct. Thevanilluxruns used commit4ca7222a. Commits after it only mergemainand move the docs.01M3ZAKAVHRAW4N2QPBD8M5SHA,01M3ZAKGRRJHXJ1XYJHV803VAA,01M3ZAKPC3XF1HF4HJYBKP1EVA,01M3ZAKVWDX8G0S76JH2MY952001M3WVZT9PZEPFXP7XKJ9ZXDGR,01M3YX1JDTJG14GX1GF0C0ECHM,01M3X2MFV9EA46HY3S2MW5SN1Kopenai_agents01M3X0VW3HK6GPEPBWC0F3GDW3,01M3X1QX7C6T27NDGNHCWC68VZopenai_agents, thinking off, all 500 (@pdasigi)01M4Q36X7G3WT0QGQSKC9KH0KH,01M4Q372ZNSKMD9JJX8QZ6A72C,01M4Q378RS1WZS0R2ARHES4WDJ,01M4Q37FTTF87EZRK5VWXMSVJM,01M4QPHRDFKVD4BFBY2MPX11YCopenai_agents, all 500 (@pdasigi)01M4Q8Y2A160YCDDGF1GPNZBYJ,01M4Q8Y97WF8T112VZM6AA8D6T,01M4Q8YE8H67N60NG01MAAY4Z7,01M4Q8YKYBB6Z00F7FEKB7DYYQ,01M4QPJHRDQZKHDM31FGPER61Kopenai_agents, review fixes, 14 instances01M4SES8PP8RHTYABP8JA7CW3Wvanilluxsmoke test, 14 instances01M50PXZMJ21EQEWF6YRZZ3580vanillux, thinking on, 3 runs × 500The two oracle instances that did not resolve:
django__django-10097: the GHCR image difference noted above.scikit-learn__scikit-learn-14710: its tests ran over the 1800 seval_timeout.vanilluxcomparison runs. Each of the 3 runs used a different vLLM seed (1–3) and was split into 8 shards onai2/holmes. The mean is 51.7 ± 0.7 (mean ± standard error; 52.0, 50.4 and 52.6). That is about 8 points above tmax's 44.0 ± 2.0. The deviations listed above are the likely causes, but they haven't been isolated, so this is not yet a parity check.podman buildorpushstalled.image_timeoutstopped each one at 900 s and the run went on. Those 20 were rerun with their seeds, and the numbers include the reruns.01M50YB40TQSDPAF67AV0EVV6601M50YBH45TNG9VRKQYW23TRP901M50YBTRSCM5VH9ZCBXD78J6Y01M50Z71AEWGQZSN0GHY80Q4K301M50YCF4PQ7DTPVX1TJPFGW6P01M50ZQ4SYJDVTKJFC5T2C0HRS01M50YD6GSG319XR1STGFJQX6201M50ZQER2195ADFQPZ3Q1CHG2, rerun01M51KV7Z2QBQG68RZ4DD19N82.01M50ZQSRR2N94EJEQ6NBXKX6101M50ZR5X1CZBGJX2AXEADGVHX01M50YEGPRX9362BQQRSBT60J601M50YMTX0RYSX5AND7NSZ6Z8Y01M50YN585CVAQJ8YPJ1J8K24Z01M50YNK2R0H2D250166CSMGJR01M50YNWYPS7BN250Y74E69E3501M50YP66RMPGQET7RSZZ99BH0, reruns01M51GAK4S3QPKDXGXPSHJVTXB01M51HY0AM58YWJ0CMGY03NB3R01M51KTGY5WA603GAKJ6JVP41Z.01M50YPK41EFACHFC9B2M1416101M50ZRFBRABE9Y1FD8KPC7Q4X01M50ZS1V5ZXDXCWYNV5617P7801M50YQN3BVHRRN4J95RFMMVCH01M50YRAQHF6MCMFYHAQH8NCW901M50YRMQXWWVSM0DJ5282QQ1C01M50YRYQESGTPPE3AFX3CEXC901M50YSBAD0HVSJFERA5EG5PT1, reruns01M51HY9W0KVFF6B9EKZVYSHRP01M51KTWJQJMHKG4SEBKWQMZ35.Launch command for one shard.
instance_idsheld each shard's interleaved eighth of the dataset:uv run olmo-eval beaker launch -E swe_bench_verified -m Qwen/Qwen3.5-9B -c ai2/holmes \ -w ai2/olmo-instruct -p high -A instance_ids=<shard ids> -A max_concurrency=8 \ -K max_model_len=131072 -K gdn_prefill_backend=triton -K tool_call_parser=qwen3_xml \ -K attention_backend=TRITON_ATTN -K language_model_only=true -K seed=<1|2|3> \ -K startup_timeout=900 -e VLLM_USE_FLASHINFER_SAMPLER=0 \ --no-aws-credentials --no-upload -T 7h45mReview follow-ups (@pdasigi)
image_timeout, default 900 s. It fired on 20 instances in the comparison runs.resume_from. It recovered 4 preempted shards.submitnot ending the run: fixed foropenai_agentsbystop_at_tools.vanilluxends on its submit marker.vanillux. It is still broken onopenai_agents(see remaining work).vanillux, andopenai_agentsremains available.Remaining work
openai_agents: with Qwen3.5, every run still ends after one tool call. This is tracked in openai_agents scaffold: Qwen3.5 thinking mode ends agent runs after one tool call #461, and Keep thinking models' reasoning across agent turns on vLLM #463 is a draft fix.error_rateand trajectories:error_ratedoesn't count grading timeouts or unparsable test logs.openai_agents, trajectories are lost when an instance ends onagent_timeoutor a context overflow.-K attention_backend=TRITON_ATTN -e VLLM_USE_FLASHINFER_SAMPLER=0for any model, because FlashInfer JIT needsnvcc.-K language_model_only=truefor Qwen3.5, whose vision encoder crashes on aquack/cutlassmismatch.-K startup_timeout=900for Qwen3.5, because startup often runs past the default 300 s.get_registry_mirror_urlreturns has been down since April.🤖 Generated with Claude Code