Repository navigation
fix(swebench): grade staged and committed fixes, not just unstaged changes - #4775
Merged
linj-glitch merged 2 commits intoOct 27, 2026
Merged
Conversation
…anges
The verify step extracted the model patch with 'git --no-pager diff', which
shows only unstaged changes to tracked files. An agent that staged ('git add')
or committed its fix scored 0 with an empty patch. On SWE-bench Verified with
the Claude Code harness this hit 14% of rollouts in two independent arms
(353 committed + 65 staged of 3030 rollouts in one, 126 + 56 of 1325 in the
other), each worth roughly 4-5 points of absolute resolve rate.
Record HEAD once the session sandbox is ready (after the optional anti-cheating
step, which rewrites refs but not the tree) and at verify time run 'git add -u'
followed by 'git diff --cached <seed HEAD>', so staged and committed changes to
tracked files are graded. Untracked files stay out on purpose: 'git add -A'
swept a generated Sphinx _build tree (1.1 MB of jquery) into a patch in the
first smoke. Binary-file sections are dropped, since 'git apply' cannot take
them without binary data.
Validated with real rollouts (two 15-rollout smokes on SWE-bench Verified with
Nemotron 3 Nano + Claude Code): every rollout that committed now carries a
non-empty patch; largest patch 10.5k chars.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Lin Jia <[email protected]>
linj-glitch
force-pushed
the
linj/swebench-patch-extraction
branch
from
October 21, 2026 08:02
5673b63 to
bb3affa
Compare
This was referenced Oct 22, 2026
Contributor
|
/ok to test bb3affa |
Contributor
|
/review |
Signed-off-by: Lin Jia <[email protected]>
Collaborator
Author
|
/ok to test 7c3ecc5 |
cmunley1
approved these changes
Oct 26, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40421443791 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40423743663 |
5 tasks
bxyu-nvidia
added a commit
that referenced
this pull request
Nov 4, 2026
- #3302: Reservation writes deferred until reporting/shutdown; in-memory tracking remains. - #4775: Restored unstaged-only git diff and removed the seed-commit lookup. Signed-off-by: Brian Yu <[email protected]>
This branch was previously deployed
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.
What
The
swebenchresources server's verify step extracted the model patch withgit --no-pager diff, which only shows unstaged changes to tracked files. An agent that staged (git add) or committed its fix scored 0 with an empty patch.This PR records HEAD once the session sandbox is ready (after the optional anti-cheating step, which rewrites refs but not the working tree) and, at verify time, runs
git add -ufollowed bygit diff --cached <seed HEAD>, so staged and committed changes to tracked files are graded. Binary-file sections are dropped (git applycannot take them without binary data). Untracked files are deliberately left out:git add -Aswept a generated Sphinx_buildtree (1.1 MB of jquery) into a patch in the first smoke.Why
Measured on SWE-bench Verified with the Claude Code CLI harness driving Nemotron 3 Nano through Switchyard (two independent arms):
About 14% of rollouts in each arm lost their patch this way, roughly 4-5 points of absolute resolve rate per arm. The same behaviour (agents committing their work) is common to every CLI harness, so this affects all SWE-bench arms graded by this server.
Validation
patch_extraction_command,strip_binary_diffs) inresources_servers/swebench/tests/test_app.py.git add -Atogit add -u.Scores from runs before this change are not comparable with runs after it.
Current-head validation — October 24, 2026
Merged main
f36e126547866601bee9c0671c9b59484ef83723additively into this branch, preserving the feature and including the shared Terminus shell-recovery fix (#4966) and MiniSWE test-isolation fix (#4735). No feature-specific conflict resolution was needed.Validated
7c3ecc5f2b24910c7371aa5c89b1c73e65ae3201on Python 3.13.14 with imports confirmed to resolve to this checkout:python -m pytest -o addopts= --import-mode=importlib -q resources_servers/swebench/tests/test_app.py: 16 passed.pre-commit run --all-files: passed on the final head.git diff --check: passed.The rollout results above are historical; this main-compatibility refresh did not run new model rollouts. Current-head CI and repository-required approval remain merge gates.