Skip to content

Prevent OOB write for RBK and RLE in streaming context - #10504

Open
nanan-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
nanan-nvidia:fix-streaming-rle-oob-10036
Open

Prevent OOB write for RBK and RLE in streaming context#10504
nanan-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
nanan-nvidia:fix-streaming-rle-oob-10036

Conversation

@nanan-nvidia

Copy link
Copy Markdown
Contributor

Fixes #10036

@nanan-nvidia
nanan-nvidia requested a review from a team as a code owner July 27, 2026 19:45
@nanan-nvidia
nanan-nvidia requested a review from miscco July 27, 2026 19:45
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 27, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved unique-count processing for partitioned data.
    • Prevented unnecessary updates to intermediate results after the final partition, improving correctness and consistency of streaming operations.

Walkthrough

Changes

Streaming unique-count handling

Layer / File(s) Summary
Guard final-partition output writes
cub/cub/device/dispatch/dispatch_reduce_by_key.cuh, cub/cub/device/dispatch/dispatch_rle.cuh
add_num_uniques writes the accumulated unique count only when the current partition is not the final partition.

Assessment against linked issues

Objective Addressed Explanation
Prevent the out-of-bounds write in streaming run-length encoding with 64-bit item counts and an unaligned temporary allocation [#10036]

Suggested reviewers: bernhardmgruber, miscco, davebayer


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
cub/cub/device/dispatch/dispatch_reduce_by_key.cuh (1)

105-109: 🩺 Stability & Availability | 🔵 Trivial | 🏗️ Heavy lift

suggestion: Add focused regression coverage for both streaming implementations using 64-bit num_items, a single partition, and an unaligned temporary-storage base, then run Compute Sanitizer. Ordinary output assertions may pass even if the zero-sized auxiliary buffer is still written.

  • cub/cub/device/dispatch/dispatch_reduce_by_key.cuh#L105-L109: validate reduce-by-key output and sanitizer cleanliness.
  • cub/cub/device/dispatch/dispatch_rle.cuh#L101-L105: validate RLE output and sanitizer cleanliness.
    This follows the PR objective of preventing silent out-of-bounds writes in these exact streaming paths.

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a5a1bc55-8617-4574-86aa-b32b3b2ca933

📥 Commits

Reviewing files that changed from the base of the PR and between 02f4015 and 71ab377.

📒 Files selected for processing (2)
  • cub/cub/device/dispatch/dispatch_reduce_by_key.cuh
  • cub/cub/device/dispatch/dispatch_rle.cuh

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[BUG][CUB] OOB write in streaming RBK when num_items is 64-bit and the temp base is unaligned

4 participants