Skip to content

Make the agent-in-loop verify oracle work with swebench 5.x - #231

Merged
t-timms merged 3 commits into
mainfrom
fix/verify-patch-swebench5
Sep 24, 2026
Merged

t-timms merged 3 commits into
mainfrom
fix/verify-patch-swebench5

Conversation

@t-timms

@t-timms t-timms commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Why

experiments/swebench_lite/verify_patch.py (the oracle behind swebench_verify_patch, used by --agent-in-loop and scripts/validate_driver.py) failed on a fresh Linux box with swebench 5.0.2. Four independent failures, each reproduced:

Failure Evidence Fix
Interpreter hard-coded to /home/swebench_venv/bin/python3 ls /home/swebench_venv -> No such file $GODSPEED_SWEBENCH_PYTHON, else the legacy venv if it exists (WSL-from-Windows unchanged), else the current interpreter
Always passes --cache_level instance swebench 5.0.2: error: unrecognized arguments: --cache_level instance Pass it only if run_evaluation --help lists it (probed once per interpreter)
One-row dataset built only from benchmarks/swebench_lite_test.jsonl, which is not in the repo file absent; code then wrote an empty dataset, so every verify was "harness failed" Look in that file if present, else in the HuggingFace SWE-bench Lite splits (requested split first). Stale empty dataset files are regenerated; an unknown instance returns a clear message and does not invoke the harness
Dataset name princeton-nlp/SWE-bench_Lite lacks the columns swebench 5.x reads real harness run: KeyError: 'image' in make_test_spec; SWE-bench/SWE-bench_Lite has image, eval_script, log_parser LITE_DATASET = "SWE-bench/SWE-bench_Lite"

verify_patch() gains split="dev" (default unchanged) and SWEBenchVerifyTool passes its own split.

Verification

  • New tests/test_swebench_verify_patch.py: interpreter selection, command composition with/without the flag, help probing, dataset lookup (local, HF, missing), and verify_patch() end to end with the harness subprocess and datasets faked. 29 passed together with the existing test_swebench_verify_tool.py.
  • ruff check . and ruff format --check . (CI flags): clean.
  • Real harness (swebench 5.0.2, Docker, gold patches, SWE-bench/SWE-bench_Lite dev): 8 instances submitted, 8 completed, 0 errors; 6 resolved, 2 unresolved (see below).

Related finding (not fixed here)

Two of those 8 dev instances cannot be resolved even by the gold patch in the currently published images, so they are invalid tasks today:

  • pvlib__pvlib-python-1606: AttributeError: np.Inf was removed in the NumPy 2.0 release while importing pvlib (image has NumPy 2.x). This instance is in scripts/validate_driver.py's default smoke set (DEFAULT_SMOKE_INSTANCES), so that smoke run cannot pass on it.
  • pyvista__pyvista-4315: ImportError: libGL.so.1: cannot open shared object file.

Anyone benchmarking should gold-check an instance set first.

Not verified

  • The full agent-in-loop path with a real model is being measured separately in a local eval run.

experiments/swebench_lite/verify_patch.py failed on a fresh Linux box with
swebench 5.0.2 installed, in three independent ways (each reproduced):

- It ran the harness with the hard-coded interpreter
  /home/swebench_venv/bin/python3, which does not exist. Now the interpreter is
  $GODSPEED_SWEBENCH_PYTHON if set, else the legacy venv when it exists (WSL
  from Windows keeps working unchanged), else the current interpreter.
- It always passed `--cache_level instance`; swebench 5.x removed that flag, so
  argparse exits with "unrecognized arguments". The flag is now only passed
  when `run_evaluation --help` lists it (probed once per interpreter).
- The one-row dataset came only from benchmarks/swebench_lite_test.jsonl, which
  is not in the repo, so an empty dataset was written and every verification
  reported "harness failed". The row is now looked up in that file if present,
  otherwise in the HuggingFace SWE-bench Lite splits (requested split first).
  A stale empty dataset file is regenerated, and an instance that is found
  nowhere returns a clear message instead of invoking the harness.

verify_patch() gains a `split` argument (default "dev", unchanged), and
SWEBenchVerifyTool passes its own split through.

Tests: tests/test_swebench_verify_patch.py (harness and datasets faked).
@github-actions

Copy link
Copy Markdown

🤖 Godspeed Review

LLM review skipped (no API key configured).

Security

No secrets detected in changed files.

…e field

Running the real harness (gold patches, swebench 5.0.2) with
princeton-nlp/SWE-bench_Lite fails in make_test_spec with KeyError: 'image'.
That older snapshot lacks the image, eval_script, log_parser, eval_type and
difficulty columns that swebench 5.x reads; SWE-bench/SWE-bench_Lite has them.
verify_patch built its one-row dataset from the old name, so it would have hit
the same error. LITE_DATASET now points at SWE-bench/SWE-bench_Lite.
@github-actions

Copy link
Copy Markdown

🤖 Godspeed Review

LLM review skipped (no API key configured).

Security

No secrets detected in changed files.

@github-actions

Copy link
Copy Markdown

🤖 Godspeed Review

LLM review skipped (no API key configured).

Security

No secrets detected in changed files.

@t-timms
t-timms merged commit f57eb96 into main Sep 24, 2026
9 checks passed
@t-timms
t-timms deleted the fix/verify-patch-swebench5 branch September 24, 2026 20:07
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.

1 participant