Repository navigation
fix(cargo-oxide): scaffold and clone from NVIDIA/cuda-rust - #1489
Merged
nihalpasham merged 2 commits intoOct 15, 2026
Merged
nihalpasham merged 2 commits into
nihalpasham merged 2 commits into
Conversation
`cargo oxide new` wrote git = "https://github.com/NVlabs/cuda-oxide.git" into every new project's manifest. Each Cargo.lock it produced then recorded the old repository as the dependency source. The backend fallback clone, used when no cuda-device or cuda-host dependency pins a commit, fetched the same URL. Both reached the repository only through GitHub's redirect. Cached backends and existing projects are unaffected. Backend discovery reads the checkout's manifest path and never its URL, and it already handles the nested cuda-oxide/crates layout. Signed-off-by: Alejandro Soto Franco <sotofranco.eng@gmail.com>
…pository URL The two backend-discovery diagrams named the new repository on the lockfile line but still showed Cargo's old checkout directory and the flat crate layout. Show the checkout as cuda-rust-<hash>/<sha> with the backend crate and toolchain pin under cuda-oxide/, and use one <sha> placeholder throughout the README block. Add a scaffold test that both templates name https://github.com/NVIDIA/cuda-rust.git and never the old owner. It fails on the previous template and passes here. Signed-off-by: nihalpasham <nihalp@nvidia.com>
Collaborator
|
/ok to test 3280e67 |
nihalpasham
pushed a commit
that referenced
this pull request
Oct 15, 2026
…NVIDIA/cuda-rust (#1490) ## What this adds The SIMT tree still named the pre-rename repository in its Cargo metadata, its license inventory and the device-codegen ICE message, while the four host crates already pointed at `NVIDIA/cuda-rust` (#1395). This change moves the SIMT tree to the same home: one inherited `[workspace.package] repository` line for the 26 workspace members, explicit fields on the two first-party crates outside that workspace, 29 inventory rows and the ICE text. The only compiled change is the string in that diagnostic. ```text cargo metadata `repository`, 28 SIMT crates before: https://github.com/NVlabs/cuda-oxide.git after: https://github.com/NVIDIA/cuda-rust (one value) first-party inventory rows at the old URL before: 29 of 33 after: 0 of 33 ICE text before: ...Please file at https://github.com/NVlabs/cuda-oxide/issues after: ...Please file at https://github.com/NVIDIA/cuda-rust/issues ``` ```rust // The only compiled change: the diagnostic printed when device codegen panics. tcx.dcx().fatal(format!( "[rustc_codegen_cuda] Internal compiler error in device codegen: {msg}. \ This is a bug in cuda-oxide. Please file at https://github.com/NVIDIA/cuda-rust/issues" )); ``` ## What we fixed - `cuda-oxide/Cargo.toml` `[workspace.package] repository`, inherited by every `repository.workspace = true` member (26 crates). - `rustc-codegen-cuda/Cargo.toml` and `examples/mathdx_ffi_test/libmathdx-sys/Cargo.toml`, the two first-party manifests that cannot inherit the workspace field. - 29 of the 33 first-party rows of `cuda-oxide/dependency-licenses.csv`; the four git-root host rows already carried the new URL. - The fatal internal-compiler-error message in `rustc_codegen_cuda` now names `https://github.com/NVIDIA/cuda-rust/issues`. <details><summary>Implementation</summary> - The URL form matches the host crates (`https://github.com/NVIDIA/cuda-rust`, no `.git` suffix). - `repository` is not part of `Cargo.lock` and nothing in the tree reads it, so no lockfile, symbol or PTX changes. - The inventory guard compares crate names only; the rows are hand-maintained, so the URL column was edited directly. - The remaining old-URL sites under `cuda-oxide/` are the cargo-oxide clone and scaffold constants (#1489), the book and crate README links (#1491), and issue and pull permalinks that keep their historical form. </details> ## Verification Checked at `dad294fd` (merged with `main` at `bc46b1ff`): - ✅ `git grep NVlabs/cuda-oxide` over the three manifests, the inventory and `lib.rs`: 1, 1, 1, 1, 29 hits on `main`, 0 after the change. - ✅ `cargo metadata --locked --offline --no-deps` in the SIMT workspace (26 members), the backend crate workspace and the `mathdx_ffi_test` workspace: one `repository` value, `https://github.com/NVIDIA/cuda-rust`; `git status` clean afterwards. - ✅ `strings` on the rebuilt `librustc_codegen_cuda.so`: `Please file at https://github.com/NVIDIA/cuda-rust/issues` once, the old URL zero times; `main`'s backend still shows the old URL. - ✅ `cargo oxide run vecadd` and `cargo oxide run mathdx_ffi_test --emit-nvvm-ir --arch=sm_120` on an RTX 5090 through the rebuilt backend: `SUCCESS` and `Passed: 9 / Failed: 0`; compute-sanitizer memcheck 0 errors on both; `vecadd` PTX identical to `main` modulo symbol hashes. - ✅ All 18 `scripts/check-*.sh` guards, `sync-example-locks.sh --check`, `cargo deny check` for cargo-oxide, rustc-codegen-cuda, the device-only fixture and the root workspace, `cargo oxide fmt --check`, clippy with `-D warnings`, and the unit, doc and rustdoc suites (5479 tests passed, 0 failed). - ✅ No file in this PR appears in #1489 or #1491. ## Caveats - The `oxide-artifacts` inventory row now names the current home; the published 0.2.1 crate still declares the old URL until the next publish from `crates/oxide-artifacts`. - No test reaches the ICE message; the string change is confirmed by compilation and the dylib strings only. - Clone and scaffold URLs in cargo-oxide and the book and README links are left to #1489 and #1491. Signed-off-by: Alejandro Soto Franco <sotofranco.eng@gmail.com>
nihalpasham
added a commit
that referenced
this pull request
Oct 15, 2026
…#1491) ## What this adds The SIMT book, its `conf.py` and the `cargo-oxide`, `ptx-parse`, `ptx-schedule` and `pinned_overlap` READMEs still named `NVlabs/cuda-oxide` in 23 current-repository references and reached the repository only through GitHub's redirect. This moves every one of them to `NVIDIA/cuda-rust`: four `cargo install --git` lines, the clone step, 16 tree and blob links to 13 targets, the Discussions link and the book's GitHub icon. Issue and pull-request permalinks keep their historical form, as AGENTS.md asks. ```text Before: git clone https://github.com/NVlabs/cuda-oxide.git # redirect; creates cuda-oxide/ holding the monorepo cd cuda-oxide After: git clone https://github.com/NVIDIA/cuda-rust.git cd cuda-rust cd cuda-oxide # build, doctor and run live here ``` ```bash cargo +nightly-2026-10-11 install --git https://github.com/NVIDIA/cuda-rust.git cargo-oxide ``` ## What we fixed - `conf.py`: the GitHub icon links `https://github.com/NVIDIA/cuda-rust`. - Four `cargo install --git` lines (cargo-oxide README, Building from Source, Writing Your First Kernel, Installation) and the clone step in Building from Source. - 16 tree and blob links to 13 targets across seven book pages and the `ptx-parse`, `ptx-schedule` and `pinned_overlap` READMEs. - The Discussions link in the ecosystem appendix. - Building from Source: the build, verify and common-commands sections run from `cuda-oxide/`, where the nightly pin and the `cargo oxide` alias apply, and the book and rustdoc sections start from the repository root. The shared host runtime is described as a path dependency on the repository-root crates, documented from the root workspace. - `pinned_overlap` README: the run line names the cuda-oxide root, like the other example READMEs. <details><summary>Implementation</summary> - Documentation sources only: 11 book pages, `conf.py` and four READMEs. No code, manifest or lockfile changes. - The tree and blob links already carried monorepo paths with the `cuda-oxide/` prefix; only the repository name changed. - Issue and PR permalinks, 18 lines in 15 files under `cuda-oxide/`, are untouched. - Code constants, the three `repository` manifest fields, the dependency-license table and the ICE message's issue URL move in #1489 and #1490. </details> ## Verification Checked at `e678f228`: - ✅ All 13 distinct link targets exist on `origin/main` (`git ls-tree`), tree links to directories and blob links to files. - ✅ `NVIDIA/cuda-rust` has Discussions enabled; `NVlabs/cuda-oxide` still redirects there. - ✅ `sphinx-build -W --keep-going -b html` (Sphinx 9.1.0, 41 pages) builds with no warnings; the rendered HTML has no non-permalink `NVlabs/cuda-oxide` URL left (24 in the book and READMEs on main before, 1 after, owned by #1489). - ✅ All 18 `scripts/check-*.sh` guards pass, including `check-source-references.sh`, `check-book-api-names.sh` and `check-host-api-paths.sh`. - ✅ `cargo test` for cargo-oxide, ptx-parse and ptx-schedule (243, 35 and 27 tests), clippy with `-D warnings`, rustdoc, `cargo oxide fmt --check` and `sync-example-locks.sh --check` pass. - ✅ `cargo oxide run pinned_overlap` on an RTX 5090 (sm_120a) prints its success marker; compute-sanitizer memcheck reports 0 errors. - ✅ A dry-run `cargo install --git` against a snapshot of this tree discovers `cargo-oxide` in the nested workspace. - ✅ From the monorepo root, `cargo oxide doctor` reports the stable 1.98.0 toolchain and `cargo oxide build vecadd` fails on nightly-only flags; from `cuda-oxide/` both succeed. The directory anchors were re-checked with the same book build and guards. ## Caveats - The 18 kept permalinks rely on GitHub's redirect, by policy. - No guard checks repository URLs; the link targets were verified by hand against `origin/main`. - The remaining `NVlabs/cuda-oxide` references live in cargo-oxide code constants, the three `repository` manifest fields, the dependency-license table and the ICE message, owned by #1489 and #1490. --------- Signed-off-by: Alejandro Soto Franco <sotofranco.eng@gmail.com> Signed-off-by: nihalpasham <nihalp@nvidia.com> Co-authored-by: nihalpasham <nihalp@nvidia.com>
nihalpasham
added a commit
that referenced
this pull request
Oct 15, 2026
…t source (#1488) ## What this adds `cargo oxide new` wrote a manifest that took `cuda-device` and `cuda-host` from the repository's git URL but `cuda-core` (and `cuda-async` with `--async`) from crates.io 0.4.0. `cuda-host` depends on `cuda-core` by path inside that checkout, so every scaffolded project resolved two `cuda-core` packages and the code `#[cuda_module]` generates failed to type-check. The templates now name every CUDA crate from the same git source, so cargo resolves one copy of each. ```text Before: cuda-host = { git = <repo> } cuda-core = "0.4.0" Cargo.lock: cuda-core x2 (registry + git), cuda-bindings x2, cuda-core-derive x2 error[E0308]: expected `cuda_core::simt::context::CudaContext`, found `CudaContext` 7 errors sync, 13 errors async; nothing runs After: cuda-host = { git = <repo> } cuda-core = { git = <repo> } cuda-async = { git = <repo> } Cargo.lock: cuda-core x1, cuda-bindings x1, cuda-core-derive x1, all at one commit PASSED: all 1024 elements correct ``` ```rust #[cuda_module] mod kernels { #[kernel] pub fn vecadd(a: &[f32], b: &[f32], mut c: DisjointSlice<f32>) { /* ... */ } } let module = unsafe { kernels::load(&ctx)? }; // generated code names cuda-host's CudaContext ``` ## What we fixed - Both templates take `cuda-core` and `cuda-async` from `GIT_REPO`, the source `cuda-host` comes from; `SHARED_HOST_CRATES_VERSION` is gone. - `check-shared-crate-pin.sh` section 3 requires `git = "{GIT_REPO}"` on every host-crate line in the templates and rejects a crates.io requirement there. - New test `scaffold_takes_every_cuda_crate_from_one_git_source` asserts every `cuda-*` line in both templates names the same git source as `cuda-device`. - The manifest comment and the status-guard step name that still described a crates.io scaffold now describe the git source. ## Scaffold dependency contract Every CUDA crate in a new project comes from one git source with no version requirement. The first build locks all of them to one commit of that repository, and `cargo update` moves them together. A crates.io `cuda-core` or `cuda-async` beside a git `cuda-host` is always a second crate and does not compile. <details><summary>Implementation</summary> - The regression began at bd6c3ce (#29, 2026-10-01), which moved `cuda-oxide` from crates.io `cuda-core` 0.3.1 onto the git-root path copies while the scaffold kept its crates.io constant; #1466 only dropped the `version = "=0.4.0"` qualifier. Lockfiles resolved at the commit before #29 hold one `cuda-core`; at #29, before #1466 and at #1466 they hold two. - Cargo identifies a package by name, version and source. A path dependency declared inside a git-sourced crate resolves to that git source, and nothing unifies it with a registry copy, so the scaffold has to name `cuda-core` from the source `cuda-host` uses. - This is the pre-#1102 form of the template minus `cuda-bindings`, which no user code names and which `cuda-core` pulls by path. - The failures are identity mismatches on `CudaContext`, `CudaModule`, `DeviceBuffer` and the `DriverError` closure: 6 E0308 plus 1 E0277 in the sync template; 9 E0308, 3 E0277 and 1 E0599 in the async one. - This supersedes the #1466 plan to derive the scaffold's version from the root manifests: with no version in the template there is nothing to derive. </details> ## Verification Checked at `180770a9`: - ✅ `cargo test -p cargo-oxide --all-targets`: 244 passed. With the old template lines restored and the new tests kept, 3 scaffold tests fail. - ✅ `cargo clippy -p cargo-oxide --all-targets -- -D warnings`, `cargo fmt --check` and rustdoc with `-D warnings` clean. - ✅ All 18 `check-*.sh` guards pass. `check-shared-crate-pin.sh` rejects four reintroduced forms (`cuda-core = "0.4.0"`, `{ version = "0.4.0" }`, a different git URL, `cuda-async = "0.4.0"`) with exit 1. - ✅ Baseline: main's `cargo oxide new` for both templates fails to build, 7 and 13 errors, with two `cuda-core`, `cuda-bindings` and `cuda-core-derive` per lockfile (and two `cuda-async`). - ✅ Fix: `cargo oxide new` then `cargo oxide run` for both templates on an RTX 5090 (sm_120a, CUDA 13.4): `PASSED: all 1024 elements correct`, `compute-sanitizer --tool memcheck` 0 errors, one `cuda-core` per lockfile and zero registry `cuda-*` packages. Same result on the author's RTX 5060 Laptop (sm_120, CUDA 13.3). - ✅ Merges cleanly with #1489 in either order; after both, every template line names `https://github.com/NVIDIA/cuda-rust.git`. ## Caveats - The test and guard compare the git URL only. A `rev`, `branch` or `tag` added to one line still resolves a second `cuda-core`, even at the same commit; a follow-up tightens the comparison to the full source. - No CI job compiles a scaffolded project, which is how the broken template survived from 2026-10-01; a scaffold compile gate is a separate follow-up. - The GPU runs used a cached backend; the standalone backend build from the scaffold's git checkout is unchanged by this PR and was not re-run here. - `GIT_REPO` still names `NVlabs/cuda-oxide`, which GitHub redirects; #1489 renames it. Closes #1459. --------- Signed-off-by: Alejandro Soto Franco <sotofranco.eng@gmail.com> Signed-off-by: nihalpasham <nihalp@nvidia.com> Co-authored-by: nihalpasham <nihalp@nvidia.com>
Collaborator
|
Checked at
|
nihalpasham
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
cargo oxide newwrites the repository address ofcuda-deviceandcuda-hostinto every new project's manifest, and the backend fallback clone fetches the same address when no cuda-oxide dependency pins a commit. Both still named the pre-moveNVlabs/cuda-oxiderepository, which resolves only through GitHub's redirect and leaves every new lockfile recording the old source. Both now nameNVIDIA/cuda-rust.What we fixed
GIT_REPOinscaffold.rs, interpolated into both scaffold templates, now readshttps://github.com/NVIDIA/cuda-rust.git.git clone --depth 1inbackend.rs, used only for projects with no cuda-oxide dependency, clones the same address.backend_source.rsmodule diagram, its test constant and the matching README diagram follow: the checkout iscuda-rust-<hash>, and the backend crate and the toolchain pin sit undercuda-oxide/in it.git = "https://github.com/NVIDIA/cuda-rust.git"lines in both templates and rejects the old address.Implementation
dependency_source_from_metadatakeys on the package name andmanifest_path,git_source_revkeeps only the#<sha>fragment, andcheckout_rootwalks up to the first directory holdingCargo.tomlplus the codegen crate, bounded by.gitor.cargo-ok.codegen_crate_in_checkoutpreferscuda-oxide/crates/rustc-codegen-cudaand falls back to the historical flatcrates/rustc-codegen-cuda;pinned_channelwalks from the codegen crate upward, so the component nightly wins over the stable pin at the git root. The same two functions serve the fallback clone.source-rev.txt), not by URL, so cached backends and existing projects are unaffected.NVlabs/cuda-oxide/issues/96in the README stays, per the repository guide.Verification
Checked at
746d60eb:cargo test -p cargo-oxide --all-targets: 243 passed; 244 with the new URL test.cargo clippy -p cargo-oxide --all-targets -- -D warnings,cargo fmt --check, rustdoc with-D warnings, and all 18scripts/check-*.shguards pass.grep -rn NVlabs crates/cargo-oxide/srcreturns nothing; the remaining hits are the README install line (docs(cuda-oxide): link the book and crate READMEs to NVIDIA/cuda-rust #1491) and the Tracking: Tile-to-SIMT Interop (cuda-oxide as SIMT participant) #96 permalink.CARGO_HOME:cargo oxide newwrites the new address in both templates;cargo generate-lockfilerecordsgit+https://github.com/NVIDIA/cuda-rust.git#bc46b1ffforcuda-device,cuda-hostandcuda-macrosin acuda-rust-*checkout;cargo oxide buildbuilds the backend from that checkout'scuda-oxide/crates/rustc-codegen-cudaunder nightly-2026-10-11 and caches it withsource-rev.txt = bc46b1ff.NVlabs/cuda-oxide.gitand resolves the same commit through the redirect;git ls-remoteon both URLs returns the same HEAD.NVIDIA/cuda-rustbuilds the backend offline from its nested codegen crate under the component nightly, which is the fallback route.Caveats
cuda-corecrates in its graph; that is fix(cargo-oxide): take the scaffold's host crates from cuda-host's git source #1488's fix and is independent of the address.cargo oxiderefuses it;[patch."https://github.com/NVlabs/cuda-oxide.git"]pointing the crate at the new address collapses the graph to one source.repositoryfields and license CSV (fix(cuda-oxide): point repository metadata and the ICE report URL at NVIDIA/cuda-rust #1490).