Shaders: the two clippy errors that stop main's clippy in lower.rs #1517

Manually merged
github merged 1 commit from github-bot/gh-1517 into main 2026-11-29 08:20:53 +00:00 AGit
Owner

@⁠babuakhil on GitHub · 2026-11-28 21:10 UTC · original
babuakhil:fix/shader-clippy → main · +1 −3 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

On main (77df871), clippy stops at two errors in crates/victory-shader/src/emit/lower.rs, before it reaches the other crates:

error: unused variable: `colour`        --> lower.rs (store_outputs)
error: manual checked division          --> lower.rs (the LDS wait tally)

The change (2 lines, no behaviour change)

  • colour in the output stores: two merged PRs each made one. The outer let colour = self.s.pixel && matches!(e.target, Target::Color(_)); is never read: the let colour = is_ps && el.kind == 16; made per element a few lines down shadows it and is what decides the NaN scrub and HDR clamp. The outer one goes; what runs is unchanged. (If the outer definition was the intended one, that is a separate choice; this keeps current behaviour.)
  • LDS wait tally: if per == 0 { 0 } else { spare / per } → spare.checked_div(per).unwrap_or(0), the same value.

Tested

Windows 11, Rust 1.98.1 (pinned):

  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: passes
  • cargo test -p victory-shader --lib --locked: 348 passed, 0 failed (on 923e38c; rebased cleanly onto 77df871)

CI will still be red, and why

With victory-shader building, clippy goes on and reports the errors these two were hiding in victory-gpu:

  • three dropping_references in host.rs's present fallbacks: a real lock bug, fixed by #1459
  • unused items (send.rs gpu, pool.rs let_go, resource.rs host_pressure_reclaimed), identity_op (1 * MIB/GIB), too_many_arguments, a constant assertion, one manual_is_multiple_of

Those are left out on purpose: they are dead-code and style choices for the owners of that code. The policy failure (lower.rs over 640 KiB) is #1429 / #1460.

🤖 Generated with Claude Code

**@⁠babuakhil** on GitHub · 2026-11-28 21:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517) `babuakhil:fix/shader-clippy` → `main` · +1 −3 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC On `main` (`77df871`), clippy stops at two errors in `crates/victory-shader/src/emit/lower.rs`, before it reaches the other crates: ```text error: unused variable: `colour` --> lower.rs (store_outputs) error: manual checked division --> lower.rs (the LDS wait tally) ``` ## The change (2 lines, no behaviour change) - **`colour` in the output stores:** two merged PRs each made one. The outer `let colour = self.s.pixel && matches!(e.target, Target::Color(_));` is never read: the `let colour = is_ps && el.kind == 16;` made per element a few lines down shadows it and is what decides the NaN scrub and HDR clamp. The outer one goes; what runs is unchanged. (If the outer definition was the intended one, that is a separate choice; this keeps current behaviour.) - **LDS wait tally:** `if per == 0 { 0 } else { spare / per }` → `spare.checked_div(per).unwrap_or(0)`, the same value. ## Tested Windows 11, Rust 1.98.1 (pinned): - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: passes - `cargo test -p victory-shader --lib --locked`: 348 passed, 0 failed (on `923e38c`; rebased cleanly onto `77df871`) ## CI will still be red, and why With `victory-shader` building, clippy goes on and reports the errors these two were hiding in `victory-gpu`: - three `dropping_references` in `host.rs`'s present fallbacks: a real lock bug, fixed by #1459 - unused items (`send.rs` `gpu`, `pool.rs` `let_go`, `resource.rs` `host_pressure_reclaimed`), `identity_op` (`1 * MIB`/`GIB`), `too_many_arguments`, a constant assertion, one `manual_is_multiple_of` Those are left out on purpose: they are dead-code and style choices for the owners of that code. The policy failure (`lower.rs` over 640 KiB) is #1429 / #1460. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- `store_outputs`: the outer `colour` is never read; the one made per
  element a few lines down shadows it and is what decides the NaN
  scrub, so nothing changes.
- The LDS wait tally: `spare.checked_div(per).unwrap_or(0)` for the
  hand-written zero check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:13:36 +00:00
Author
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 22:33 UTC · original

The victory-gpu findings you left out are now in #665, redone on d4b5d517:

  • the two diagnostics-only readers get copystat's cfg;
  • send::Memory's unread gpu field goes;
  • the test identity_ops and the constant assertion are fixed;
  • one is_multiple_of;
  • two too_many_arguments allows, as 32 other functions have.

There are no behaviour changes, and #1459's three drops stay with #1459.

Checked locally on d4b5d517 with this PR, #1459, #665 and #1493 merged (#1460 would do for the size limit): CI's three steps pass. Both clippy runs are clean with -D warnings, and cargo test --workspace --locked gives 1,306 passed, 0 failed.

**@⁠kibagami-nc** on GitHub · 2026-11-28 22:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517#issuecomment-7246814027) The `victory-gpu` findings you left out are now in #665, redone on d4b5d517: - the two diagnostics-only readers get `copystat`'s cfg; - `send::Memory`'s unread `gpu` field goes; - the test `identity_op`s and the constant assertion are fixed; - one `is_multiple_of`; - two `too_many_arguments` allows, as 32 other functions have. There are no behaviour changes, and #1459's three drops stay with #1459. Checked locally on d4b5d517 with this PR, #1459, #665 and #1493 merged (#1460 would do for the size limit): CI's three steps pass. Both clippy runs are clean with `-D warnings`, and `cargo test --workspace --locked` gives 1,306 passed, 0 failed.
Author
Owner

@⁠babuakhil on GitHub · 2026-11-28 22:57 UTC · original

Thanks, that fits together. Confirmed here on Windows 11 (RTX 3060, Rust 1.98.1): d4b5d51 with this PR, #1459, #665 and #1493 merged in that order, no conflicts. CI's three steps:

Step Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 1306 passed, 0 failed (twice)

Also cargo test --workspace --locked --all-features: 1365 passed, 0 failed, so the diagnostics-only tests (#1294) are clean with the set too.

**@⁠babuakhil** on GitHub · 2026-11-28 22:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517#issuecomment-7247093669) Thanks, that fits together. Confirmed here on Windows 11 (RTX 3060, Rust 1.98.1): `d4b5d51` with this PR, #1459, #665 and #1493 merged in that order, no conflicts. CI's three steps: | Step | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 1306 passed, 0 failed (twice) | Also `cargo test --workspace --locked --all-features`: 1365 passed, 0 failed, so the diagnostics-only tests (#1294) are clean with the set too.
github manually merged commit d5cadc493d into main 2026-11-29 08:20:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1517
No description provided.