Skip to content

Commit 1103a60

Browse files
committed
Merge branch 'main' into fix/niche-payload-leaf-slots
Signed-off-by: nihalpasham <nihalp@nvidia.com>
2 parents 1f6a9d4 + a38e844 commit 1103a60

3,236 files changed

Lines changed: 276491 additions & 65608 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
---
4+
name: Set up the CUDA devel container
5+
description: >-
6+
Installs the host packages the nvidia/cuda devel image lacks, marks the
7+
workspace safe for git, and installs rustup. Callers use the $/ form so
8+
this runs before checkout and git is already installed. The image already
9+
contains the CUDA toolkit. Later steps pick up rust-toolchain.toml from
10+
their working directory.
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Install host packages
16+
shell: bash
17+
run: |
18+
apt-get update -qq
19+
# python3 is for sync-example-locks.sh. The image has neither git nor
20+
# python3; git has to be present before actions/checkout.
21+
apt-get install -y -qq --no-install-recommends \
22+
build-essential ca-certificates curl git pkg-config libclang-dev \
23+
python3 wget
24+
25+
- name: Mark the workspace as a safe git directory
26+
shell: bash
27+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
28+
29+
- name: Install Rust
30+
shell: bash
31+
env:
32+
RUSTUP_VERSION: "1.29.2"
33+
# SHA-256 of rustup-init for x86_64-unknown-linux-gnu, published next to
34+
# the binary as .../rustup/archive/1.29.2/x86_64-unknown-linux-gnu/rustup-init.sha256.
35+
# Bump both values together.
36+
RUSTUP_INIT_SHA256: "5be191e8c70a5007074254cb74d78dbfdd25cd5a61c27de7b8e5410122ec24f4"
37+
run: |
38+
set -euo pipefail
39+
[ "$(uname -m)" = "x86_64" ] || { echo "the rustup-init pin is for x86_64"; exit 1; }
40+
init="${RUNNER_TEMP}/rustup-init"
41+
curl --proto '=https' --tlsv1.2 -sSfo "${init}" \
42+
"https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/x86_64-unknown-linux-gnu/rustup-init"
43+
echo "${RUSTUP_INIT_SHA256} ${init}" | sha256sum -c -
44+
chmod +x "${init}"
45+
"${init}" -y --no-modify-path --profile minimal --default-toolchain none
46+
rm -f "${init}"
47+
echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}"
48+
# $/ runs this before the workspace checkout. The action download is
49+
# the same commit, and rustup finds rust-toolchain.toml by walking up
50+
# from the working directory. The root file is the stable pin;
51+
# cuda-oxide/ selects the nightly.
52+
repo="${GITHUB_ACTION_PATH}/../../.."
53+
(cd "${repo}" && "${HOME}/.cargo/bin/rustup" show)
54+
(cd "${repo}/cuda-oxide" && "${HOME}/.cargo/bin/rustup" show)

‎.github/pull_request_template.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
## Checklist
1818

1919
- [ ] All commits signed off (`git commit -s`)
20+
- [ ] All commits cryptographically signed and shown as Verified on GitHub (`git commit -S`)
2021
- [ ] SPDX headers on new source files
2122

2223
---

‎.github/workflows/book.yml‎

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
name: Deploy CUDA Rust Docs
22

33
# Path-filtered lane: only documentation sources can change what this builds.
4+
# Self-hosted runners reject pull_request. copy-pr-bot mirrors trusted PRs to
5+
# pull-request/<n>, and the build job triggers on that push. `deploy` stays on
6+
# main: a mirror push is a push event, so an event-name check would publish it.
47
on:
58
push:
6-
branches: [main]
7-
paths:
8-
- 'cuda-oxide/cuda-oxide-book/**'
9-
- 'cutile-rs/cutile-book/**'
10-
- 'cutile-rs/scripts/build_versioned_book.sh'
11-
- 'docs/**'
12-
- '.github/workflows/book.yml'
13-
# Validate the book on PRs too. The build job alone runs there; `deploy` is
14-
# gated below, so a pull request never publishes. Without this the book was
15-
# only ever built after merge, so a PR that broke it could not be caught by
16-
# review or by CI.
17-
pull_request:
18-
branches: [main]
19-
paths:
20-
- 'cuda-oxide/cuda-oxide-book/**'
21-
- 'cutile-rs/cutile-book/**'
22-
- 'cutile-rs/scripts/build_versioned_book.sh'
23-
- 'docs/**'
24-
- '.github/workflows/book.yml'
9+
# No workflow-level paths: filter; the changes job below gates the jobs.
10+
branches:
11+
- main
12+
- "pull-request/[0-9]+"
2513
workflow_dispatch:
2614

