Repository navigation
Bound minimal Myers input in the unified diff fuzz target - #3094
Merged
Merged
Conversation
<!-- agent --> The reported `unified_diff_printer` ClusterFuzz timeout decodes to 68,956 before tokens and 3,832 after tokens. Replaying it in the integration test spends 29.77 seconds computing `MyersMinimal`, before postprocessing or unified diff printing. Histogram and ordinary Myers finish in under 40 milliseconds each. Minimal Myers deliberately disables early-abort heuristics. Git's `xdiff/xdiffi.c` at `6de20f6092` likewise continues its search when `need_min` is set, and `gix-imara-diff` documents this potentially expensive behavior. Preserve that contract and apply the existing `comprehensive_diff` fuzz policy here: retain complete inputs for Histogram and Myers, then truncate each token sequence to 512 for minimal Myers. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Sebastian Thiel (Byron)
force-pushed
the
uni-diff-printer-fuzz-fix
branch
from
October 23, 2026 04:33
a4cd717 to
ccd1541
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
October 23, 2026 19:25
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by
Codex.Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
The supplied ClusterFuzz testcase spends 29.77 seconds in
MyersMinimalbefore unified diff printing starts. This fuzz target now uses the existingcomprehensive_diffpolicy: Histogram and Myers process the complete input, while minimal Myers processes at most 512 tokens per side. The regression completes in about 70 ms in debug mode, and the AddressSanitizer fuzz harness executes the original file in 48 ms.The library's minimal-diff contract is preserved. Git's
xdiff/xdiffi.cat reference checkout commit6de20f6092also disables early-abort heuristics for minimal searches. The added fixture and integration test cover decoding, all three algorithms, postprocessing, printing, valid line prefixes, and a three-second budget.Reported issue
Here is a reproducer for a timeout to fix '/Users/byron/Downloads/clusterfuzz-testcase-minimized-gix-imara-diff-unified_diff_printer-5862399987744768'
Validation
GIX_TEST_IGNORE_ARCHIVES=1 cargo test -p gix-imara-diffcargo clippy -p gix-imara-diff --all-targets --all-features -- -D warningscargo fmt --all -- --checkcargo +nightly fuzz run --fuzz-dir gix-imara-diff/fuzz unified_diff_printer <reproducer> -- -runs=1 -timeout=3(AddressSanitizer)