Summary
At SWE-smith commit 9b74ac08118a85c39c356802f7961893af73e07f, the official gold evaluation reports the following instance as unresolved:
r1chardj0n3s__parse.30da9e4f.func_basic__j0z3z0co
The reversed bug patch is applied successfully to parse.py, but the evaluator then restores parse.py because it also appears in PASS_TO_PASS. This discards the gold repair before pytest runs.
This looks like an incompatibility between this task and the test-file anti-cheating restore policy. I am not assuming that test restoration should simply be disabled.
Minimal reproduction
From a checkout of 9b74ac08118a85c39c356802f7961893af73e07f with Docker available:
python -m swesmith.harness.eval \
-p gold \
--run_id repro_gold_parse \
-w 1 \
-i r1chardj0n3s__parse.30da9e4f.func_basic__j0z3z0co
Observed summary:
Using gold predictions for eval (ignoring `predictions_path` argument)
Resolved 0/1 instances.
The per-instance log contains:
Applied patch parse.py cleanly.
Reverted changes to test files in container: tests/test_parse.py README.rst parse.py tests/test_bugs.py tests/test_findall.py tests/test_parse.py tests/test_parsetype.py tests/test_pattern.py tests/test_result.py tests/test_search.py
The test result then includes:
FAILED tests/test_parse.py::test_parser_format - AttributeError: 'int' object...
=================== 1 failed, 97 passed, 1 skipped ====================
Expected: the gold evaluation resolves the instance (1/1).
Actual: the gold evaluation leaves it unresolved (0/1).
Diagnostic
PythonProfile.get_test_files() maps both FAIL_TO_PASS and PASS_TO_PASS identifiers to file paths. For this instance it returns:
FAIL_TO_PASS files:
['tests/test_parse.py']
PASS_TO_PASS files:
['README.rst', 'parse.py', 'tests/test_bugs.py', 'tests/test_findall.py',
'tests/test_parse.py', 'tests/test_parsetype.py', 'tests/test_pattern.py',
'tests/test_result.py', 'tests/test_search.py']
The instance's bug patch modifies parse.py. In the gold path:
eval.py uses the dataset patch as the gold prediction.
_apply_patch(..., is_gold=True) reverses that patch, repairing parse.py.
run_patch_in_container() calls get_test_files(instance).
git checkout -- ... parse.py ... restores the buggy version of parse.py.
- Pytest therefore evaluates the task after the repair has been undone.
A manual check inside the task image confirms that the target test fails at the bug stage and passes immediately after reversing the bug patch, before the test-file restore.
Relevant code:
swesmith/profiles/python.py: PythonProfile.get_test_files()
swesmith/harness/utils.py: the git checkout -- {test_files} block after patch application
Question
What is the intended handling for instances where a bug patch touches a file that is also identified as an F2P/P2P test file (for example, a production module containing doctests)?
Possible directions seem to be:
- reject/filter these instances during task generation or validation; or
- refine the restore behavior so it preserves the submitted/gold source change without exposing hidden tests.
I can provide the complete per-instance log or test a proposed fix if useful.
Summary
At SWE-smith commit
9b74ac08118a85c39c356802f7961893af73e07f, the official gold evaluation reports the following instance as unresolved:r1chardj0n3s__parse.30da9e4f.func_basic__j0z3z0coThe reversed bug patch is applied successfully to
parse.py, but the evaluator then restoresparse.pybecause it also appears inPASS_TO_PASS. This discards the gold repair before pytest runs.This looks like an incompatibility between this task and the test-file anti-cheating restore policy. I am not assuming that test restoration should simply be disabled.
Minimal reproduction
From a checkout of
9b74ac08118a85c39c356802f7961893af73e07fwith Docker available:Observed summary:
The per-instance log contains:
The test result then includes:
Expected: the gold evaluation resolves the instance (
1/1).Actual: the gold evaluation leaves it unresolved (
0/1).Diagnostic
PythonProfile.get_test_files()maps bothFAIL_TO_PASSandPASS_TO_PASSidentifiers to file paths. For this instance it returns:The instance's bug patch modifies
parse.py. In the gold path:eval.pyuses the datasetpatchas the gold prediction._apply_patch(..., is_gold=True)reverses that patch, repairingparse.py.run_patch_in_container()callsget_test_files(instance).git checkout -- ... parse.py ...restores the buggy version ofparse.py.A manual check inside the task image confirms that the target test fails at the bug stage and passes immediately after reversing the bug patch, before the test-file restore.
Relevant code:
swesmith/profiles/python.py:PythonProfile.get_test_files()swesmith/harness/utils.py: thegit checkout -- {test_files}block after patch applicationQuestion
What is the intended handling for instances where a bug patch touches a file that is also identified as an F2P/P2P test file (for example, a production module containing doctests)?
Possible directions seem to be:
I can provide the complete per-instance log or test a proposed fix if useful.