Skip to content

Bound common-line pruning to the local window - #47

Merged
pascalkuthe merged 1 commit into
masterfrom
fix-timeout-window-0.2
Jun 21, 2026
Merged

Bound common-line pruning to the local window#47
pascalkuthe merged 1 commit into
masterfrom
fix-timeout-window-0.2

Conversation

@Byron

@Byron Byron commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

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>
@pascalkuthe
pascalkuthe merged commit f02e46a into master Jun 21, 2026
6 checks passed
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.

2 participants