-
Notifications
You must be signed in to change notification settings - Fork 98
Adding error_handling procedural modifiers to SWE smith #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This is awesome, thank you so much @thomaspdl! Just to confirm, based on the code, it looks like this is a Python specific method? Would you mind providing a Feel free to just plug these points into copilot / cursor / claude code or something, and double check that the descriptions are accurate. If you're interested, would you open to writing a blog post describing this bug gen approach for https://www.swebench.com/blog.html? |
|
thanks for the comments @john-b-yang! Yes, this is a python only method. Would you prefer me to add a separate README.md or edit the already existing one? I will get on the blogpost this week :) |
|
A separate README.md that sits under And woo! Very happy to hear you'd be open to a blog post! Just to give you a sense, here's where the content for posts lives under the SWE-bench website. No rush at all, but when you get around to it, if you could (1) create the post as a markdown file, and include any assets you might want in a subfolder under the same directory, and then (2) make a PR to the SWE-bench website, that'd be awesome. |
|
created the README.md |
|
Awesome stuff @thomaspdl this is fantastic! Just took a look and I think the changes are fantastic, also just tagged @acrmp to sanity check as well. And separate PR for blog post sounds great. Would you mind making the PR to this repository? Tysm in advance! |
acrmp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @thomaspdl, thanks for opening this PR. Excited for these changes!
❓ I had some issues getting these changes to run locally. Where you able to run the new error handling generate included in this PR locally?
❓ Did you consider adding the modifiers and having them available from the existing procedural modification command swesmith.bug_gen.procedural.generate?
Thanks!
| MODIFIERS_ERROR_HANDLING = [ | ||
| TryExceptRemover, | ||
| AssertRemover, | ||
| RaiseRemover, | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these modifiers be instances of the classes rather than as the classes themselves?
I'm seeing an error when attempting to run swesmith.bug_gen.error_handling.generate:
TypeError: ProceduralModifier.can_change() missing 1 required positional argument: 'code_entity'
| # Error handling | ||
| HAS_TRY_EXCEPT = "has_try_except" | ||
| HAS_ASSERT = "has_assert" | ||
| HAS_RAISE = "has_raise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the PR include the changes to set these code properties when the source files are parsed? I couldn't see these. I would expect them to be necessary to ensure that files are not filtered out by the conditions set on the removal modifiers (see swesmith/bug_gen/adapters/python.py).
| (try/except, assert, raise statements). | ||
|
|
||
| Usage: python -m swesmith.bug_gen.error_handling.generate \ | ||
| --repo <repo> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is repo a positional argument rather than a flag? I think this might be an existing error copied over from the procedural generate.
| @@ -0,0 +1,54 @@ | |||
| """ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: the filename of this remover doesn't have the _removal.py suffix that assert_removal.py and raise_removal.py are using.
| ### Basic Usage | ||
| ```bash | ||
| # Generate bugs for a repository | ||
| python -m swesmith.bug_gen.error_handling.generate "instagram__monkeytype.70c3acf6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the case correct here for the included repo profile? Should this beInstagram__MonkeyType.70c3acf6?
Overview
Adds Error Handling Corruption, a new procedural bug generation methodology that removes exception handling mechanisms to expose code to unhandled errors.
Changes
Files
swesmith/bug_gen/error_handling/(7 files)CodeProperty.HAS_TRY_EXCEPT,HAS_ASSERT,HAS_RAISEUsage