Coding and Software-Engineering Agents › Repository-level evaluation: SWE-bench and friends
Language AI HandbookAll chapters If this chapter has a canonical benchmark, it is SWE-bench. It deserves a paragraph both because it defines how the field measures repository-level agents and because how it is constructed illustrates every pitfall we are about to defend against.
SWE-bench pairs real GitHub issues with their resolving pull requests from Python repositories. The system gets the issue and a pre-fix checkout and proposes a patch. The benchmark checks designated fail-to-pass and pass-to-pass tests. These test lists define the scoring rule; a passing result does not assert that the repository’s entire suite or every behavior was checked.
SWE-bench separates a pull request's test changes from the reference solution. During task validation, the builders apply the test patch to the pre-PR checkout and run the tests before and after applying the solution. Tests that move from failing to passing form the F2P list. Tests that pass in both runs form the P2P list. The agent sees the issue and the pre-PR checkout, which can contain earlier versions of the edited tests. The benchmark applies the PR test patch when it grades the agent's proposed changes.
SWE-bench Verified began as a human-screened 500-instance subset. The screening considered whether the issue description provided enough information and whether the tests reasonably assessed the fix. Compare results only with the named dataset revision, subset, test and tool visibility, retry policy, and resource budget.
RepoBench evaluates repository-level retrieval and code completion. Those tasks differ from submitting a repository patch against an issue and checking the result with tests. For any comparison, report what the system could see and which evidence decided success.
We will build our worked example in the spirit of SWE-bench, at a scale that fits in a chapter: a toy repository, a target test that fails, a few held-out behavioral checks the agent cannot see, and a constraint that the agent may only edit non-test source files. The goal is not to reproduce a benchmark score but to make every piece of the pipeline legible.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!