Clippy gate: the eleven findings main's clippy cannot reach yet #1566

Open
RedLynx22 wants to merge 1 commit from upstream-pr/1566 into main
RedLynx22 commented 2026-11-28 21:48:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RedLynx22 on 2026-11-28T21:48:46Z.


What this fixes

main's CI fails on its own pushes (the last eleven pushes on main are red, and the
Clippy, diagnostics build and Tests steps end up skipped, so no pull request gets a
signal). The visible failure is two findings in
crates/victory-shader/src/emit/lower.rs — #1517 clears exactly those. What nobody can
see is that clippy stops there: once victory-shader compiles, victory-gpu has eleven more
findings under -D warnings, nine in the lib and five more in its test target.

This pull request covers those eleven, which no open pull request addresses:

finding site
dead code: field gpu never read host/send.rs:112
dead code: pool::let_go never used pool.rs:96
dead code: resource::host_pressure_reclaimed never used resource.rs:3062
too_many_arguments (8/7) resource.rs:2058 (first_upload_decision)
too_many_arguments (8/7) streamline/fsr.rs:525 (before_present)
manual_is_multiple_of streamline.rs:2217
identity_op residency.rs:257, resource.rs:5805, :5874, :5913
assertions_on_constants resource.rs:5919

The three dropping_references findings in host.rs:10800, :10843 and :10903 are
#1459's, and are left alone here.

How

  • pool::let_go and resource::host_pressure_reclaimed are read only from copystat.rs,
    and that module is #[cfg(all(windows, feature = "diagnostics"))]. They now carry
    #[cfg_attr(not(feature = "diagnostics"), allow(dead_code))], the form this crate already
    uses (pool.rs:218, resource.rs:3149), so the counters keep being written and the
    diagnostics build keeps reading them.
  • The two eight-argument functions keep their signatures — first_upload_decision takes
    every input as a parameter on purpose so a decision can be replayed against a log line in
    a test — and say so in a comment under #[allow(clippy::too_many_arguments)].
  • n % 120 == 0 becomes n.is_multiple_of(120); four 1 * MIB / 1 * GIB become the
    constant; the assertion on a constant becomes const { assert!(…) }.
  • Memory::gpu is annotated as held for a log that does not read it yet.

No behaviour changes: no path is added, removed or reordered; the diff is 18 insertions and
6 deletions across six files, all of them annotations, a cfg_attr, and no-op simplifications
in tests.

How it was tested

rust-toolchain.toml's pinned 1.98.1 on Windows 11 (26200), RTX 4080 SUPER, everything with
--locked, against upstream/main (923e38c):

  • cargo clippy --workspace --all-targets --locked -- -D warnings → exit 0, with #1517's
    two lower.rs findings and #1459's three drop(presentation) changes applied beside this
    branch. Without them, the only findings left are exactly those five — this branch does not
    touch lower.rs or host.rs.
  • cargo clippy --workspace --all-targets --locked --all-features -- -D warnings → exit 0
    (the diagnostics build, which compiles copystat and faultbook).
  • cargo test --workspace --locked on this branch alone → 1305 tests pass, 0 failures
    (victory-gpu 550, victory-shader 348, victory-formats 57, victory-hle 201, the rest
    smaller). The single failure is the pre-existing xtask
    policy::tests::repository_passes_policy:
    crates/victory-shader/src/emit/lower.rs: 667380 bytes exceeds the 655360-byte limit,
    which is #1429 and is handled by #1493 (raise the limit) or #1460 (split the lowering
    tests). cargo xtask policy on this branch reports that violation and nothing else.

So with #1517 + #1459 + this, both clippy steps go green; the Tests step additionally needs
#1493 or #1460.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544897765 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566). Originally posted by [RedLynx22](https://github.com/RedLynx22) on 2026-11-28T21:48:46Z. --- ## What this fixes `main`'s CI fails on its own pushes (the last eleven pushes on `main` are red, and the *Clippy, diagnostics build* and *Tests* steps end up `skipped`, so no pull request gets a signal). The visible failure is two findings in `crates/victory-shader/src/emit/lower.rs` — **#1517** clears exactly those. What nobody can see is that clippy stops there: once `victory-shader` compiles, `victory-gpu` has eleven more findings under `-D warnings`, nine in the lib and five more in its test target. This pull request covers those eleven, which no open pull request addresses: | finding | site | | --- | --- | | dead code: field `gpu` never read | `host/send.rs:112` | | dead code: `pool::let_go` never used | `pool.rs:96` | | dead code: `resource::host_pressure_reclaimed` never used | `resource.rs:3062` | | `too_many_arguments` (8/7) | `resource.rs:2058` (`first_upload_decision`) | | `too_many_arguments` (8/7) | `streamline/fsr.rs:525` (`before_present`) | | `manual_is_multiple_of` | `streamline.rs:2217` | | `identity_op` | `residency.rs:257`, `resource.rs:5805`, `:5874`, `:5913` | | `assertions_on_constants` | `resource.rs:5919` | The three `dropping_references` findings in `host.rs:10800`, `:10843` and `:10903` are **#1459**'s, and are left alone here. ## How - `pool::let_go` and `resource::host_pressure_reclaimed` are read only from `copystat.rs`, and that module is `#[cfg(all(windows, feature = "diagnostics"))]`. They now carry `#[cfg_attr(not(feature = "diagnostics"), allow(dead_code))]`, the form this crate already uses (`pool.rs:218`, `resource.rs:3149`), so the counters keep being written and the diagnostics build keeps reading them. - The two eight-argument functions keep their signatures — `first_upload_decision` takes every input as a parameter on purpose so a decision can be replayed against a log line in a test — and say so in a comment under `#[allow(clippy::too_many_arguments)]`. - `n % 120 == 0` becomes `n.is_multiple_of(120)`; four `1 * MIB` / `1 * GIB` become the constant; the assertion on a constant becomes `const { assert!(…) }`. - `Memory::gpu` is annotated as held for a log that does not read it yet. No behaviour changes: no path is added, removed or reordered; the diff is 18 insertions and 6 deletions across six files, all of them annotations, a `cfg_attr`, and no-op simplifications in tests. ## How it was tested `rust-toolchain.toml`'s pinned 1.98.1 on Windows 11 (26200), RTX 4080 SUPER, everything with `--locked`, against `upstream/main` (`923e38c`): - `cargo clippy --workspace --all-targets --locked -- -D warnings` → **exit 0**, with #1517's two `lower.rs` findings and #1459's three `drop(presentation)` changes applied beside this branch. Without them, the only findings left are exactly those five — this branch does not touch `lower.rs` or `host.rs`. - `cargo clippy --workspace --all-targets --locked --all-features -- -D warnings` → **exit 0** (the `diagnostics` build, which compiles `copystat` and `faultbook`). - `cargo test --workspace --locked` on this branch alone → **1305 tests pass, 0 failures** (`victory-gpu` 550, `victory-shader` 348, `victory-formats` 57, `victory-hle` 201, the rest smaller). The single failure is the pre-existing `xtask` `policy::tests::repository_passes_policy`: `crates/victory-shader/src/emit/lower.rs: 667380 bytes exceeds the 655360-byte limit`, which is **#1429** and is handled by #1493 (raise the limit) or #1460 (split the lowering tests). `cargo xtask policy` on this branch reports that violation and nothing else. So with #1517 + #1459 + this, both clippy steps go green; the *Tests* step additionally needs #1493 or #1460.
RedLynx22 commented 2026-11-29 04:23:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RedLynx22 on 2026-11-29T04:23:28Z.


Rebased onto main at 568c5e5 and re-measured with the pinned 1.98.1, --locked:

  • cargo clippy --workspace --all-targets --locked -- -D warnings on main alone: one finding, manual_checked_div at lower.rs:2356 — that is #1517's.
  • With #1517's line applied beside this branch: the only findings left are the three dropping_references in host.rs — #1459's. Both clippy variants (-D warnings and --all-features) exit 0 with this branch + #1517 + #1459.
  • The eleven findings this branch fixes are all still on main: the dead gpu field, pool::let_go, resource::host_pressure_reclaimed, the two argument-count findings (one is now 9/7, the other 8/7), manual_is_multiple_of, the four identity_ops and the constant assertion.

Note on the Tests step: lower.rs has grown to 711,512 bytes against the 655,360-byte limit, so the step still needs #1493 (raise the limit to 768 KiB) or #1460 (move the lowering tests out, which brings it back under). Nothing here touches that file.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250623517 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566#issuecomment-7250623517). Originally posted by [RedLynx22](https://github.com/RedLynx22) on 2026-11-29T04:23:28Z. --- Rebased onto `main` at `568c5e5` and re-measured with the pinned 1.98.1, `--locked`: - `cargo clippy --workspace --all-targets --locked -- -D warnings` on `main` alone: **one** finding, `manual_checked_div` at `lower.rs:2356` — that is #1517's. - With #1517's line applied beside this branch: the only findings left are the three `dropping_references` in `host.rs` — **#1459**'s. Both clippy variants (`-D warnings` and `--all-features`) exit 0 with this branch + #1517 + #1459. - The eleven findings this branch fixes are all still on `main`: the dead `gpu` field, `pool::let_go`, `resource::host_pressure_reclaimed`, the two argument-count findings (one is now 9/7, the other 8/7), `manual_is_multiple_of`, the four `identity_op`s and the constant assertion. Note on the *Tests* step: `lower.rs` has grown to **711,512 bytes** against the 655,360-byte limit, so the step still needs #1493 (raise the limit to 768 KiB) or #1460 (move the lowering tests out, which brings it back under). Nothing here touches that file.
trustno1-coder commented 2026-11-29 08:28:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:16Z.


Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253125151 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566#issuecomment-7253125151). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-29T08:28:16Z. --- Thank you! An earlier version of this pull request was merged into main with its original commits and is part of [v2026.11.29.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.01), where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
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/1566:upstream-pr/1566'
git switch 'upstream-pr/1566'

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/1566'
git switch 'upstream-pr/1566'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1566'
git switch 'upstream-pr/1566'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1566'
git switch 'main'
git merge --squash 'upstream-pr/1566'
git switch 'main'
git merge --ff-only 'upstream-pr/1566'
git switch 'main'
git merge 'upstream-pr/1566'
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
trustno1-coder/VIctory-NVIDIA!1566
No description provided.