Skip to content

Avoid tiny segment counts right after the segment length doubles - #78

Merged
lemire merged 1 commit into
masterfrom
fix-issue-77-small-segment-count
Sep 21, 2026
Merged

lemire merged 1 commit into
masterfrom
fix-issue-77-small-segment-count

Conversation

@lemire

@lemire lemire commented Sep 21, 2026

Copy link
Copy Markdown
Member

Bug fix for #77 reported by @manishrjain

#77)

Just after binary_fuse_calculate_segment_length doubles the segment length,
the filter could end up with very few segments (e.g. 12 segments of 1024 for
11.5k keys). Such a graph is close to a plain 3-wise XOR graph and the load
was too near the peeling threshold: binary_fuse*_populate failed for 20-40%
of random key sets around size 11,500 and ~3% around 12,350, with smaller
but non-negligible failure rates after every doubling below ~40k keys.

Halve the segment length until there are at least 32 segments (keeping
segments >= 256). This only changes layouts for roughly 3.4k..58k keys,
uses slightly less memory, and leaves construction and query speed
unchanged. Add a regression test at the affected sizes.
@lemire
lemire merged commit c5e1b13 into master Sep 21, 2026
12 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.

1 participant