Add SWE-bench agent runner - #31
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on the SWE-bench Verified adapter from #30. Adds runner support for real agent attempts on SWE-bench tasks plus conversion of official harness reports back into CodeBench metrics. This still does not include final large-scale SWE-bench experiment results — it is the attempt/evaluation infrastructure for producing them.
What's included
src/codebench/swebench_runner.py) + CLI (scripts/run_swebench_agent.py):load_agent_safe_tasks()is the single choke point that dropshidden_reference(goldpatch,test_patch,FAIL_TO_PASS,PASS_TO_PASS) at parse time; prompts, logs, and attempt records never contain gold data (enforced by a poisoned-sentinel test).base_commit— cached clone per repo underworkspaces/repos/, isolated detached git worktree per attempt.--agent-cmdshell template ({prompt_file}/{workdir}/{instance_id}/{repo}placeholders), with a built-innoopmode for dry runs; per-attempt timeout,--resume, and--attempts Nfor independent rollouts.git diffasmodel_patch—git add -A+ diff against the explicit base commit (robust to agent-created commits; includes new files). Failed/timed-out attempts are recorded with empty patches so they still count as rollouts.instance_id,model_name_or_path,model_patch), reusingwrite_predictions_jsonl()from Add SWE-bench Verified adapter #30.src/codebench/swebench_results.py) + CLI (scripts/convert_swebench_report.py):tests_statusbecomes anExecutionResult(F2P+P2P totals, P2P failures asregression_count, resolved asexecution_success); errored/empty-patch instances become zero-score rollouts.reliability_at_k()consumes — real rollouts replacing synthetic ones in the H-experiment pipeline, with no public API changes.docs/swebench_experiment.md): updated end-to-end workflow (sample → attempts → harness → reliability@k).pyproject.toml: optionaleval = ["swebench>=2.1"]extra; no new hard dependencies.Testing
🤖 Generated with Claude Code