Introduce Iter::next_range and next_range_back#338
Merged
Kerollmops merged 2 commits intoRoaringBitmap:mainfrom Sep 18, 2025
Merged
Introduce Iter::next_range and next_range_back#338Kerollmops merged 2 commits intoRoaringBitmap:mainfrom
Kerollmops merged 2 commits intoRoaringBitmap:mainfrom
Conversation
282e13e to
7499198
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new methods next_range and next_range_back to the Iter and IntoIter types for RoaringBitmap, enabling extraction of consecutive ranges of set bits from iterators rather than individual values.
- Implementation of range extraction methods across all container types (array, bitmap, run)
- Helper functions for finding contiguous ranges in array stores
- Comprehensive test coverage including edge cases and multi-container scenarios
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| roaring/tests/iter_next_range.rs | Comprehensive test suite covering various scenarios for the new range methods |
| roaring/src/bitmap/iter.rs | Main implementation of next_range and next_range_back methods for public iterators |
| roaring/src/bitmap/container.rs | Container-level wrapper methods that delegate to store implementations |
| roaring/src/bitmap/store/mod.rs | Store iterator wrapper that dispatches to specific store implementations |
| roaring/src/bitmap/store/array_store/mod.rs | Helper functions for finding contiguous ranges in sorted arrays |
| roaring/src/bitmap/store/bitmap_store.rs | Bitmap store implementation with bit manipulation for range extraction |
| roaring/src/bitmap/store/interval_store.rs | Run store implementation using interval-based range extraction |
| fuzz/fuzz_targets/arbitrary_ops/mod.rs | Fuzz testing support for the new range methods |
7499198 to
f5d790c
Compare
Provide an optimal way to iterate over the ranges of a bitmap
f5d790c to
7bf690c
Compare
Kerollmops
requested changes
Aug 15, 2025
Member
Kerollmops
left a comment
There was a problem hiding this comment.
Looks very good to me. Have you run the fuzzer for more than 30 minutes in the CI?
Kerollmops
approved these changes
Sep 18, 2025
Member
Kerollmops
left a comment
There was a problem hiding this comment.
Nice, thank you for your work, again 👌
|
Looking forward to a release including these changes! 🙂 This is the only missing piece for me in favor of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #274