Repository navigation
fix(diff): keep finished boxes when the myers budget runs out - #56
Merged
Merged
Conversation
When the budgeted search over the whole input ran out of work, solve cleared every mark before splitting the boxes it had left. The boxes it had already finished were marked for good and never searched again, so their changes were lost: the two sides ended up with different counts of unchanged items, and changes() emitted misaligned ranges, some past the end of the old side. diff_texts then underflowed computing the trailing gap. Search::run only marks boxes it finishes, and the boxes it leaves are unmarked and disjoint from them, so the clear was never needed. Drop it, as Anchors::run already does for the regions it re-searches.
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.
Large, heavily edited files could get corrupt line diffs, with hunks past the end of the file (a panic in debug builds), because when the budgeted Myers search ran out of work it cleared the changes it had already found and never searched those parts again. It now keeps what it finished and splits only the parts it left.