Skip to content

Add bounds-checked roaring bitmap constructor - #831

Draft
PointKernel wants to merge 5 commits into
NVIDIA:devfrom
PointKernel:fix-roaring-bitmap-bounds
Draft

Add bounds-checked roaring bitmap constructor#831
PointKernel wants to merge 5 commits into
NVIDIA:devfrom
PointKernel:fix-roaring-bitmap-bounds

Conversation

@PointKernel

Copy link
Copy Markdown
Member

This PR adds a cuda::std::span overload to cuco::experimental::roaring_bitmap and validates serialized bitmap bounds before host-side metadata parsing, allocation, and device copies. The bounded parser validates 32-bit container metadata, offsets, and payload sizes, as well as 64-bit bucket counts and nested bitmaps.

The existing pointer overload remains source-compatible and is documented as deprecated and unchecked.

@PointKernel PointKernel added topic: roaring_bitmap type: bug Something isn't working labels Aug 3, 2026
Comment on lines 66 to 68
roaring_bitmap(cuda::std::byte const* bitmap,
Allocator const& alloc = {},
cuda::stream_ref stream = cuda::stream_ref{cudaStream_t{nullptr}});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's deprecate this one until libcudf can switch over to the new constructor and then delete it once we are no longer using it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

exactly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Going to open a draft PR in cudf and temporarily point cuco to this PR until it merges

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we also need a rapids-cmake PR bumping the cuco version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: roaring_bitmap type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants