Skip to content

refactor: lift shared host crates to the git root - #1369

Merged
roivanov merged 11 commits into
NVIDIA:mainfrom
roivanov:layout/host-crates
Oct 2, 2026
Merged

roivanov merged 11 commits into
NVIDIA:mainfrom
roivanov:layout/host-crates

Conversation

@roivanov

@roivanov roivanov commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Move cuda-bindings, cuda-core, cuda-core-derive, and cuda-async to the git root. The root workspace is only those four crates, with cutile package metadata inlined (edition 2021, version 0.4.0) so they do not inherit the Oxide nightly toolchain or edition 2024.
  • cuda-oxide/ is the SIMT workspace (Cargo.toml, Cargo.lock, rust-toolchain.toml). cutile-rs/ path-depends on ../cuda-* and no longer contains those crates. The root workspace excludes both nested trees.
  • The CUDA Oxide workspace pins those crates with version = "=0.4.0". The examples path-depend on the same directories at "0.4.0", so an example graph has one cuda_core. cargo oxide new still emits the crates.io form (SHARED_HOST_CRATES_VERSION, 0.4.0) for out-of-tree projects.
  • SIMT and book workflows path-filter on cuda-oxide/** and the host crates. The Tile workflow uses a job-level paths filter so copy-pr-bot pushes still run. CODEOWNERS is assigned by directory.
  • The git-root host workspace is checked with cargo deny --locked. Its deny.toml is a copy of cuda-oxide/deny.toml, so that run and the SIMT run share one policy.

Follows #1368. That pull request is the nest; this one is the host-crate split on top of it.

Test plan

  • /ok to test CI
  • check-shared-crate-pin.sh
  • cargo metadata --locked --no-deps for the root workspace, cuda-oxide/Cargo.toml, and an example

@roivanov
roivanov force-pushed the layout/host-crates branch 3 times, most recently from 7c371c8 to b16bdd7 Compare October 1, 2026 18:53
elibol
elibol previously approved these changes Oct 1, 2026

@elibol elibol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pin cuda-oxide's host crates to =0.4.0? This will save us if any breaking changes slip through versioning, and changes which impact both projects can be done relatively easily since both projects now live in the same repo.

Otherwise LGTM!

@roivanov

roivanov commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 8fa6f2b

Lift cuda-bindings, cuda-core, cuda-core-derive, and cuda-async out of
cutile-rs/ so both models share one copy. Path and workspace retargeting
follows in the next commit.
Update workspace members, CI, and developer tooling for the nested
SIMT tree. Search reserved-prefix literals under cuda-oxide/crates
after NVIDIA#1102 removed the root host crates. Keep CODEGEN_CRATE_SUBDIR
only in tests.

ci: match stacked PR bases with one glob per line

Oxide pull_request gates run for main, ci/**, and layout/** so stacked
private PRs do not need a new branch name in seven workflows. One
pattern per line keeps the conflict to a single added or removed line.

fix: restore paths after host-crate lift

Join the lifted crates to the root workspace with inlined cutile
metadata (edition 2021, 0.3.1). Nested cutile-rs path-depends on
../cuda-*; Oxide keeps the crates.io pin so example workspaces do not
see two cuda_core crates. Host-crate tests run from the git root.
Oxide rustdoc excludes the imported crates. PR gates also run when the
base is layout/cuda-oxide-crates.
Keep shared host crates on stable at the git root and move the SIMT workspace, lockfile, and rustc pin under cuda-oxide/ so Tile work no longer inherits nightly.
SIMT entry workflows skip when only cutile-rs changes; the Tile lane uses
job-level paths-filter with a copy-pr-bot safe fallback instead of
workflow-level paths on pull-request/<n> pushes.
Route cuda-oxide to the SIMT DRI, cutile-rs to the Tile DRI, shared host
crates to dual review, and remaining git-root files to the maintainer set.
…DIA#29)

cuda-host and the example workspaces now use the in-tree cuda-core /
cuda-async / cuda-bindings so rustc sees one copy. The CUDA Oxide
workspace requires those crates at exactly 0.4.0, so a 0.4.1 package
version does not match until the pin moves with it. cargo oxide new
still emits the crates.io form for standalone projects, and the examples
keep that form too. Exclude the nested SIMT and Tile workspaces from
the root workspace so their edition.workspace keys resolve correctly.

cutile_inter_kernel now path-depends on the imported tile crates, so
examples-compile keeps cutile-rs in its checkout; CARGO_INCREMENTAL=0
already covers the disk pressure that deletion was guarding against.

Keep the renamed interop import rustfmt-clean and publish fake LLVM test
tools atomically to avoid Linux ETXTBSY races in CI.
Host-crate CI runs cargo from the repository root, and rustup had no
toolchain to select after the Oxide nightly moved under cuda-oxide/.
Example locks that still named the crates.io host crates failed --locked.

The host clippy line is one YAML scalar, so cargo does not see a leading
space on --all-targets. cuda-core's f16 feature stays on the nightly
reactor job. Each rebuilt example lock names that example. Third-party
crates stay at the versions the manifests already resolved, and the
in-tree host and cutile crates stay path dependencies at 0.4.0.
cargo-deny 0.20 rejects --config after check, and 0.18 only accepts it there. Walk up to a git-root copy of cuda-oxide/deny.toml so the host lock, including cuda-async's loom dev-dependencies, stays under the SIMT policy.
@roivanov
roivanov force-pushed the layout/host-crates branch from 8fa6f2b to b546b3a Compare October 2, 2026 00:34
@roivanov

roivanov commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test b546b3a

@nihalpasham

Copy link
Copy Markdown
Collaborator

@roivanov The workspace split looks right to me. I found three remaining configuration issues:

  • cuda-oxide’s Nix flake still selects the root toolchain and tries to build cargo-oxide from the root workspace.
  • The shared editor configuration needs entries for cuda-oxide/Cargo.toml and cutile-rs/Cargo.toml.
  • cuda-oxide’s backend fallback reads the root stable toolchain pin instead of cuda-oxide’s required nightly.

I can push fixes for these directly to your branch, add regression coverage for the backend fallback, and rerun the relevant checks.

@roivanov

roivanov commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@roivanov The workspace split looks right to me. I found three remaining configuration issues:

  • cuda-oxide’s Nix flake still selects the root toolchain and tries to build cargo-oxide from the root workspace.
  • The shared editor configuration needs entries for cuda-oxide/Cargo.toml and cutile-rs/Cargo.toml.
  • cuda-oxide’s backend fallback reads the root stable toolchain pin instead of cuda-oxide’s required nightly.

I can push fixes for these directly to your branch, add regression coverage for the backend fallback, and rerun the relevant checks.

Please do @nihalpasham Thank you!

Build cargo-oxide from its nested workspace and nightly in the root Nix
flake, retain sibling host dependencies, and key the dependency cache on
the cuda-oxide lockfile. Link both product workspaces in rust-analyzer.

Resolve the backend toolchain from the selected backend toward its
checkout root so fallback clones do not pick the stable host toolchain.
Cover flat, nested, and split layouts and nearest-pin boundaries.

Signed-off-by: nihalpasham <nihalp@nvidia.com>
Store the project flake in cuda-oxide/nix/templates/default and use that
source directory for both nix flake init and the new-project app. This
avoids reading a generated derivation output during pure template
initialization and keeps both entry points on one template.

Use the canonical repository URL in generated projects and document how
to add the development environment to an existing project.

Signed-off-by: nihalpasham <nihalp@nvidia.com>
Move the Oxide Nix, container, lint, Markdown and attribution files into
cuda-oxide, with a local license copy and product-specific Git rules.
Keep the root configuration for shared crates and repository tooling.

Build the nested flake from the full source tree so sibling host crates
remain available. Mount the same full tree in the development container
while opening the cuda-oxide workspace. Update CI filters, checks and
documented commands for the relocated entry points.

Signed-off-by: nihalpasham <nihalp@nvidia.com>

@nihalpasham nihalpasham left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Roman! I’ve pushed and validated the cuda-oxide config and tooling fixes. I’ll take care of the standalone-project dependency fix and CI filter cleanup in a follow-up.

@roivanov
roivanov merged commit a0cc6cc into NVIDIA:main Oct 2, 2026
62 checks passed
@roivanov
roivanov deleted the layout/host-crates branch October 2, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants