GPU: keep clippy green without the diagnostics feature #491

Open
github-bot wants to merge 1 commit from github-bot/gh-491 into main AGit
Owner

@⁠iloveslopware on GitHub · 2026-11-25 01:30 UTC · original
iloveslopware:main-clippy-diagnostics → main · +3 −1 · 1 files · 1 commits · open

main's CI has been red since c96b4f2 (run 45525228245): the default-features clippy lane fails with

error: function `placed_filler_twins` is never used
   --> crates\victory-gpu\src\resource.rs:2053

The getter's only caller is the memory line in copystat, and that module compiles only under all(windows, feature = "diagnostics") — with default features there is no caller, and -D dead_code fails the build. The --all-features lane stays green, which is why only one lane went red.

The fix is the attribute this crate already uses for diagnostics-only items (shadow.rs:2962, pipeline.rs:86, pipeline/host.rs:323):

#[cfg(windows)]
#[cfg_attr(not(feature = "diagnostics"), allow(dead_code))]
pub(crate) fn placed_filler_twins() -> u64 {

Nothing else changes: --all-features behavior is identical, and the getter is still there for the diagnostics line.

Verification (cross-checked from Linux with clang-cl 23.1.5, the same command CI runs):

  • cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets --locked -- -D warnings — failed before with the error above, clean after;
  • the same with --all-features — clean before and after;
  • at this base victory-gpu does not compile on non-Windows targets — pre-existing since c96b4f2, unrelated to this attribute, and the subject of #449.

Disclosure: written with AI assistance (GLM via OpenCode) — the diagnosis follows the public CI log, and the fix and cross-verification were drafted and run with the tool. Reviewed and understood by the human submitting it.

**@⁠iloveslopware** on GitHub · 2026-11-25 01:30 UTC · [original](https://github.com/fxceless/victory-fork/pull/491) `iloveslopware:main-clippy-diagnostics` → `main` · +3 −1 · 1 files · 1 commits · open `main`'s CI has been red since c96b4f2 ([run 45525228245](https://github.com/fxceless/victory-fork/actions/runs/45525228245)): the default-features clippy lane fails with ``` error: function `placed_filler_twins` is never used --> crates\victory-gpu\src\resource.rs:2053 ``` The getter's only caller is the memory line in `copystat`, and that module compiles only under `all(windows, feature = "diagnostics")` — with default features there is no caller, and `-D dead_code` fails the build. The `--all-features` lane stays green, which is why only one lane went red. The fix is the attribute this crate already uses for diagnostics-only items (`shadow.rs:2962`, `pipeline.rs:86`, `pipeline/host.rs:323`): ```rust #[cfg(windows)] #[cfg_attr(not(feature = "diagnostics"), allow(dead_code))] pub(crate) fn placed_filler_twins() -> u64 { ``` Nothing else changes: `--all-features` behavior is identical, and the getter is still there for the diagnostics line. Verification (cross-checked from Linux with clang-cl 23.1.5, the same command CI runs): - `cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets --locked -- -D warnings` — failed before with the error above, clean after; - the same with `--all-features` — clean before and after; - at this base `victory-gpu` does not compile on non-Windows targets — pre-existing since c96b4f2, unrelated to this attribute, and the subject of #449. --- Disclosure: written with AI assistance (GLM via OpenCode) — the diagnosis follows the public CI log, and the fix and cross-verification were drafted and run with the tool. Reviewed and understood by the human submitting it.
c96b4f2 added placed_filler_twins for the memory line in copystat,
which compiles only on Windows with diagnostics on, so the default-
features clippy lane (the CI gate on main) sees no caller and fails
with -D dead_code. Mark it allowed-dead without the feature, the same
attribute shadow.rs, pipeline.rs and pipeline/host.rs already use for
diagnostics-only items.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:34 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 01:51 UTC · original

I independently checked this with the pinned Rust 1.98.1 toolchain, cross-targeting x86_64-pc-windows-msvc from Linux. The base c96b4f2b8365bf43d54ab074940923ef8267f4c6 failed on placed_filler_twins with -D dead-code. The PR head d28e0ddd1e142263b971a39323164ade3615303d passed workspace Clippy for all targets with warnings denied, both with the project's default features and with --all-features.

I used --features blake3/pure in both revisions to run the cross-check without Microsoft's ml64.exe. The source trees were unmodified. This covers the Windows-target lint regression. Native Windows CI and runtime tests were outside this check.

cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked --features blake3/pure -- -D warnings
cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked --features blake3/pure --all-features -- -D warnings
**@⁠avt0m4t48** on GitHub · 2026-11-25 01:51 UTC · [original](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7150031480) I independently checked this with the pinned Rust 1.98.1 toolchain, cross-targeting `x86_64-pc-windows-msvc` from Linux. The base `c96b4f2b8365bf43d54ab074940923ef8267f4c6` failed on `placed_filler_twins` with `-D dead-code`. The PR head `d28e0ddd1e142263b971a39323164ade3615303d` passed workspace Clippy for all targets with warnings denied, both with the project's default features and with `--all-features`. I used `--features blake3/pure` in both revisions to run the cross-check without Microsoft's `ml64.exe`. The source trees were unmodified. This covers the Windows-target lint regression. Native Windows CI and runtime tests were outside this check. ```sh cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked --features blake3/pure -- -D warnings cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked --features blake3/pure --all-features -- -D warnings ```
Author
Owner

@⁠iloveslopware on GitHub · 2026-11-25 02:31 UTC · original

Thanks for the independent check — and for writing down the blake3/pure route to a cross-target lint run without ml64.exe; that's a tidier recipe than the CC/AR clang-cl/llvm-ar overrides I used, for anyone without LLVM on PATH.

Scope note for the record: the PR is gating-only — #[cfg_attr(not(feature = "diagnostics"), allow(dead_code))] on placed_filler_twins, the same pattern copystat already uses; no behavior change on any target or feature set. Native CI still needs maintainer approval to run, as you say.

AI-assisted (GLM via OpenCode).

**@⁠iloveslopware** on GitHub · 2026-11-25 02:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7150824838) Thanks for the independent check — and for writing down the `blake3/pure` route to a cross-target lint run without `ml64.exe`; that's a tidier recipe than the `CC`/`AR` clang-cl/llvm-ar overrides I used, for anyone without LLVM on `PATH`. Scope note for the record: the PR is gating-only — `#[cfg_attr(not(feature = "diagnostics"), allow(dead_code))]` on `placed_filler_twins`, the same pattern `copystat` already uses; no behavior change on any target or feature set. Native CI still needs maintainer approval to run, as you say. AI-assisted (GLM via OpenCode).
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-25 12:43 UTC · original

On current main (9376fd6) this patch still merges and fixes placed_filler_twins, but CI's clippy now fails on two newer lints as well (sort_unstable_by_key in draw.rs, depth_written never read in indirect.rs), with and without --all-features. #642, #755 and #841 fix all three. Comparison: #642

**@⁠JRamos1993** on GitHub · 2026-11-25 12:43 UTC · [original](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7162762889) On current `main` (`9376fd6`) this patch still merges and fixes `placed_filler_twins`, but CI's clippy now fails on two newer lints as well (`sort_unstable_by_key` in draw.rs, `depth_written` never read in indirect.rs), with and without `--all-features`. #642, #755 and #841 fix all three. Comparison: https://git.gtahub.st/github/fxceless--victory-fork/pulls/642
Author
Owner

@⁠iloveslopware on GitHub · 2026-11-25 19:22 UTC · original

Rebased onto current main (d510ee4) — thanks @⁠JRamos1993 for the check. Re-verified against the new base:

  • the default-features cross-win clippy lane at d510ee4 still fails with placed_filler_twins never-used (2 hits — the copystat caller stays Windows+diagnostics-gated, so that lane sees no caller); on this branch it's 2 -> 0.
  • the other clippy failures at this base (is_multiple_of, contains_key+insert, depth_written, sort_unstable_by_key) are pre-existing on main — the inventory is identical without this patch — and are covered by #642/#755/#841, so this diff deliberately leaves them alone.

AI-assisted: the verification runs and this analysis were machine-assisted; the change and its rationale are as described.

**@⁠iloveslopware** on GitHub · 2026-11-25 19:22 UTC · [original](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7172200196) Rebased onto current `main` (`d510ee4`) — thanks @⁠JRamos1993 for the check. Re-verified against the new base: - the default-features cross-win clippy lane at `d510ee4` still fails with `placed_filler_twins` never-used (2 hits — the `copystat` caller stays Windows+diagnostics-gated, so that lane sees no caller); on this branch it's **2 -> 0**. - the other clippy failures at this base (`is_multiple_of`, `contains_key`+`insert`, `depth_written`, `sort_unstable_by_key`) are pre-existing on `main` — the inventory is identical without this patch — and are covered by #642/#755/#841, so this diff deliberately leaves them alone. AI-assisted: the verification runs and this analysis were machine-assisted; the change and its rationale are as described.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/resource.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/491/head:github-bot/gh-491'
git switch 'github-bot/gh-491'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-491'
git switch 'github-bot/gh-491'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-491'
git switch 'github-bot/gh-491'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-491'
git switch 'main'
git merge --squash 'github-bot/gh-491'
git switch 'main'
git merge --ff-only 'github-bot/gh-491'
git switch 'main'
git merge 'github-bot/gh-491'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.