Skip to content

fix: head-skipping dropping matches in rare circumstances#972

Merged
V0ldek merged 1 commit into
mainfrom
v0ldek/#971-fix-head-skip
May 28, 2026
Merged

fix: head-skipping dropping matches in rare circumstances#972
V0ldek merged 1 commit into
mainfrom
v0ldek/#971-fix-head-skip

Conversation

@V0ldek

@V0ldek V0ldek commented May 28, 2026

Copy link
Copy Markdown
Member

Short description

Head-skipping would incorrectly start from the start of a block if quote classification dropped it at the final structural character. In rare cases where a quote in that block aligned with the start of a match in the next block it would cause the engine to miss matching results.

The fix is to manually check if the block is still valid, i.e. idx != BLOCK_SIZE before continuing memmem.

Issue

Resolves: #971

Checklist

All of these should be ticked off before you submit the PR.

  • I ran just verify locally and it succeeded.
  • Issue was given go ahead and is linked above OR I have included justification for a minor change.
  • Unit tests for my changes are included OR no functionality was changed.

Head-skipping would incorrectly start from the start of a block
if quote classification dropped it at the final structural
character. In rare cases where a quote in that block aligned
with the start of a match in the next block it would cause
the engine to miss matching results.

The fix is to manually check if the block is still valid, i.e.
idx != BLOCK_SIZE before continuing memmem.

Resolves: #971
@V0ldek V0ldek merged commit 7920d1c into main May 28, 2026
130 of 159 checks passed
@V0ldek V0ldek deleted the v0ldek/#971-fix-head-skip branch May 28, 2026 20:50
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.

Invalid query results caused by head-skipping in specific alignment circumstances

1 participant