Commit 9c59351
committed
fix(bench): drop --3way fallback + post-verify in apply_as_commit
Diagnostic on the 1500-instance ceiling probe: 53% of swebench_verified
instances reported file_recall=0.0 with mean recall 0.45 even at
budget=10M. Investigating one (astropy__astropy-13033) showed the
git diff after apply_as_commit committed files COMPLETELY UNRELATED
to the gold patch -- e.g. CHANGES.rst, docs/changes/* instead of the
declared astropy/timeseries/core.py. 5/5 sampled zero-recall instances
have the same pattern with totally different committed content.
Root cause:
1. ensure_repo's `git checkout --force base_commit` silently fails on
shallow / incomplete bare clones -- HEAD stays at some main-branch
commit, returncode=0 misleads the caller.
2. apply_as_commit then runs `git apply --index` which fails strictly
on a wrong-base worktree (returncode != 0).
3. Falls through to `git apply --index --3way` which uses fuzzy
matching and silently applies the patch on whatever state HEAD
happens to be at.
4. Commit creates a HEAD~1..HEAD diff that is the patch reapplied
on top of arbitrary main-branch content -- typically committing
completely unrelated files.
5. Pipeline analyzes that diff and reports recall against gold_files
that were never the patch's target.
This invalidates downstream metrics for those instances. Headline
0.875 from old paper runs likely predates the regression that broke
the silent-checkout edge case (or used a different cache state); the
ceiling probe at budget=10M reporting 0.42 is a measurement artefact
on instances corrupted by this bug.
Fix:
- Remove --3way fallback. `git apply --index` strict mode is the only
path; failures return False and the instance is flagged.
- Post-apply verify: `git diff --name-only HEAD~1..HEAD` must match
the patch's declared target files (extracted from --- a/ / +++ b/
headers). Mismatch -> return False with APPLY VERIFY FAIL log.
ensure_repo's silent-checkout problem still exists upstream; that fix
needs `git rev-parse HEAD` verification + targeted fetch when
base_commit is missing. Tracked for follow-up. The current change
catches the symptom so no benchmark number is silently wrong.1 parent 02ffbe5 commit 9c59351
1 file changed
Lines changed: 61 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
215 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
216 | 248 | | |
217 | 249 | | |
218 | 250 | | |
219 | 251 | | |
220 | 252 | | |
221 | 253 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
227 | 283 | | |
228 | 284 | | |
229 | 285 | | |
| |||
0 commit comments