refactor: lift shared host crates to the git root - #1369
Conversation
7c371c8 to
b16bdd7
Compare
elibol
left a comment
There was a problem hiding this comment.
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!
|
/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.
8fa6f2b to
b546b3a
Compare
|
/ok to test b546b3a |
|
@roivanov The workspace split looks right to me. I found three remaining configuration issues:
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>
Summary
cuda-bindings,cuda-core,cuda-core-derive, andcuda-asyncto 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.version = "=0.4.0". The examples path-depend on the same directories at"0.4.0", so an example graph has onecuda_core.cargo oxide newstill emits the crates.io form (SHARED_HOST_CRATES_VERSION,0.4.0) for out-of-tree projects.cuda-oxide/**and the host crates. The Tile workflow uses a job-level paths filter so copy-pr-bot pushes still run.CODEOWNERSis assigned by directory.cargo deny --locked. Itsdeny.tomlis a copy ofcuda-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 testCIcheck-shared-crate-pin.shcargo metadata --locked --no-depsfor the root workspace,cuda-oxide/Cargo.toml, and an example