Skip to content

Conversation

@danielzayas
Copy link

Background

SWE-smith/swesmith/bug_gen/mirror/generate.py does not apply diff if file contains more than 1000 lines.

For #177, SWE-smith/swesmith/bug_gen/mirror/generate.py couldn’t apply the original diff directly because one file is several thousand lines long. The mirroring flow only attempts a direct git apply if every edited file satisfies the heuristics inside should_attempt_recovery, including "No changed file is >1000 lines". Falling back to the “recovery” path was faulty because the LLM-produced revert missed logic.

Proposed Change

Increase max file size for diff apply.

Test Plan

Fix for #177 was to raise that limit to 10 000 lines and re-run the pipeline, the generator was allowed to reuse the actual PR diff and the mirrored bug patch became bit-for-bit identical to the upstream fix.

This PR contributes that fix back to the upstream project.

@danielzayas danielzayas marked this pull request as ready for review November 29, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant