Skip to content

Add Rust SIMT MergeSortPairs - #12245

Closed
tpn wants to merge 311 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-merge-sort-pairs
Closed

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

Conversation

@tpn

@tpn tpn commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #12244, which now owns this implementation within its complete feature family. The original commits, branch and validation evidence remain available. This draft is closed unmerged.


Historical scope and validation below refer to the original source heads.

Add Rust MergeSortPairs to sort keys with their associated values while preserving both inputs. Independent numeric types and alignments are supported with ascending or descending order, complete Block and Warp groups, and full inputs or a signed count plus a key-typed sentinel. Fresh paired outputs expose only the valid prefix; equal-key order is not promised stable.

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

Local Rust 1.99.1 validation passed host tests, strict checks, generic inference and zero-extent rejection, 15 native requests, ten compiler controls and both release consumers. Artifact inspection covered five kernel entries, all six executable sections, paired payload/control ABI and scratch plans. Numerical checks, three sanitizers and both missing-value traps with immediate successful health runs passed.

Earlier source review and MSRV evidence remain historically attributed. Timing was not repeated, and no performance or historical code-equality claim is made. Current-head host CI passes (107 tests/doctests; 17 native tests excluded), along with the three upstream checks.

tpn added 30 commits October 20, 2026 18:15
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 <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
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 <trent@trent.me>
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.
Distinct kernel shapes can request identical Warp source. Include the
validated XYZ dimensions in each identity so one batch retains unique
symbols and ordered responses without rejecting valid consumers.

Cover different sizes and equal-thread-count shapes in Warp families.
Preserve input while converting striped and blocked per-thread layouts
into a fresh payload with the same type, extent and alignment. Use the
existing native CUB provider and compiler-planned scratch storage.

Add a generic standalone example, a guide and focused behavior and
participation coverage.
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>
tpn added 23 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>
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>
@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
@tpn tpn closed this Oct 25, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CCCL Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant