Skip to content

cuda-oxide: move SIMT toolchain pin to stable 1.99.1 - #1609

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
nihalpasham:feat/stabilize-toolchain-1.99.1
Oct 23, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
nihalpasham:feat/stabilize-toolchain-1.99.1

Conversation

@nihalpasham

@nihalpasham nihalpasham commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move cuda-oxide from a pinned daily nightly toolchain (nightly-2026-10-11) to official stable Rust 1.99.1, unifying the entire monorepo (cuda-core, cutile-rs, and cuda-oxide) on stable Rust releases:

Before: cuda-oxide/rust-toolchain.toml -> channel = "nightly-2026-10-11" (daily snapshot)
After:  cuda-oxide/rust-toolchain.toml -> channel = "1.99.1"             (official stable release + RUSTC_BOOTSTRAP=1)

Moving cuda-oxide to Stable Rust 1.99.1


Before vs. After

  • Before (nightly pin): cuda-oxide pinned a moving daily nightly snapshot while the root host workspace and cutile-rs used stable Rust. Any mid-cycle nightly bump (such as pulling in an upstream rustc_public addition) forced an unscheduled compiler upgrade with unrelated daily churn across 1,500+ files.
  • After (Stable 1.99.1 pin): cuda-oxide pins official stable Rust 1.99.1, which has already completed Rust's 12-week nightly and beta stabilization cycle and ships LLVM 23 (23.1.1) with an NVPTX backend and TableGen intrinsic definitions identical to nightly-2026-10-11.

Why This Works on Official Stable Rust

  1. Stable rustc and Nightly rustc are the same binary: Official stable rustc builds do not strip out -Z flags (-Z codegen-backend=..., -Z mir-enable-passes=-JumpThreading, -Z always-encode-mir) or #![feature(rustc_private)]. They gate them behind RUSTC_BOOTSTRAP=1 (the environment variable rustc uses when bootstrapping core and std on stable).
  2. rustup ships rustc-dev and rustc_public on stable releases: Running rustup component add rustc-dev on stable 1.99.1 provides librustc_driver.so, librustc_public.rlib, and librustc_public_bridge.rlib out of the box.
  3. Production precedent: This follows the same model used by Microsoft's rustc_codegen_utc and Ferrocene (building a CodegenBackend against a vetted stable Rust release tag rather than tracking daily nightlies).

Upstreaming to rustc_public on the Stable Cycle

Upstreaming to rustc_public on Stable