2715
# Only checkout rights by default. The Pages deployment permissions live on
@@ -39,11 +27,47 @@ permissions:
3927
# a slower older commit deploy after a newer one and replace the published site.
4028
concurrency:
4129
group: ${{ github.workflow }}-${{ github.ref }}
42-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
30+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
4331

4432
jobs:
33+
# Path gate. copy-pr-bot creates pull-request/<n> at an existing SHA, and
34+
# GitHub often treats that push as having no path changes, so a workflow-level
35+
# `paths:` filter would skip the whole run. This job diffs against main
36+
# instead, as cutile-rs.yml does, and every job below runs when no file diff
37+
# is detected. Other events (schedule, workflow_dispatch) skip the gate.
38+
changes:
39+
if: github.event_name == 'push'
40+
runs-on: linux-amd64-cpu4
41+
timeout-minutes: 5
42+
permissions:
43+
contents: read
44+
outputs:
45+
relevant: ${{ steps.changes.outputs.relevant }}
46+
any_changed: ${{ steps.changes.outputs.any_changed }}
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3.0.4
52+
id: changes
53+
with:
54+
filters: |
55+
relevant:
56+
- 'cuda-oxide/cuda-oxide-book/**'
57+
- 'cutile-rs/cutile-book/**'
58+
- 'cutile-rs/scripts/build_versioned_book.sh'
59+
- 'docs/**'
60+
- '.github/workflows/book.yml'
61+
# `*` covers a root file, `**` every nested path. Both false means
62+
# no file diff was detected.
63+
any_changed:
64+
- '*'
65+
- '**'
66+
4567
build:
46-
runs-on: ubuntu-latest
68+
needs: changes
69+
if: ${{ !cancelled() && (github.event_name != 'push' || needs.changes.outputs.relevant == 'true' || needs.changes.outputs.any_changed != 'true') }}
70+
runs-on: linux-amd64-cpu4
4771
# An umbrella page plus two Sphinx books. Bound the job so a
4872
# wedged install or a sphinx that never returns fails instead of burning to
4973
# the 6-hour default.
@@ -76,17 +100,17 @@ jobs:
76100
run: |
77101
# Unset CUTILE_DOCS_TAGS → build every tag matching the pattern.
78102
# Empty CUTILE_DOCS_TAGS → current tree only (fast PR check).
79-
if [ "${{ github.event_name }}" = "pull_request" ]; then
80-
export CUTILE_DOCS_TAGS=""
81-
fi
103+
case "${GITHUB_REF}" in
104+
refs/heads/pull-request/*) export CUTILE_DOCS_TAGS="" ;;
105+
esac
82106
bash docs/build_all_docs.sh
83107
84108
# Only `deploy` consumes this, and `deploy` is skipped on pull requests,
85109
# so uploading it there produces an artifact nothing can ever read. A PR's
86110
# job is to prove both Sphinx builds succeed, which the steps above already
87111
# did; gate the upload on the same condition `deploy` uses so the two
88112
# cannot drift apart.
89-
- if: github.event_name != 'pull_request'
113+
- if: github.ref == 'refs/heads/main'
90114
uses: actions/upload-pages-artifact@v3
91115
with:
92116
path: docs/build/html
@@ -96,7 +120,7 @@ jobs:
96120
# Publishing is for main only. A pull request builds the book to prove it
97121
# is sound and stops there; it never touches the Pages environment or
98122
# holds the deployment permissions below.
99-
if: github.event_name != 'pull_request'
123+
if: github.ref == 'refs/heads/main'
100124
permissions:
101125
pages: write
102126
id-token: write

‎.github/workflows/cargo-deny.yml‎

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: cargo-deny
33

4-
# Runs as a job of the top-level CI workflow (.github/workflows/ci.yml) on
5-
# push/pull_request, plus a standalone weekly security scan via schedule.
4+
# Runs as a job of the top-level CI workflow (.github/workflows/ci.yml),
5+
# plus a standalone weekly security scan via schedule.
66
# Concurrency for the CI path is governed by CI's own group.
77
#
88
# Four parts of the same concern. `check` enforces the license *policy* over
@@ -30,14 +30,24 @@ on:
3030
permissions:
3131
contents: read
3232

33+
# A container job's default shell is dash; use bash, as on ubuntu-latest.
34+
defaults:
35+
run:
36+
shell: bash
37+
3338
jobs:
3439
check:
35-
runs-on: ubuntu-latest
40+
runs-on: linux-amd64-cpu4
41+
container:
42+
image: rust:1.98.0-bookworm
3643
timeout-minutes: 10
3744
steps:
3845
- name: Clone repository
3946
uses: actions/checkout@v4
4047

48+
- name: Mark the workspace as a safe git directory
49+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
50+
4151
- name: Install cargo-deny
4252
run: cargo install cargo-deny --locked
4353

@@ -94,25 +104,35 @@ jobs:
94104

95105
license-manifest:
96106
name: dependency-licenses.csv covers every declared crate
97-
runs-on: ubuntu-latest
107+
runs-on: linux-amd64-cpu4
108+
container:
109+
image: rust:1.98.0-bookworm
98110
timeout-minutes: 10
99111
steps:
100112
- name: Clone repository
101113
uses: actions/checkout@v4
102114

115+
- name: Mark the workspace as a safe git directory
116+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
117+
103118
# Only reads manifests: `cargo metadata` resolves the graph without
104119
# running build scripts, so this needs no CUDA toolkit and no LLVM.
105120
- name: Verify the license inventory covers the workspace
106121
run: bash cuda-oxide/scripts/check-dependency-licenses.sh
107122

108123
example-policy:
109124
name: deny.toml governs the example workspaces
110-
runs-on: ubuntu-latest
125+
runs-on: linux-amd64-cpu4
126+
container:
127+
image: rust:1.98.0-bookworm
111128
timeout-minutes: 15
112129
steps:
113130
- name: Clone repository
114131
uses: actions/checkout@v4
115132

133+
- name: Mark the workspace as a safe git directory
134+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
135+
116136
- name: Install cargo-deny
117137
run: cargo install cargo-deny --locked
118138

@@ -125,12 +145,17 @@ jobs:
125145

126146
source-headers:
127147
name: every source file carries the SPDX header
128-
runs-on: ubuntu-latest
148+
runs-on: linux-amd64-cpu4
149+
container:
150+
image: rust:1.98.0-bookworm
129151
timeout-minutes: 5
130152
steps:
131153
- name: Clone repository
132154
uses: actions/checkout@v4
133155

156+
- name: Mark the workspace as a safe git directory
157+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
158+
134159
# Pure text check over tracked files: no toolchain, no network. The OSRB
135160
# review fixed 32 missing headers in #812 and the next two scripts to
136161
# land (#819, #835) drifted again; this makes the third time the last.

‎.github/workflows/ci-status.yml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ name: CI status
55

66
# One status for the whole repository, so the README needs one badge.
77
#
8-
# Badges are per workflow file, and the two pipelines have to stay separate
9-
# for now: ci.yml (SIMT and the shared host crates) runs on GitHub-hosted
10-
# runners on push and pull_request; cutile-rs.yml (Tile) runs on NVIDIA
11-
# self-hosted runners, which cannot run on pull_request events, so it
12-
# triggers on push to main and to the copy-pr-bot mirror branches.
8+
# Badges are per workflow file. ci.yml and cutile-rs.yml both run on NVIDIA
9+
# self-hosted runners, which reject pull_request, so both trigger on push to
10+
# main and to the copy-pr-bot mirror branches.
1311
#
1412
# This workflow runs whenever either of them completes on main. For each
1513
# pipeline it finds the newest completed push run on main that actually
@@ -34,7 +32,7 @@ permissions:
3432
jobs:
3533
status:
3634
name: combined CI status on main
37-
runs-on: ubuntu-latest
35+
runs-on: linux-amd64-cpu4
3836
timeout-minutes: 5
3937
steps:
4038
- name: Report the newest executed main run of each pipeline

‎.github/workflows/ci.yml‎

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,16 @@ name: CI
44
# Path-filtered SIMT lane: skip when a change cannot affect cuda-oxide or the
55
# shared host crates. `cuda-oxide/**` is deliberately broad (prose as well as
66
# code) because guard scripts cross-check the book against the crates.
7+
#
8+
# Self-hosted runners reject pull_request. copy-pr-bot mirrors trusted PRs to
9+
# pull-request/<n>, and this workflow triggers on that push
10+
# (config: .github/copy-pr-bot.yaml).
711
on:
812
push:
9-
branches: [main]
10-
paths:
11-
- 'cuda-oxide/**'
12-
- 'cuda-bindings/**'
13-
- 'cuda-core/**'
14-
- 'cuda-core-derive/**'
15-
- 'cuda-async/**'
16-
- 'Cargo.toml'
17-
- 'Cargo.lock'
18-
- '.github/workflows/**'
19-
pull_request:
20-
branches: [main]
21-
paths:
22-
- 'cuda-oxide/**'
23-
- 'cuda-bindings/**'
24-
- 'cuda-core/**'
25-
- 'cuda-core-derive/**'
26-
- 'cuda-async/**'
27-
- 'Cargo.toml'
28-
- 'Cargo.lock'
29-
- '.github/workflows/**'
13+
# No workflow-level paths: filter; the changes job below gates the jobs.
14+
branches:
15+
- main
16+
- "pull-request/[0-9]+"
3017

3118
# Each commit on main gets its own group, so it starts at once. Any other ref
3219
# still shares one group and cancels the older run.
@@ -44,14 +31,61 @@ permissions:
4431
contents: read
4532

4633
jobs:
34+
# Path gate. copy-pr-bot creates pull-request/<n> at an existing SHA, and
35+
# GitHub often treats that push as having no path changes, so a workflow-level
36+
# `paths:` filter would skip the whole run. This job diffs against main
37+
# instead, as cutile-rs.yml does, and every job below runs when no file diff
38+
# is detected. Other events (schedule, workflow_dispatch) skip the gate.
39+
changes:
40+
if: github.event_name == 'push'
41+
runs-on: linux-amd64-cpu4
42+
timeout-minutes: 5
43+
permissions:
44+
contents: read
45+
outputs:
46+
relevant: ${{ steps.changes.outputs.relevant }}
47+
any_changed: ${{ steps.changes.outputs.any_changed }}
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3.0.4
53+
id: changes
54+
with:
55+
filters: |
56+
relevant:
57+
- 'cuda-oxide/**'
58+
- 'cuda-bindings/**'
59+
- 'cuda-core/**'
60+
- 'cuda-core-derive/**'
61+
- 'cuda-repr/**'
62+
- 'cuda-async/**'
63+
- 'Cargo.toml'
64+
- 'Cargo.lock'
65+
- '.github/workflows/**'
66+
- '.github/actions/setup-cuda-container/**'
67+
# `*` covers a root file, `**` every nested path. Both false means
68+
# no file diff was detected.
69+
any_changed:
70+
- '*'
71+
- '**'
72+
4773
fmt:
74+
needs: changes
75+
if: ${{ !cancelled() && (github.event_name != 'push' || needs.changes.outputs.relevant == 'true' || needs.changes.outputs.any_changed != 'true') }}
4876
uses: ./.github/workflows/fmt.yml
4977

5078
clippy:
79+
needs: changes
80+
if: ${{ !cancelled() && (github.event_name != 'push' || needs.changes.outputs.relevant == 'true' || needs.changes.outputs.any_changed != 'true') }}
5181
uses: ./.github/workflows/clippy.yml
5282

5383
unit-tests:
84+
needs: changes
85+
if: ${{ !cancelled() && (github.event_name != 'push' || needs.changes.outputs.relevant == 'true' || needs.changes.outputs.any_changed != 'true') }}
5486
uses: ./.github/workflows/unit-tests.yml
5587

5688
cargo-deny:
89+
needs: changes
90+
if: ${{ !cancelled() && (github.event_name != 'push' || needs.changes.outputs.relevant == 'true' || needs.changes.outputs.any_changed != 'true') }}
5791
uses: ./.github/workflows/cargo-deny.yml

0 commit comments

Comments
 (0)