Hi everyone! Apologies for the delay in dataset pr...
# proj-codescout
b
Hi everyone! Apologies for the delay in dataset processing but it turns out that LocAgent code was missing quite a few number of edge cases which would potentially corrupt the ground truth data. After fixing many of those, I have pushed the datasets to HuggingFace (SWE-Bench Lite, SWE-Bench Verified, SWE-Smith, SWE-Gym, and SWE-rebench) and here is the patched data processing code. Also I have analyzed all the datasets for multiple attributes (like # of functions edited/added, # of PRs with non-python files, # file edits, and many more corner cases) in this spreadsheet (key takeaway is that SWE-smith is closest to SWE-Bench). I hope this analysis is helpful! We need a better finish tool/prompt format where function name/class name is optional. The LocAgent prompt forces the model to always predict a function name with each file and an optional class name (if the fn belongs to a class). This is not ideal for the following frequent scenarios: 1. If the PR edited a class by adding a new function or just modifying its attributes, it will be present in ground truth but the model's prediction doesn't allow a filename and a class name alone. (such cases occur in 12% of test data (swe-bench) and 25% of SWE-Gym as shown in the sheet) 2. If the PR only changed global-level variables/imports and/or only added a new class/new global function they will only be detected at a file-level in ground truth but the agent has no way to predict a filename alone (such cases occur in 12% of test data, 16% of SWE-Gym, 30% of SWE-rebench).
🙌 1
[In case you are interested in what was fixed in LocAgent and what corner cases remain] Key design choices/data processing code behaviour: 1. We discard all PRs that add or remove files. This is rare in SWE-{Smith, Bench, Gym} (<1% of cases), but quite frequent for SWE-rebench (15% of cases). Our agent cannot predict files that were added by a PR and determining relevant classes and functions is not straightforward for deleted files (by default the code previously detected all functions and classes as relevant) 2. Do not include non-python files in ground truth (our agent is designed to only localize .py files) 3. If PR adds a new function to a class or edits/adds attributes, these changes are detected in ground truth at module and file-level but not at entity-level (previous code used to ignore these changes completely). Function-level docstrings were detected as edits previously --> ignored now. Changes to global variables and imports will only be detected at file-level (as expected). 4. SWE-smith has 11K instances with empty issue description -- these are discarded. Corner cases which we still cannot handle (all these are mostly very rare except for 1): 1. We ignore non-py files from ground truth but it is possible that these are relevant for fixing the issue (for e.g. fixing a .j2 prompt template). (25% of PRs in SWE-Gym and 43% in SWE-rebench edit a non-python file). Should we discard these instances from our dataset? 2. If the ast parser raises an error when reading a file (due to some non-printable characters, syntax errors. etc.), we will discard the instance (rare) 3. If the patch does not apply due to line endings issue (\r\n vs \n) we discard the instance (very rare) 4. There is no way we can detect code refactoring (rearrangement of imports, renaming functions/classes, etc.).
b
Working on a better finish tool with appropriate (and optional) parameters. https://github.com/OpenHands/agentic-code-search-oss/pull/55 Will do some final tweaks and move it out of draft state. I can do some runs today to see if it helps with training.
b
Thanks I will check this out! But instead of training runs, can you first experiment with evals and see if it works fine? It will much faster to iterate with your implementation that ways. Though this is just a suggestion -- if you can make it work with training, it is even better