Because rustc_public only wraps data that already exists inside rustc_middle and rustc_abi, crates/mir-importer/src/translator/facts.rs acts as our quarantine boundary when we upstream new rustc_public queries (such as rust-lang/rust#163242):

  • Day 1: Land the feature immediately on the current stable pin by reading the underlying rustc_middle / rustc_target field in facts.rs via rustc_internal::internal(tcx, ...), while upstreaming the rustc_public getter in parallel.
  • Next scheduled stable release: Swap the temporary internal read in facts.rs to the upstreamed rustc_public method call.

Changes in This PR

  • Pin 1.99.1 across all SIMT toolchain surfaces: cuda-oxide/rust-toolchain.toml, cargo oxide new (scaffold.rs), .devcontainer/devcontainer.json, intrinsics/upstream.lock, and the book/README install commands.
  • Configure RUSTC_BOOTSTRAP=1 automatically: Set in cuda-oxide/.cargo/config.toml, cuda-oxide/Justfile, cargo-oxide (backend.rs, codegen_env.rs, fmt.rs, host_cargo.rs), and the example CI loops so -Z compiler flags, #![feature(rustc_private)], #![feature(f16)], and cargo-features = ["profile-rustflags"] work transparently on stable 1.99.1.
  • Adapt to 1.99.1 compiler APIs (~12 lines):
    • cuda-host: Use core::intrinsics::type_id::<T>() in type_id_u128.
    • mir-importer: Query tcx.fn_abi_of_instance inside facts.rs (reference_param_validity) for typed ArgAttributes (NoAlias, NoFree, pointee_size), and match ValueAbi::Scalar in types.rs.
    • rustc-codegen-cuda: Match 1.99.1's CodegenBackend (init, target_config, CompiledModule), ShimKind::FnPtrAddr, and layout.peel_transparent_wrappers.
  • Update cuda-oxide-book: Add the toolchain stabilization, facts.rs upstreaming workflow, and standalone bundle sections with four SVG diagrams under cuda-oxide-book/compiler/images/.

Validation

  • just check & just book: fmt-check, clippy (workspace + backend + all 258 example/model manifests), test, test-cuda, check-guards, check-intrinsics (all 1,042 routes / 2,427 target probes on LLVM version 23.1.1-rust-1.99.1-stable), doc-check, and Sphinx HTML book build (-W) all pass.
  • SIMT examples (scripts/smoketest.sh on RTX 5090): 240 / 240 pass.
  • cute-rs-preview examples and models: 16 / 16 pass (all 12 sm_120a workloads execute and pass on RTX 5090; all 4 sm_100a workloads compile to validated direct-ABI cubins via CUTLASS 4.7).

Checklist

  • All commits signed off (git commit -s)
  • SPDX headers on new source files

@copy-pr-bot

copy-pr-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

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.

@nihalpasham nihalpasham added cuda-oxide SIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, book build-related Build scripts, toolchain discovery, or compilation setup cargo-oxide The `cargo oxide` subcommand and build automation codegen Device code-generation pipeline (Rust MIR to IR to PTX) documentation Improvements or additions to documentation ci GitHub Actions workflows, runners, and CI configuration Depends Blocked on another PR/issue or an upstream dependency labels Oct 22, 2026
Pin `cuda-oxide/rust-toolchain.toml` (and matching scaffold, devcontainer,
and book/README copies) to official stable Rust `1.99.1` with
`RUSTC_BOOTSTRAP=1` configured via `.cargo/config.toml`, `Justfile`, and
`cargo-oxide`.

`1.99.1` ships LLVM 23 (`23.1.1`) with an NVPTX backend and TableGen
intrinsic definitions identical to `nightly-2026-10-11`, plus the
`rustc-dev` (`librustc_driver.so` and `librustc_public.rlib`) component,
removing daily nightly drift while preserving the full `rustc_public` and
`rustc-codegen-cuda` pipeline.

Signed-off-by: nihalpasham <nihalp@nvidia.com>
@nihalpasham
nihalpasham force-pushed the feat/stabilize-toolchain-1.99.1 branch from 6f2d0cc to 048739d Compare October 23, 2026 04:39
@nihalpasham nihalpasham removed the Depends Blocked on another PR/issue or an upstream dependency label Oct 23, 2026
@nihalpasham
nihalpasham merged commit e6c0179 into NVIDIA:main Oct 23, 2026
110 of 111 checks passed
@nihalpasham
nihalpasham deleted the feat/stabilize-toolchain-1.99.1 branch October 23, 2026 05:36
nihalpasham added a commit that referenced this pull request Oct 23, 2026
… clean up docs (#1616)

## Summary

Follow-up cleanup after moving `cuda-oxide` to stable Rust `1.99.1`
(#1609) and landing `cute-rs-preview` (#1598):

```text
1. cuda-oxide/flake.lock + flake.nix   -> bump rust-overlay for Stable 1.99.1 + set RUSTC_BOOTSTRAP=1
2. cargo oxide new (scaffold.rs)       -> write .cargo/config.toml with RUSTC_BOOTSTRAP = "1"
3. check-toolchain-parity.sh           -> verify flake.lock's rust-overlay rev has the pinned manifest
4. .github/workflows/unit-tests.yml    -> drop unused apt llvm-21 install (sysroot llvm-tools provides LLVM 23)
5. CONTRIBUTING / AGENTS / README / book -> update remaining nightly wording + clean up book backticks & SVG
```

### Changes

- **Nix flake (`cuda-oxide/flake.lock`, `cuda-oxide/flake.nix`):**
- Bump `oxalica/rust-overlay` from `c1cfa7a2c8` (`2026-10-11`, two days
before `1.99.1` was published) to `5f267b7f32` (`2026-10-22`) so `nix
develop` finds `Stable 1.99.1`.
- Set `RUSTC_BOOTSTRAP = "1"` in `flake.nix` (`cargoOxideCommonArgs` and
`devShells.default.shellHook`).
- Use a deterministic per-user directory
(`${XDG_RUNTIME_DIR:-/tmp}/cuda-oxide-nvidia-driver-$(id -u)`) for
non-NixOS driver symlinks so `nix develop --command` does not leak
`/tmp/nix-nvidia-driver.XXXXXX` directories.
- **Project scaffold (`crates/cargo-oxide/src/commands/scaffold.rs`):**
- Write `.cargo/config.toml` (`[env]\nRUSTC_BOOTSTRAP = "1"\n`) in
`cargo oxide new` so plain `cargo check`, `cargo build`, and
`rust-analyzer` work out of the box in standalone projects on stable
`1.99.1`.
- **Toolchain parity guard (`scripts/check-toolchain-parity.sh`):**
- Verify via an HTTP `HEAD` check that the `oxalica/rust-overlay`
revision locked in `cuda-oxide/flake.lock` actually contains
`manifests/stable/<channel>.nix` (or `manifests/nightly/...`), and
document the `nix flake update rust-overlay` step in
`check-toolchain-parity.sh` and `compiler/rustc-public.md`.
- **CI workflow (`.github/workflows/unit-tests.yml`,
`.github/workflows/status-guard.yml`):**
- Remove the redundant `Install LLVM 21` step on `cuda-oxide-codegen`
(`LlvmToolchain::resolve` already selects the Rust sysroot's LLVM 23
`llc`/`opt` from `llvm-tools`).
- Update the `status-guard.yml` comments to match the current single
SIMT stable pin and `flake.lock` check.
- **Contributor, agent, and book docs (`CONTRIBUTING.md`, `AGENTS.md`,
`cuda-oxide/README.md`, `cuda-oxide-book/`):**
- Replace remaining "nightly toolchain" wording in `CONTRIBUTING.md`,
`AGENTS.md` (`CLAUDE.md`), `cuda-oxide/README.md`,
`getting-started/installation.md`, and `getting-started/hello-gpu.md`.
- Remove backticks from `# ` sidebar page titles, `## ` / `### ` section
headings, and prose crate/tool names across the `cute/` chapter and
`compiler/rustc-public.md`.
- Scale bar widths in
`models/qwen3_8b_cute/svg/03-rtx5090-benchmark-comparison.svg` so the
right-hand throughput labels fit inside the panel with >=45px margin.

## Validation

- `cargo test -p cargo-oxide scaffold`
- `bash cuda-oxide/scripts/check-toolchain-parity.sh`
- `just fmt-check`
- `just check-guards`
- `just book` (Sphinx HTML build with `-W`)

## Checklist

- [x] All commits signed off (`git commit -s`)

Signed-off-by: nihalpasham <nihalp@nvidia.com>
@nihalpasham nihalpasham added this to the cuda oxide v0.3.0 milestone Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-related Build scripts, toolchain discovery, or compilation setup cargo-oxide The `cargo oxide` subcommand and build automation ci GitHub Actions workflows, runners, and CI configuration codegen Device code-generation pipeline (Rust MIR to IR to PTX) cuda-oxide SIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, book documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant