|
| 1 | +# PatchGym Benchmark Page |
| 2 | + |
| 3 | +PatchGym answers one narrow question: |
| 4 | + |
| 5 | +```text |
| 6 | +Can a coding agent fix tasks mined from this repository's own Git history, |
| 7 | +under this repository's tests and constraints? |
| 8 | +``` |
| 9 | + |
| 10 | +It is not a hosted leaderboard and it does not claim broad model superiority. |
| 11 | +It is a local benchmark harness for maintainers who want repeatable evidence |
| 12 | +before trusting agents on their own code. |
| 13 | + |
| 14 | +## What It Measures |
| 15 | + |
| 16 | +PatchGym measures whether an agent can edit a base repository snapshot so that |
| 17 | +hidden tests and the repository validation command pass. |
| 18 | + |
| 19 | +For every mined task, the benchmark invariant is: |
| 20 | + |
| 21 | +```text |
| 22 | +base commit + hidden tests fails |
| 23 | +base commit + hidden tests + oracle patch passes |
| 24 | +``` |
| 25 | + |
| 26 | +Only tasks that satisfy that invariant are useful. The invariant keeps the |
| 27 | +benchmark grounded: the base must fail, the known historical fix must pass, and |
| 28 | +the agent must produce a patch that survives the same hidden test boundary. |
| 29 | + |
| 30 | +## What A Run Produces |
| 31 | + |
| 32 | +A run produces local artifacts that can be inspected without a hosted service: |
| 33 | + |
| 34 | +- task metadata; |
| 35 | +- hidden test patch; |
| 36 | +- oracle solution patch; |
| 37 | +- agent patch; |
| 38 | +- validation command result; |
| 39 | +- stdout and stderr captures; |
| 40 | +- JSON, Markdown, and HTML reports. |
| 41 | + |
| 42 | +## Comparison Table |
| 43 | + |
| 44 | +| Tool Type | Primary Job | Shared Public Score | Local Repo History | Hidden-Test Task Generation | Agent Execution | |
| 45 | +|---|---|---:|---:|---:|---:| |
| 46 | +| SWE-bench-style benchmarks | Compare agents on a shared public task set | Yes | No | Curated externally | Usually external harness | |
| 47 | +| Repo-to-prompt tools | Package repository context for a model | No | Yes | No | No | |
| 48 | +| Coding agents | Edit code in a workspace | No | Yes | No | Yes | |
| 49 | +| Plain test runners | Check a current codebase | No | Yes | No | No | |
| 50 | +| PatchGym | Build and run local coding-agent benchmark tasks | No | Yes | Yes | Yes | |
| 51 | + |
| 52 | +PatchGym is intentionally smaller than public benchmark infrastructure. Its |
| 53 | +value is that it lets a maintainer evaluate agents against their own repository |
| 54 | +history with ordinary Git patches and local tests. |
| 55 | + |
| 56 | +## Reproducible Demo |
| 57 | + |
| 58 | +From a clean checkout: |
| 59 | + |
| 60 | +```bash |
| 61 | +python3 -m venv .venv |
| 62 | +source .venv/bin/activate |
| 63 | +python -m pip install --upgrade pip |
| 64 | +python -m pip install -e ".[dev]" |
| 65 | +bash scripts/demo.sh |
| 66 | +``` |
| 67 | + |
| 68 | +Expected shape: |
| 69 | + |
| 70 | +```text |
| 71 | +mined 1 task(s) |
| 72 | +built 1/1 valid task(s) |
| 73 | +agent 'bash .../examples/custom_agent/agent.sh' solved 1/1 task(s) |
| 74 | +PatchGym demo complete |
| 75 | +``` |
| 76 | + |
| 77 | +## Honest Boundaries |
| 78 | + |
| 79 | +PatchGym does not provide strong sandboxing by default. Agent commands, |
| 80 | +validation commands, tests, and Git operations execute locally. For untrusted |
| 81 | +repositories or untrusted agents, run it inside a disposable container, VM, or |
| 82 | +separate machine. |
| 83 | + |
| 84 | +PatchGym also does not claim package-registry publication, production adoption, |
| 85 | +hosted results, model rankings, or public leaderboard status. |
0 commit comments