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

Merged
babuakhil merged 1 commit from upstream-pr/1517 into main 2026-11-29 08:16:56 +00:00
babuakhil commented 2026-11-28 21:10:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T21:10:03Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544601405 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517). Originally posted by [babuakhil](https://github.com/babuakhil) on 2026-11-28T21:10:03Z. --- 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)
kibagami-nc commented 2026-11-28 22:33:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T22:33:01Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246814027 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517#issuecomment-7246814027). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T22:33:01Z. --- 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.
babuakhil commented 2026-11-28 22:57:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T22:57:01Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247093669 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1517#issuecomment-7247093669). Originally posted by [babuakhil](https://github.com/babuakhil) on 2026-11-28T22:57:01Z. --- 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.
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
trustno1-coder/VIctory-NVIDIA!1517
No description provided.