Skip to content

[Rust] Support uniform i32 captures in Block Reduce - #12249

Draft
tpn wants to merge 333 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-callable-capture-stable199
Draft

tpn wants to merge 333 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-callable-capture-stable199

Conversation

@tpn

@tpn tpn commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Allow Block Reduce closures to capture one immutable i32 value that the compiler proves is block-uniform. The API carries the actual closure through the helper and borrows its environment for the synchronous call.

This follows stateless callable Reduce #12248. Review the owning diff: five implementation/example/docs files and 68 revision-only pins for compiler #1626. GitHub’s main-based diff includes prerequisites.

Validation covers host/docs checks, five focused admission controls, public/scalar Normal/Full builds with ordinary and HTTPS-installed compilers, and inspection of the captured field and callback ABI. Eight ordinary Normal GPU runs passed, including six sanitizer checks.

Validation and source review apply to the byte-identical accepted source. References, mutable or general captured environments remain unsupported. Full-profile and HTTPS GPU execution are outside this validation. Current-head host CI passes (115 tests/doctests; 20 native tests excluded), along with the three upstream checks.

tpn added 30 commits October 21, 2026 08:45
Shift blocked-order values by one item while preserving input and
returning a fresh payload. Keep the exposed edge invalid until the
caller initializes it, and guard the native output read at that
boundary.

Include inferred generic helpers, a runnable example and guide, and
behavioral coverage for boundary validity and collective
participation.
Preserve the input and return fresh differences with typed neighbors
and counts. Copy inactive suffix items and validate the complete input
before native reads, including calls with a zero count.

Reuse the existing payload and scratch interfaces for the seven CUB
forms. Add the generic example, guide and focused compiler and runtime
coverage. Correct the synchronization function name in Shuffle
documentation.
Return fresh head and tail flags while preserving numeric inputs.
Support typed outside neighbors and independent paired results with
existing payload, validity and shared-storage interfaces.

Add a generic XYZ example, guide and focused compiler and runtime
coverage for the eight supported CUB forms.

Signed-off-by: Trent Nelson <trent@trent.me>
Return fresh striped counters with a selectable type and extent while
preserving the input payload. Validate sample bounds before native CUB
execution and plan the complete counter and algorithm scratch region.

Include a generic example, behavioral checks and the compiler
requirement in the Rust guide.

Signed-off-by: Trent Nelson <trent@trent.me>
Sort selected key bits in either direction into a fresh blocked payload.
Preserve input values through the checked collective and storage APIs,
with inferred types and independent static or runtime bounds.
Return fresh key and value payloads with stable selected-digit ordering
and preserve both inputs. Use the native CUB pair specialization with
independent payload types, alignments and checked validity.

Signed-off-by: Trent Nelson <trent@trent.me>
Return stable selected-digit ranks as fresh i32 payloads and preserve
integer keys. Support static digit widths and checked uniform bounds on
complete XYZ blocks through the native CUB rank specialization.

Signed-off-by: Trent Nelson <trent@trent.me>
Sort numeric keys into fresh results with checked prefix validity and
configurable order and temporary storage.

Signed-off-by: Trent Nelson <trent@trent.me>
Carry numeric values with their keys through Block and Warp merge
sorts, returning fresh payloads with checked prefix validity.
Add a generic example and document storage and comparator behavior.

Signed-off-by: Trent Nelson <trent@trent.me>
Provide min and max selection for keys and key-value pairs with typed
counts, partial input limits, fresh results and checked validity.
Select one native call per operation so exclusive storage charges one
scratch region. Include generic examples and focused diagnostics.

Signed-off-by: Trent Nelson <trent@trent.me>
Decode fresh windows or complete streams into checked destinations.
Preserve independent run, window and ownership extents. Validate run
lengths and offsets, retaining input payloads and result validity.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <trent@trent.me>
tpn added 25 commits October 23, 2026 14:08
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Use the scoped barrier diagnostic for conflicting Warp accesses.
Accept the two finite sibling-warp read loops after reconvergence,
matching the migrated checker and existing logical-warp policy.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <trent@trent.me>
Pass function items and stateless closures through the consuming
binary_op builder for full-input i32 Block Raking reductions. Keep
built-in operators, inferred payloads and root-only results intact.

Serve the existing callback protocol from the native provider and pin
the compiler support used by the public example and generic helper.

Signed-off-by: Trent Nelson <trent@trent.me>
Document immutable i32 captures through the existing consuming options
and generic helper. Exercise two runtime bias values while preserving
the existing built-in results and inputs. Pin the matching compiler
revision that proves the actual shared capture contents.

Signed-off-by: Trent Nelson <trent@trent.me>
@copy-pr-bot

copy-pr-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Oct 24, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Oct 24, 2026

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

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant