GPU: keep clippy green without the diagnostics feature #491

Open
iloveslopware wants to merge 1 commit from upstream-pr/491 into main
iloveslopware commented 2026-11-25 01:30:27 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iloveslopware on 2026-11-25T01:30:27Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6595036820 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/491). Originally posted by [iloveslopware](https://github.com/iloveslopware) on 2026-11-25T01:30:27Z. --- `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.
avt0m4t48 commented 2026-11-25 02:10:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T01:51:07Z.


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
<!-- greyfinch-sync:fxceless/victory-fork:comment:7150031480 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7150031480). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T01:51:07Z. --- 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 ```
iloveslopware commented 2026-11-25 03:06:34 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iloveslopware on 2026-11-25T02:31:04Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7150824838 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7150824838). Originally posted by [iloveslopware](https://github.com/iloveslopware) on 2026-11-25T02:31:04Z. --- 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).
JRamos1993 commented 2026-11-25 13:06:03 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T12:43:17Z.


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://github.com/fxceless/victory-fork/pull/642#issuecomment-7162762368

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162762889 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7162762889). Originally posted by [JRamos1993](https://github.com/JRamos1993) on 2026-11-25T12:43:17Z. --- 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://github.com/fxceless/victory-fork/pull/642#issuecomment-7162762368
iloveslopware commented 2026-11-25 20:09:25 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iloveslopware on 2026-11-25T19:22:14Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7172200196 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/491#issuecomment-7172200196). Originally posted by [iloveslopware](https://github.com/iloveslopware) on 2026-11-25T19:22:14Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/491:upstream-pr/491'
git switch 'upstream-pr/491'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/491'
git switch 'upstream-pr/491'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/491'
git switch 'upstream-pr/491'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/491'
git switch 'main'
git merge --squash 'upstream-pr/491'
git switch 'main'
git merge --ff-only 'upstream-pr/491'
git switch 'main'
git merge 'upstream-pr/491'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!491
No description provided.