Skip to content

Use new rapidsmpf utilities to handle cancellation in bloom filter awaitables - #23293

Merged
rapids-bot[bot] merged 5 commits into
NVIDIA:release/26.08from
wence-:wence/fix/cudf-streaming-cancellation
Jul 22, 2026
Merged

Use new rapidsmpf utilities to handle cancellation in bloom filter awaitables#23293
rapids-bot[bot] merged 5 commits into
NVIDIA:release/26.08from
wence-:wence/fix/cudf-streaming-cancellation

Conversation

@wence-

@wence- wence- commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

To avoid cancellation in python leading to attempting to set a result on an already cancelled Future, use the new pattern introduced in rapidsai/rapidsmpf#1131

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Python Affects Python cuDF API. label Jul 16, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jul 16, 2026
@wence- wence- added bug Something isn't working non-breaking Non-breaking change labels Jul 16, 2026
@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from 49557b5 to 5983b22 Compare July 16, 2026 15:36
@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Jul 16, 2026
@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from ea40732 to a49d788 Compare July 17, 2026 08:46
@wence-

wence- commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a49d788

@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from a49d788 to 20a480c Compare July 17, 2026 13:43
@wence-
wence- changed the base branch from main to release/26.08 July 17, 2026 13:43
@wence-
wence- marked this pull request as ready for review July 17, 2026 14:16
@wence-
wence- requested review from a team as code owners July 17, 2026 14:16
@wence-
wence- requested a review from msarahan July 17, 2026 14:16
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Bloom filter updates

Layer / File(s) Summary
Device bloom filter stream handling
cpp/libcudf_streaming/include/.../device_bloom_filter.hpp, cpp/libcudf_streaming/src/detail/device_bloom_filter.cu
Construction-time stream state and the stream() accessor were removed; storage alignment and caller-provided hashing resources were updated.
Bloom filter integration
cpp/libcudf_streaming/src/bloom_filter.cpp
Build, merge, and apply paths construct stream-neutral filters and reserve device memory for hash values during build.
Python cancellation and regression coverage
python/cudf_streaming/cudf_streaming/bloom_filter.pyx, python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py
Build and apply cancellation shuts down channels, with a test verifying output-channel closure after cancellation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • rapidsai/cudf#23067: Updates the device_bloom_filter construction API and related call sites while changing filter sizing behavior.

Suggested reviewers: msarahan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updated cancellation handling for bloom filter awaitables using rapidsmpf utilities.
Description check ✅ Passed The description is directly related to the changes and explains the cancellation-future issue the patch addresses.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py (1)

175-223: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add equivalent cancellation coverage for BloomFilter.apply.

The PR changes cancellation wiring for both async methods, but this regression test covers only build. Add an apply test that blocks, cancels, and verifies its bloom-filter/input/output channels are closed.

As per coding guidelines, “Add unit tests and unit benchmarks for code contributions.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py` around lines
175 - 223, Add a cancellation regression test alongside
test_bloom_filter_build_timeout_cancellation for BloomFilter.apply that blocks
on its output, runs through run_actor_network until pytest-timeout cancellation,
and verifies the apply bloom-filter, input, and output channels are closed by
receiving None from each after cancellation. Reuse the existing Context,
Communicator, channel, and message setup patterns while covering the
apply-specific inputs and outputs.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py`:
- Around line 175-223: Add a cancellation regression test alongside
test_bloom_filter_build_timeout_cancellation for BloomFilter.apply that blocks
on its output, runs through run_actor_network until pytest-timeout cancellation,
and verifies the apply bloom-filter, input, and output channels are closed by
receiving None from each after cancellation. Reuse the existing Context,
Communicator, channel, and message setup patterns while covering the
apply-specific inputs and outputs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 504c0e19-0c5b-4f3d-8ecd-8796594f861a

📥 Commits

Reviewing files that changed from the base of the PR and between 7b13484 and 20a480c.

📒 Files selected for processing (7)
  • cpp/libcudf_streaming/include/cudf_streaming/detail/device_bloom_filter.hpp
  • cpp/libcudf_streaming/src/bloom_filter.cpp
  • cpp/libcudf_streaming/src/detail/device_bloom_filter.cu
  • dependencies.yaml
  • python/cudf_streaming/cudf_streaming/bloom_filter.pyx
  • python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py
  • python/cudf_streaming/pyproject.toml

