Skip to content

fix: exclude empty ranges from proptest_range_boundaries - #391

Merged
Kerollmops merged 1 commit into
RoaringBitmap:mainfrom
Dr-Emann:push-krzvrmkyvuqr
Oct 26, 2026
Merged

Kerollmops merged 1 commit into
RoaringBitmap:mainfrom
Dr-Emann:push-krzvrmkyvuqr

Conversation

@Dr-Emann

Copy link
Copy Markdown
Member

With len = 0, the negative contains_range checks build empty ranges (e.g. 0..0 or 2..2). contains_range always returns true for an empty range, so those assertions can never pass. Require len >= 1 in both the RoaringBitmap and RoaringTreemap versions.

Fixes the issue we happened to run into by chance in #388, we just got unlucky: the proptest regression file output (cc 0822d47f23d48cb6b9c3bb1eb8cc603f294c7c416dbb9363b1221fe0c1cc499a) reproduces on main, until this PR is merged.

With len = 0, the negative contains_range checks build empty ranges
(e.g. 0..0 or 2..2). contains_range always returns true for an empty
range, so those assertions can never pass. Require len >= 1 in both the
RoaringBitmap and RoaringTreemap versions so every negative check covers
start - 1 or end, neither of which is in the bitmap.

@Kerollmops Kerollmops left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 🍀

@Kerollmops
Kerollmops added this pull request to the merge queue Oct 26, 2026
Merged via the queue into RoaringBitmap:main with commit 14ddf49 Oct 26, 2026
15 checks passed
@Dr-Emann
Dr-Emann deleted the push-krzvrmkyvuqr branch October 26, 2026 15:55
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