Repository navigation
ci: nothing checks the formatting of the device-only fixture - #1027
Merged
Merged
Conversation
`crates/cuda-macros/tests/device-only` is a Cargo workspace of its own, and it
falls outside every formatting scope this job has:
* `cargo fmt --all` at the repository root stops at the workspace boundary;
* the `crates/rustc-codegen-cuda` step is a different workspace;
* the examples step globs `crates/rustc-codegen-cuda/examples/**/Cargo.toml`,
and the fixture lives under `crates/cuda-macros/tests/`.
`check-device-only-build.sh` runs `cargo check --locked` on it, so it compiles,
but nothing has ever run rustfmt over it.
That matters slightly more than for an ordinary fixture: this is the crate that
proves the NVIDIA#701/NVIDIA#702 property -- a kernel-only crate taking
`cuda-macros = { default-features = false }` needs no host surface and no
`cuda.h` -- so it is a file contributors will edit when that gating changes, and
the one file where a formatting drift would not be caught.
It is formatted correctly today, so this step fails nothing now. Verified both
directions:
clean tree new step passes
fixture deliberately
unformatted new step fails; `cargo fmt --all --check` at the root
still passes, which is the gap in one line
clippy has the same blind spot on this fixture plus three nested example
workspaces; that is a separate change to `clippy.yml` and does not touch this
file.
`fmt.yml` still parses, 5 steps.
Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
nihalpasham
pushed a commit
that referenced
this pull request
Aug 19, 2026
…checks (#1047) CONTRIBUTING tells contributors to run `cargo oxide fmt` rather than a bare `cargo fmt` for one stated reason: otherwise the gate "will fail on code you never had a chance to format." That only holds while the command covers what the gate covers, and since #1027 it does not. `.github/workflows/fmt.yml` checks four scopes: the root workspace, the codegen backend, `crates/cuda-macros/tests/device-only`, and every `Cargo.toml` under `examples/` via a `**` glob -- 225 manifests, nested ones included. `format_all` checked three: root, backend, and `cargo fmt --all` in each of the 215 top-level example directories. That misses exactly three manifests: * the device-only fixture, which is not under `examples/` at all and had no scope of its own here (the gate gained one in #1027) * `examples/cutile_inter_kernel/simt` * `examples/interop_cubin_identity/device` The last two are the only nested example manifests declaring their own `[workspace]`, so the parent's `cargo fmt --all` stops before reaching them. The other eight nested manifests are path-dependency members and were already covered. Measured, with one unformatted function appended to a file in each of the three: `cargo fmt --all` in `cutile_inter_kernel` and in `interop_cubin_identity` both exit 0, and `cargo oxide fmt --check` walked 185 scopes -- including both of those parents -- reporting no failure and never printing a fixture scope at all. The gate catches all three: the fixture step exits 1, and `cargo fmt --manifest-path` on each nested manifest exits 1. The examples loop becomes one `--manifest-path` run per manifest found, which is what the gate does, for the two reasons the gate's own comment gives: `--all` stops at a nested `[workspace]`, and `--all` also formats an example's path dependencies, so running it per example re-formats the large shared workspaces 215 times. That second point was expensive: the old implementation had not finished 185 of 217 scopes after roughly 25 minutes, while the new one covers all 228 in 19 seconds. The walk skips `target` and dot directories. The gate's glob does not need to -- a fresh checkout has no build directories -- but a working tree does, and a packaged or vendored manifest under one is not a crate this repository formats. A unit test covers the walk: nested manifests found, workspace members found, `target/` and dot directories skipped. Three documentation sites stated the old three-scope shape and are corrected: the function's own doc comment, CONTRIBUTING's formatting section (whose clippy paragraph also said "the same three scopes" -- clippy has more, since #1026), and the `cargo oxide fmt` comment in the book's CLI block. Verified: 228 scopes visited, matching the gate's four exactly; with the three probe files unformatted it reports exactly those three diffs and exits 1; on the clean tree it exits 0 in 19 seconds; and `cargo test -p cargo-oxide --all-targets` passes 177 tests with `clippy --all-targets -- -D warnings` clean. Signed-off-by: Vyncint Ng <[email protected]>
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.
Summary
crates/cuda-macros/tests/device-onlyis a Cargo workspace of its own, and it falls outside every formatting scope this job has:cargo fmt --allat the repository root stops at the workspace boundary;crates/rustc-codegen-cudastep is a different workspace;crates/rustc-codegen-cuda/examples/**/Cargo.toml, and the fixture lives undercrates/cuda-macros/tests/.check-device-only-build.shrunscargo check --lockedon it, so it compiles, but nothing has ever run rustfmt over it.That matters slightly more than for an ordinary fixture: this is the crate that proves the #701/#702 property — a kernel-only crate taking
cuda-macros = { default-features = false }needs no host surface and nocuda.h— so it is a file contributors will edit when that gating changes, and the one file where a formatting drift would not be caught.Testing
Local, no GPU. It is formatted correctly today, so this step fails nothing now. Verified both directions:
cargo fmt --all --checkat the root still passes — the gap in one lineclippy has the same blind spot on this fixture plus three nested example workspaces; that is a separate change to
clippy.ymland does not touch this file.fmt.ymlstill parses, 5 stepscargo oxide run <example>— not applicable