Skip to content

[Rust] Add Block and Warp MergeSortKeys - #12244

Draft
tpn wants to merge 301 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-merge-sort-keys
Draft

tpn wants to merge 301 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-merge-sort-keys

Conversation

@tpn

@tpn tpn commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Add Rust MergeSortKeys for ascending or descending sorting of per-thread keys. It returns a fresh payload and preserves the input, with complete Block and Warp groups, full inputs or a signed count plus a key-typed sentinel. Partial results expose only the valid prefix; unreadable inputs and invalid counts trap before CUB.

This follows RadixRankKeys #12243 and uses the pinned Oxide compiler. Review the 22-file owning diff; Files changed against main also includes the preceding Rust API layers.

Local Rust 1.99.1 validation passed host tests and strict checks, all thirteen compiler controls and both release consumers. Inspection covered ten kernel entries, eleven executable sections and the native ABI and scratch plans. Numerical checks, three sanitizers and four invalid-input/count traps with immediate successful recovery runs passed.

Earlier source review, native 21-recipe and MSRV results retain their historical attribution. The eleven executable sections match the earlier code, while whole CUBINs and global data differ; those differences and prior failed attempts remain recorded. Timing was not repeated, and no speedup is claimed. Current-head host CI passes (105 tests/doctests; 16 native tests excluded), along with the three upstream checks.

tpn added 30 commits October 20, 2026 12:58
Support both CUB warp-transpose algorithms for complete blocks.
Preserve payload validity through Store permutation and query exact
scratch layouts for regular and timesliced exchanges.

Signed-off-by: Trent Nelson <[email protected]>
Use the group-first API for independent 32-lane tiles and preserve
carrier ownership grain across block and warp operations. Select the
matching Oxide compiler for scoped participation and access checks.

Signed-off-by: Trent Nelson <[email protected]>
Combine the six block Load/Store algorithms with explicit storage and
physical-warp Direct dispatch. Preserve group and storage forwarding
through the common boundary and qualify timesliced storage reuse.

Signed-off-by: Trent Nelson <[email protected]>
Use the common group-first API with power-of-two lane groups, preserving
fixed carrier ownership and scope-correct controls through helpers.

Signed-off-by: Trent Nelson <[email protected]>
Explain the user workflow, compilation and generic specialization before
provider internals. Keep the source listings tied to the Cargo example
and move provider details to their own page.

Signed-off-by: Trent Nelson <[email protected]>
Allow algorithm.into() for full-tile calls and From constructors for
option builders while preserving existing default inference. Use the
conversion in the executable generic helper.

Signed-off-by: Trent Nelson <[email protected]>
Observe the finite loop and later wider results, and distinguish
participation from memory completion. Cover nested breaks and lane-local
scalar work before a wider operation.

Signed-off-by: Trent Nelson <[email protected]>
Describe the implemented physical and logical warp algorithms and their
scratch requirements. Link payload readers to Load/Store and storage.

Signed-off-by: Trent Nelson <[email protected]>
Expose inferred fresh Scan results with common operators, typed seeds
and checked temporary storage. Add a generic Load-Scan-Store example
and focused native, compiler and runtime coverage.

Signed-off-by: Trent Nelson <[email protected]>
Preserve the recognized prefix query through generic group helpers and
pin the Rust workspace and examples to the supporting compiler revision.

Signed-off-by: Trent Nelson <[email protected]>
Preserve input values and expose results only at the group root.
Support typed operators, counts, algorithms and scratch policies through
the native provider, with generic examples and checked safe outputs.

Signed-off-by: Trent Nelson <[email protected]>
Copy intermediate values only for lanes that own a batch. Preserve
collective execution and both output layouts, and check copy ownership
without evaluating uninitialized values.

Signed-off-by: Trent Nelson <[email protected]>
Reduce payload columns across physical and logical warps into fresh
payloads with calculated capacity and checked result validity.

Provide native CUB specialization, generic examples and documentation
through the existing checked payload and managed storage interfaces.
tpn added 25 commits October 23, 2026 14:08
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
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 <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
@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