Skip to content

[cudax][cuco] Migrate host rehash APIs for fixed_capacity_set - #12636

Open
PointKernel wants to merge 1 commit into
NVIDIA:mainfrom
PointKernel:cuco-set-rehash
Open

PointKernel wants to merge 1 commit into
NVIDIA:mainfrom
PointKernel:cuco-set-rehash

Conversation

@PointKernel

Copy link
Copy Markdown
Member

Description

Closes #11136.

This PR migrates the host rehash and rehash_async APIs from cuCollections static_set to fixed_capacity_set, reusing the shared open-addressing implementation. As with fixed_capacity_map, the overloads taking a new capacity are only available for dynamic capacity.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@PointKernel PointKernel added cudax Feature intended for the cudax experimental library cuco cuCollections labels Nov 13, 2026
@PointKernel PointKernel self-assigned this Nov 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

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-project-automation github-project-automation Bot moved this to Todo in CCCL Nov 13, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Nov 13, 2026
@PointKernel

Copy link
Copy Markdown
Member Author

/ok to test b5cb27b

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 28m: Pass: 100%/75 | Total: 20h 51m | Max: 1h 21m | Hits: 64%/91523

See results here.

@PointKernel
PointKernel marked this pull request as ready for review November 13, 2026 20:59
@PointKernel
PointKernel requested review from a team as code owners November 13, 2026 20:59
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added synchronous and asynchronous rehashing for fixed-capacity sets. Dynamic-capacity sets can also rehash to a requested capacity.
    • Rehashing preserves stored keys; capacity changes are reflected in the set.

fixed_capacity_set adds synchronous and asynchronous rehash operations. Dynamic-capacity sets can request a minimum capacity. Tests check overload availability, capacity results, and key preservation.

Changes: fixed_capacity_set rehash

Layer / File(s) Summary
Rehash overloads
cudax/include/cuda/experimental/__cuco/fixed_capacity_set.cuh
Adds synchronous and asynchronous rehash operations. Capacity-taking overloads are available for dynamic-capacity sets and use the smallest valid capacity at least as large as requested.
Rehash availability and behavior
cudax/test/cuco/fixed_capacity_set/test_capacity.cu, cudax/test/cuco/fixed_capacity_set/test_insert_and_contains.cu
Adds compile-time checks for the overloads and runtime checks for capacity and key preservation after rehashing.

Assessment against linked issues

Objective Addressed Explanation
Migrate host rehash APIs to fixed_capacity_set and add corresponding tests [#11136] ✅

Suggested reviewers: jacobfaib

Change: Feature

Merge Risk: Minimal · up to b5cb2

This adds synchronous and asynchronous rehash operations to the experimental fixed_capacity_set, with capacity-taking forms limited to dynamic-capacity sets. No concrete merge-blocking risk was identified, and tests cover the new overloads.

Security architecture risk: Low · up to b5cb2

A kernel-launch failure during the newly exposed rehash operation can discard the set’s previous contents without rollback. The supported consequence is local state loss; the inspected change does not establish a privilege escalation or cross-service attack path.

Retained concerns

  • Low · reliability · inferred: The newly public set rehash path publishes empty replacement storage before launching reinsertion. If launch preparation or submission throws before reinsertion is enqueued, unwinding releases the old storage without restoring it, so retrying cannot recover the previous keys. This failure behavior predates the PR in the shared map implementation but becomes newly reachable through fixed_capacity_set. No contents-preservation guarantee on failure is documented.
Security review details

Security Blast Radius

  • inferred — The supported failure consequence is loss of the affected set’s keys and invalidation of its borrowed storage references. No supplied downstream caller establishes a broader tenant, service, or security-policy consequence.

Trust Boundaries and Controls

  • observed — The routed has_capacity_rehash symbol is a compile-time test detection trait used by static assertions, not an executable request handler. The actual public operations act on a caller-owned set and rely on documented exclusive access and borrowed-reference lifetime obligations.

Resilience and Maintainability Implications

  • inferred — Failures before the storage swap retain the original published storage. After the swap, there is no rollback around the potentially throwing launch. Existing map reuse and the lack of a strong exception guarantee limit the concern to newly exposed, destructive recovery semantics rather than a demonstrated authorization or isolation failure.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: ae772fa
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 6ade8776-df1a-4257-821b-3a1dc9418031
Commits

Reviewing files that changed from the base of the PR and between ae772fa and b5cb27b.

Files selected for processing: 3

  • cudax/include/cuda/experimental/__cuco/fixed_capacity_set.cuh
  • cudax/test/cuco/fixed_capacity_set/test_capacity.cu
  • cudax/test/cuco/fixed_capacity_set/test_insert_and_contains.cu

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

This branch has not been deployed

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

Labels

cuco cuCollections cudax Feature intended for the cudax experimental library

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[CUCO][FEA]: Migrate host rehash APIs for fixed_capacity_set

2 participants