Skip to content

Bound common-line pruning to the local window#47

Open
Byron wants to merge 1 commit into
masterfrom
fix-timeout-window-0.2
Open

Bound common-line pruning to the local window#47
Byron wants to merge 1 commit into
masterfrom
fix-timeout-window-0.2

Conversation

@Byron
Copy link
Copy Markdown
Collaborator

@Byron Byron commented Mar 23, 2026

This is the v0.2 version of this v0.1 PR: #46. It's exactly the same.
Let's use one of these for communication.

Whlie I tested the performance of the v0.1 fix branch, I didn't do the same here.


Fix should_prune_common_line() so the backward scan starts at pos.saturating_sub(WINDOW_SIZE) instead of the absolute WINDOW_SIZE index.

The old bound made the scanned range grow with pos, which turned the preprocessing heuristic into an increasingly expensive rescan on highly repetitive inputs and caused the gix-merge clusterfuzz testcase to time out.

Add a regression test that proves distant context outside the local window does not affect the pruning decision.

#46

Fix should_prune_common_line() so the backward scan starts at
pos.saturating_sub(WINDOW_SIZE) instead of the absolute WINDOW_SIZE
index.

The old bound made the scanned range grow with pos, which turned the
preprocessing heuristic into an increasingly expensive rescan on highly
repetitive inputs and caused the gix-merge clusterfuzz testcase to time
out.

Add a regression test that proves distant context outside the local
window does not affect the pruning decision.

Co-authored-by: GPT 5.4 <codex@openai.com>
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