Skip to content

Fix LMS ptr race condition and prefetch underflow in kiss sorter - #9

Open
pudding0803 wants to merge 1 commit into
mainfrom
fix/kiss-sorter-bugs
Open

Fix LMS ptr race condition and prefetch underflow in kiss sorter#9
pudding0803 wants to merge 1 commit into
mainfrom
fix/kiss-sorter-bugs

Conversation

@pudding0803

Copy link
Copy Markdown
Collaborator

Fixes #8

get_lms() advanced SA's write pointer for every suffix instead of only LMS positions, letting parallel threads overwrite each other's ranges. induced_L_block_update/prepare could underflow their loop bounds when state.m or state.len was smaller than the prefetch distance. Also add a guard in FMIndex::get_offsets/fmtree to skip already-sampled offsets before calling lf, avoiding redundant/incorrect recomputation.

get_lms() advanced SA's write pointer for every suffix instead of only
LMS positions, letting parallel threads overwrite each other's ranges.
induced_L_block_update/prepare could underflow their loop bounds when
state.m or state.len was smaller than the prefetch distance. Also add
a guard in FMIndex::get_offsets/fmtree to skip already-sampled offsets
before calling lf, avoiding redundant/incorrect recomputation.
@pudding0803 pudding0803 self-assigned this Aug 7, 2026
@pudding0803
pudding0803 requested a review from joyeli August 7, 2026 16:01
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.

Non-deterministic failures in FMIndex when using KISS1Sorter/KISS2Sorter

1 participant