You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[cudax][cuco] Migrate host contains_if APIs for fixed_capacity_set - #12357
This PR migrates the host contains_if and contains_if_async APIs from cuCollections static_set to fixed_capacity_set, reusing the shared open-addressing implementation.
Checklist
New or existing tests cover these changes.
The documentation is up to date with these changes.
Add host contains_if and contains_if_async to
cudax::cuco::fixed_capacity_set, forwarding to the shared open-addressing
implementation, and cover them in the insert and contains test with a
stencil distinct from the keys.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Added conditional membership checks for fixed-capacity sets, with synchronous and asynchronous options. A predicate selects which queries are checked against the set; unselected queries return false.
Tests
Added coverage for conditional lookups with offset stencil values, including results before and after inserting keys, and verified that only selected queries receive membership results.
Adds synchronous and asynchronous contains_if APIs to fixed_capacity_set. The APIs use a predicate on stencil values to select queries and write membership results. Tests cover both overloads and verify results across the query range.
Adds synchronous and asynchronous contains_if overloads. Both write membership results for selected keys and false for unselected keys. The synchronous overload synchronizes the supplied stream; the asynchronous overload does not.
Test conditional lookup cudax/test/cuco/fixed_capacity_set/test_insert_and_contains.cu
Adds predicate helpers and tests both overloads with an offset stencil. Checks membership results for even-indexed inserted keys.
Assessment against linked issues
Objective
Addressed
Explanation
Migrate host contains_if APIs to fixed_capacity_set and add corresponding tests [#11135]
✅
Possibly related PRs
NVIDIA/cccl#12355: Adds stencil-filtered lookup APIs that return stored keys or a sentinel rather than membership results.
Suggested reviewers:fbusato
Change: Feature
Merge Risk: Low · up to 41473
The change is mergeable with a test follow-up: the filtered lookup test does not detect every missing write, but no current API failure or build blocker is established.
Security architecture risk: Minimal · up to 41473
The new queries reuse existing lookup execution and preserve caller-managed storage and stream synchronization. The review found no introduced security finding or material expansion of privileges or trust-boundary exposure.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The added API operates with the invoking application's existing CUDA authority over supplied iterators, set storage, and stream. The inspected change adds query selection, not a service, tenant, credential, or sandbox boundary.
Trust Boundaries and Controls
inferred — The stencil predicate is caller-supplied query logic, not an authorization control. As with existing membership operations, the caller must provide valid device-accessible ranges and retain storage until queued work completes; the new wrappers do not validate untrusted pointers or transfer storage ownership.
Resilience and Maintainability Implications
inferred — The methods preserve the existing borrowed-storage execution model. Repeated queries do not introduce a set-state transition, while overlapping output writes and premature destruction still require caller coordination. Launch and synchronization errors are reported, but callers must not assume atomic output publication or rollback after execution failure; that limitation predates these wrappers.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.
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
cucocuCollectionscudaxFeature intended for the cudax experimental library
4 participants
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.
Description
Closes #11135.
This PR migrates the host
contains_ifandcontains_if_asyncAPIs from cuCollectionsstatic_settofixed_capacity_set, reusing the shared open-addressing implementation.Checklist