@TomAugspurger TomAugspurger 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.

The python changes look good, though I have one question about the test.

Comment thread python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py Outdated
@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from 20a480c to fba2372 Compare July 17, 2026 14:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py`:
- Around line 204-220: Update the test around just_raise and bloom.build so the
RuntimeError is released only after a deterministic signal confirms the build
has reached its blocked ch_out-draining state, ensuring the test exercises
cancellation of that blocked worker. Rename the timeout-oriented comment to
describe exception-driven cancellation, and retain coverage for the resulting
exception group.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bfad6dab-76d5-47ec-a59b-6524a59a4e4e

📥 Commits

Reviewing files that changed from the base of the PR and between 20a480c and fba2372.

📒 Files selected for processing (5)
  • cpp/libcudf_streaming/include/cudf_streaming/detail/device_bloom_filter.hpp
  • cpp/libcudf_streaming/src/bloom_filter.cpp
  • cpp/libcudf_streaming/src/detail/device_bloom_filter.cu
  • python/cudf_streaming/cudf_streaming/bloom_filter.pyx
  • python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • python/cudf_streaming/cudf_streaming/bloom_filter.pyx
  • cpp/libcudf_streaming/include/cudf_streaming/detail/device_bloom_filter.hpp
  • cpp/libcudf_streaming/src/detail/device_bloom_filter.cu

Comment thread python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py Outdated
@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from fba2372 to 2892e1e Compare July 17, 2026 16:06
@wence-

wence- commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

This needs new 26.08 packages to be released, but the publishing process appears broken

@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from 2892e1e to 5b68103 Compare July 20, 2026 08:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
python/cudf_streaming/cudf_streaming/bloom_filter.pyx (1)

212-216: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document cancellation side effects in both public methods.

build cancellation now shuts down ch_in/ch_out, while apply also shuts down bloom_filter; document these effects and the None return value in the adjacent docstrings.

As per coding guidelines, public API methods must document parameters, return values, and behavior.

Also applies to: 256-258

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf_streaming/cudf_streaming/bloom_filter.pyx` around lines 212 -
216, Update the adjacent docstrings for both public methods, build and apply, to
document their parameters, that cancellation returns None, and the cancellation
side effects: build shuts down ch_in and ch_out, while apply additionally shuts
down bloom_filter. Preserve the existing method behavior and describe these
effects in the public API documentation.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@python/cudf_streaming/cudf_streaming/bloom_filter.pyx`:
- Around line 212-216: Update the adjacent docstrings for both public methods,
build and apply, to document their parameters, that cancellation returns None,
and the cancellation side effects: build shuts down ch_in and ch_out, while
apply additionally shuts down bloom_filter. Preserve the existing method
behavior and describe these effects in the public API documentation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 73c8a4db-e422-4020-967a-e6f1d32512a8

📥 Commits

Reviewing files that changed from the base of the PR and between 2892e1e and 5b68103.

📒 Files selected for processing (5)
  • cpp/libcudf_streaming/include/cudf_streaming/detail/device_bloom_filter.hpp
  • cpp/libcudf_streaming/src/bloom_filter.cpp
  • cpp/libcudf_streaming/src/detail/device_bloom_filter.cu
  • python/cudf_streaming/cudf_streaming/bloom_filter.pyx
  • python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • cpp/libcudf_streaming/include/cudf_streaming/detail/device_bloom_filter.hpp
  • python/cudf_streaming/cudf_streaming/tests/test_bloom_filter.py
  • cpp/libcudf_streaming/src/bloom_filter.cpp
  • cpp/libcudf_streaming/src/detail/device_bloom_filter.cu

@wence-
wence- force-pushed the wence/fix/cudf-streaming-cancellation branch from ed3dee0 to 558135f Compare July 21, 2026 11:13
@wence-
wence- removed request for a team and msarahan July 21, 2026 11:17
Comment thread cpp/libcudf_streaming/src/detail/device_bloom_filter.cu
Comment thread cpp/libcudf_streaming/src/bloom_filter.cpp
@TomAugspurger

Copy link
Copy Markdown
Contributor

I merged release/26.08 in f494cbb to pick up the other CI changes.

@TomAugspurger

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit dbafeb3 into NVIDIA:release/26.08 Jul 22, 2026
136 of 138 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jul 22, 2026
@wence-
wence- deleted the wence/fix/cudf-streaming-cancellation branch July 22, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants