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

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

@⁠RedLynx22 on GitHub · 2026-11-28 21:48 UTC · original
RedLynx22:ci-green-main → main · +18 −6 · 6 files · 1 commits · open

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** on GitHub · 2026-11-28 21:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566) `RedLynx22:ci-green-main` → `main` · +18 −6 · 6 files · 1 commits · open ## 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.
Main's clippy step stops at crates/victory-shader/src/emit/lower.rs, so
every finding after it stays hidden: victory-gpu has eleven more under
-D warnings, nine in the lib and five more in its test target.

The diagnostics getters pool::let_go and resource::host_pressure_reclaimed
are read only by copystat, which is compiled under feature = "diagnostics",
so they are allowed where that feature is off, in the cfg_attr form this
crate already uses. The two eight-argument functions say in a comment why
every piece stays a parameter. The modulo becomes is_multiple_of, the
tests' 1 * MIB and the assertion on a constant lose their no-ops, and the
send memory's gpu address is named as held for a log line that does not
read it yet.

No behaviour changes: no path is added, removed or reordered.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:54:09 +00:00
github-bot force-pushed github-bot/gh-1566 from c846fcbe57 to f6e5110bd2 2026-11-29 04:26:49 +00:00 Compare
Author
Owner

@⁠RedLynx22 on GitHub · 2026-11-29 04:23 UTC · original

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.

**@⁠RedLynx22** on GitHub · 2026-11-29 04:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566#issuecomment-7250623517) 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.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 08:28 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-11-29 08:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1566#issuecomment-7253125151) 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 has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/send.rs
  • crates/victory-gpu/src/pool.rs
  • crates/victory-gpu/src/residency.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/streamline/fsr.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/1566/head:github-bot/gh-1566'
git switch 'github-bot/gh-1566'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1566'
git switch 'github-bot/gh-1566'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1566'
git switch 'github-bot/gh-1566'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1566'
git switch 'main'
git merge --squash 'github-bot/gh-1566'
git switch 'main'
git merge --ff-only 'github-bot/gh-1566'
git switch 'main'
git merge 'github-bot/gh-1566'
git push origin 'main'
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!1566
No description provided.