Clippy -D warnings clean across the workspace (main's CI gate) #2048

Closed
github-bot wants to merge 13 commits from github-bot/gh-2048 into main AGit
Owner

@⁠eleboucher on GitHub · 2026-11-29 08:24 UTC · original
eleboucher:diag-mb → main · +9 −4 · 5 files · 13 commits · closed without merging

Fixes #

What it changes

cargo build -p victory --features diagnostics on main (4d98ca87) stops with 4 + 3 errors:

  • copystat.rs: the "memory, windows cut nearer" line (from the windows-take merge) calls mb(...), which does not exist in that function. It now has a local mb that turns bytes into MB, as the line's {:.0} MB expects.
  • host.rs (Host::submit): the local let mut timing = ... SubmissionTiming shadows the module's timing() switch, so the three if timing() further down called the Option<SubmissionTiming> (E0618: expected function). They now call self::timing(). No behaviour change.

How it was tested

  • GPU and profile: build only (Mac, cargo xwin for x86_64-pc-windows-msvc)
  • Before: cargo xwin check -p victory --features diagnostics fails with E0425 (mb) and E0618/E0277 (timing)
  • After: cargo xwin check -p victory --features diagnostics, -p victory-gpu --features diagnostics --all-targets and --workspace --all-targets all pass
  • Shader wave sizes: not touched
  • cargo test: not run

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none found

Update: the check job

check failed on this PR because main itself does not pass cargo clippy -- -D warnings at 829188e9 (first error: unwind_copy is never used, in victory-loader; then unused items and lints in victory-gpu and victory-hle). The branch now merges main and adds:

  • three commits from #2019, cherry-picked with their author (loader unwind_copy behind diagnostics, the victory-shader lints, the lane-read test returning without a hardware device);
  • GPU: clippy -D warnings clean and HLE: clippy -D warnings clean: unused imports and variables removed, test-only items behind #[cfg(test)], style lints applied where the result is the same.

Eight items that nothing calls any more are kept with #[allow(dead_code)] and a comment naming the commit that last touched their caller, for a maintainer to keep or delete: HostHeap::mirror_for_pass, MANY_CHUNK, fetch_buffer, create_loose_compute (with loose_compute, fspx_container, MAX_LOOSE_PART), lock_memory, wide_chunk, Shadow::nothing_new_with, recycle::Kind::Card.

Checked here: both CI clippy commands (with and without --all-features) and cargo check --workspace --all-targets exit 0 for x86_64-pc-windows-msvc. Not run here: cargo test.

If #2019 or #2208 lands first, the matching commits drop out on a rebase.

**@⁠eleboucher** on GitHub · 2026-11-29 08:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048) `eleboucher:diag-mb` → `main` · +9 −4 · 5 files · 13 commits · closed without merging Fixes # ## What it changes `cargo build -p victory --features diagnostics` on main (4d98ca87) stops with 4 + 3 errors: - `copystat.rs`: the "memory, windows cut nearer" line (from the windows-take merge) calls `mb(...)`, which does not exist in that function. It now has a local `mb` that turns bytes into MB, as the line's `{:.0} MB` expects. - `host.rs` (`Host::submit`): the local `let mut timing = ... SubmissionTiming` shadows the module's `timing()` switch, so the three `if timing()` further down called the `Option<SubmissionTiming>` (`E0618: expected function`). They now call `self::timing()`. No behaviour change. ## How it was tested - GPU and profile: build only (Mac, `cargo xwin` for x86_64-pc-windows-msvc) - Before: `cargo xwin check -p victory --features diagnostics` fails with E0425 (`mb`) and E0618/E0277 (`timing`) - After: `cargo xwin check -p victory --features diagnostics`, `-p victory-gpu --features diagnostics --all-targets` and `--workspace --all-targets` all pass - Shader wave sizes: not touched - `cargo test`: not run ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none found ## Update: the `check` job `check` failed on this PR because main itself does not pass `cargo clippy -- -D warnings` at 829188e9 (first error: `unwind_copy` is never used, in victory-loader; then unused items and lints in victory-gpu and victory-hle). The branch now merges main and adds: - three commits from #2019, cherry-picked with their author (loader `unwind_copy` behind `diagnostics`, the victory-shader lints, the lane-read test returning without a hardware device); - `GPU: clippy -D warnings clean` and `HLE: clippy -D warnings clean`: unused imports and variables removed, test-only items behind `#[cfg(test)]`, style lints applied where the result is the same. Eight items that nothing calls any more are kept with `#[allow(dead_code)]` and a comment naming the commit that last touched their caller, for a maintainer to keep or delete: `HostHeap::mirror_for_pass`, `MANY_CHUNK`, `fetch_buffer`, `create_loose_compute` (with `loose_compute`, `fspx_container`, `MAX_LOOSE_PART`), `lock_memory`, `wide_chunk`, `Shadow::nothing_new_with`, `recycle::Kind::Card`. Checked here: both CI clippy commands (with and without `--all-features`) and `cargo check --workspace --all-targets` exit 0 for `x86_64-pc-windows-msvc`. Not run here: `cargo test`. If #2019 or #2208 lands first, the matching commits drop out on a rebase.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 08:33:37 +00:00
Author
Owner

@⁠chaseb64 on GitHub · 2026-11-29 08:56 UTC · original

I built the exact submitted commit 0cd41e32 on native Windows using cargo build --offline --locked --profile diag --features diagnostics --package victory --jobs 7. The diagnostics build completed successfully in 1 minute 32 seconds.

I used OpenAI Codex to build and verify this revision.

**@⁠chaseb64** on GitHub · 2026-11-29 08:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7253434478) I built the exact submitted commit `0cd41e32` on native Windows using `cargo build --offline --locked --profile diag --features diagnostics --package victory --jobs 7`. The diagnostics build completed successfully in 1 minute 32 seconds. I used OpenAI Codex to build and verify this revision.
Author
Owner

@⁠Yoshi-233 on GitHub · 2026-11-29 09:57 UTC · original

I also checked the Windows GNU path while testing #1995. On main at 829188e96 the diagnostics build hit the missing mb helper and the shadowed timing calls. I applied the same two-file patch as 0cd41e32 to my local merge of #1995 with that main and built the Windows GPU test executable with diagnostics enabled.

I then ran the 15 ambient tests on Windows with the diffuse filter both disabled and enabled. Both runs passed (30 test executions), including the shader compile and hardware/WARP checks. This gives downstream coverage for the diagnostics build on an RTX 4070 Ti SUPER.

**@⁠Yoshi-233** on GitHub · 2026-11-29 09:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7254110819) I also checked the Windows GNU path while testing #1995. On main at `829188e96` the diagnostics build hit the missing `mb` helper and the shadowed `timing` calls. I applied the same two-file patch as `0cd41e32` to my local merge of #1995 with that main and built the Windows GPU test executable with diagnostics enabled. I then ran the 15 ambient tests on Windows with the diffuse filter both disabled and enabled. Both runs passed (30 test executions), including the shader compile and hardware/WARP checks. This gives downstream coverage for the diagnostics build on an RTX 4070 Ti SUPER.
Author
Owner

@⁠wildheathen on GitHub · 2026-11-29 10:22 UTC · original

Same result here on native Windows: 829188e9 with this patch (0cd41e32) builds with --profile diag -p victory --features diagnostics, where unpatched main stops at the missing mb and the shadowed timing. The diag build then ran a 3-minute session without problems: RTX 5080 16 GB (driver 621.24), 32 GB RAM, Windows 11 26300, Series X, DLSS Quality, 2560x1440.

**@⁠wildheathen** on GitHub · 2026-11-29 10:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7254386846) Same result here on native Windows: `829188e9` with this patch (`0cd41e32`) builds with `--profile diag -p victory --features diagnostics`, where unpatched main stops at the missing `mb` and the shadowed `timing`. The diag build then ran a 3-minute session without problems: RTX 5080 16 GB (driver 621.24), 32 GB RAM, Windows 11 26300, Series X, DLSS Quality, 2560x1440.
Author
Owner

@⁠Machad3x on GitHub · 2026-11-29 11:13 UTC · original

Confirmed on main 829188e9: cargo build --locked --profile diag -p victory --features diagnostics fails with 9 errors (E0425 mb in copystat.rs:1349-1352, E0618/E0277 from the local timing shadowing fn timing() in host.rs). An equivalent change (local mb closure, self::timing() at the 3 call sites) builds clean, exit 0, and produces target\diag\victory.exe. The same fix is also in #2208 (renames the fn to list_timing); one of the two can be closed. Related: #2164.

**@⁠Machad3x** on GitHub · 2026-11-29 11:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7254967827) Confirmed on main 829188e9: `cargo build --locked --profile diag -p victory --features diagnostics` fails with 9 errors (E0425 `mb` in copystat.rs:1349-1352, E0618/E0277 from the local `timing` shadowing `fn timing()` in host.rs). An equivalent change (local `mb` closure, `self::timing()` at the 3 call sites) builds clean, exit 0, and produces target\diag\victory.exe. The same fix is also in #2208 (renames the fn to `list_timing`); one of the two can be closed. Related: #2164.
Author
Owner

@⁠boraswim on GitHub · 2026-11-29 12:52 UTC · original

Ran the full CI on native Windows (rustc 1.98.1, x86_64-pc-windows-msvc) with an equivalent set of changes on top of 829188e9, since the PR notes cargo test was not run. Two notes, one of them a behaviour change:

1. slot_evict: busy is a lost check, not an unused variable. cf338ea ("Slot eviction: a slot another thread is making is not waited for") added it as

let idle = !busy && made.as_ref().is_some_and(|(host, _)| { ... });

and a later merge dropped the !busy &&. The comment just above the call still says the texture "is in use then, and stays". Renaming it to _ makes the loss permanent: a texture whose slot another thread is still making can be unstaged and retired. #2173 restores the check in the same lines, so if this lands after #2173 the _ undoes it. Suggest keeping busy and putting !busy && back (or leaving resource.rs to #2173).

2. highest_shader_model: _adapter. game_adapter() already returns the hardware_adapter() card, else adapter 0, so the function chooses the card twice. Using that adapter for D3D12CreateDevice, with the adapter-0 fallback only when that fails, makes the binding used and behaves the same. Minor, but _adapter hides that the #1035 comment and the code below it went out of step in a merge.

Test results (cargo test --workspace --locked --no-fail-fast):

  • The check failure here is only the three bcpack::tests::oracle_parity_* tests. They fail on main too, and #2236 fixes them (the test oracle still read the BC7 dictionary layout from before f9de61c). With #2236 applied: victory-formats 83 passed, 0 failed.
  • xtask policy::tests::repository_passes_policy still fails on main and with this PR: crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals. No open PR covers it: #2420.
  • Everything else passes, apart from flaky tests that pass when run alone: victory-hle xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it, and victory-gpu card_steps::tests::places_written_after_sending_are_learned and uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue.
  • cargo test -p victory-gpu --features diagnostics now compiles and shows one failure that was hidden while the diag build was broken: compose::tests::bgrx_plane_selects_a_typed_view (left DXGI_FORMAT(88), right DXGI_FORMAT(93)). CI does not run that configuration, so it does not block this PR.

Both clippy commands from ci.yml exit 0 here.

**@⁠boraswim** on GitHub · 2026-11-29 12:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7256130331) Ran the full CI on native Windows (rustc 1.98.1, x86_64-pc-windows-msvc) with an equivalent set of changes on top of 829188e9, since the PR notes `cargo test` was not run. Two notes, one of them a behaviour change: **1. `slot_evict`: `busy` is a lost check, not an unused variable.** `cf338ea` ("Slot eviction: a slot another thread is making is not waited for") added it as ```rust let idle = !busy && made.as_ref().is_some_and(|(host, _)| { ... }); ``` and a later merge dropped the `!busy &&`. The comment just above the call still says the texture "is in use then, and stays". Renaming it to `_` makes the loss permanent: a texture whose slot another thread is still making can be unstaged and retired. #2173 restores the check in the same lines, so if this lands after #2173 the `_` undoes it. Suggest keeping `busy` and putting `!busy &&` back (or leaving `resource.rs` to #2173). **2. `highest_shader_model`: `_adapter`.** `game_adapter()` already returns the `hardware_adapter()` card, else adapter 0, so the function chooses the card twice. Using that `adapter` for `D3D12CreateDevice`, with the adapter-0 fallback only when that fails, makes the binding used and behaves the same. Minor, but `_adapter` hides that the #1035 comment and the code below it went out of step in a merge. **Test results** (`cargo test --workspace --locked --no-fail-fast`): - The `check` failure here is only the three `bcpack::tests::oracle_parity_*` tests. They fail on main too, and #2236 fixes them (the test oracle still read the BC7 dictionary layout from before f9de61c). With #2236 applied: `victory-formats` 83 passed, 0 failed. - `xtask` `policy::tests::repository_passes_policy` still fails on main and with this PR: `crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals`. No open PR covers it: #2420. - Everything else passes, apart from flaky tests that pass when run alone: `victory-hle` `xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it`, and `victory-gpu` `card_steps::tests::places_written_after_sending_are_learned` and `uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue`. - `cargo test -p victory-gpu --features diagnostics` now compiles and shows one failure that was hidden while the diag build was broken: `compose::tests::bgrx_plane_selects_a_typed_view` (left `DXGI_FORMAT(88)`, right `DXGI_FORMAT(93)`). CI does not run that configuration, so it does not block this PR. Both clippy commands from `ci.yml` exit 0 here.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-29 13:28 UTC · original

@⁠boraswim thanks, both points were right.

  1. slot_evict: busy is back and the !busy && is restored, by cherry-picking #2173's commit 01bb7d7e (author kept), which also brings back fetch_buffer's step-down; my #[allow(dead_code)] on fetch_buffer is gone. If #2173 lands first, that commit drops out on a rebase.
  2. highest_shader_model: the device is now made on the adapter game_adapter() returns, with the adapter-0 fallback when that fails, so the card is chosen once.

Both clippy commands from ci.yml exit 0 here (Windows target type-check on a Mac); cargo test not run here. The remaining red check is the three bcpack oracle tests that #2236 fixes.

On #2048 vs #2208: same diagnostics fix; I'm fine with whichever the maintainer prefers. This branch also carries main's clippy clean-up, which #2208 does not.

**@⁠eleboucher** on GitHub · 2026-11-29 13:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7256560469) @⁠boraswim thanks, both points were right. 1. `slot_evict`: `busy` is back and the `!busy &&` is restored, by cherry-picking #2173's commit 01bb7d7e (author kept), which also brings back `fetch_buffer`'s step-down; my `#[allow(dead_code)]` on `fetch_buffer` is gone. If #2173 lands first, that commit drops out on a rebase. 2. `highest_shader_model`: the device is now made on the adapter `game_adapter()` returns, with the adapter-0 fallback when that fails, so the card is chosen once. Both clippy commands from `ci.yml` exit 0 here (Windows target type-check on a Mac); `cargo test` not run here. The remaining red check is the three `bcpack` oracle tests that #2236 fixes. On #2048 vs #2208: same diagnostics fix; I'm fine with whichever the maintainer prefers. This branch also carries main's clippy clean-up, which #2208 does not.
Author
Owner

@⁠boraswim on GitHub · 2026-11-29 13:42 UTC · original

Thanks. I ran the full CI on native Windows (rustc 1.98.1, x86_64-pc-windows-msvc) at this branch's head 77d47164, merged with #2236 (18eaf947):

  • cargo clippy --workspace --all-targets --locked -- -D warnings: exit 0
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: exit 0
  • cargo test --workspace --locked --no-fail-fast: every crate passes, including the three bcpack oracle tests with #2236 and victory-hle (the xmem flake is #2439). Two failures, neither from this branch:
    • xtask policy::tests::repository_passes_policy: frame_users.rs, #2420, also on main
    • victory-gpu watch::many_askers_tests::no_mapping_is_lost_between_askers: one of the parallel-run flakes listed in #2420 (914 passed, 1 failed)

So with #2236, the only thing left between main and a green check is the policy test.

**@⁠boraswim** on GitHub · 2026-11-29 13:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7256746299) Thanks. I ran the full CI on native Windows (rustc 1.98.1, x86_64-pc-windows-msvc) at this branch's head `77d47164`, merged with #2236 (`18eaf947`): - `cargo clippy --workspace --all-targets --locked -- -D warnings`: exit 0 - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: exit 0 - `cargo test --workspace --locked --no-fail-fast`: every crate passes, including the three `bcpack` oracle tests with #2236 and `victory-hle` (the xmem flake is #2439). Two failures, neither from this branch: - `xtask` `policy::tests::repository_passes_policy`: `frame_users.rs`, #2420, also on main - `victory-gpu` `watch::many_askers_tests::no_mapping_is_lost_between_askers`: one of the parallel-run flakes listed in #2420 (914 passed, 1 failed) So with #2236, the only thing left between main and a green `check` is the policy test.
github-bot changed title from Diagnostics build: missing MB helper in the windows-cut line, and timing() shadowed in submit to Clippy -D warnings clean across the workspace (main's CI gate) 2026-11-30 05:35:21 +00:00
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 05:32 UTC · original

The diagnostics-build fix this PR started with is in main as 41adb551. What is left here is the clippy cleanup that makes cargo clippy --workspace --all-targets --locked -- -D warnings (with and without --all-features) pass on main: 23 files, no behaviour change. The remaining red check is main's BC7 oracle tests (#2236), not this diff. Title updated to match.

**@⁠eleboucher** on GitHub · 2026-11-30 05:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7269768363) The diagnostics-build fix this PR started with is in main as 41adb551. What is left here is the clippy cleanup that makes `cargo clippy --workspace --all-targets --locked -- -D warnings` (with and without `--all-features`) pass on main: 23 files, no behaviour change. The remaining red check is main's BC7 oracle tests (#2236), not this diff. Title updated to match.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 14:58 UTC · original

Merged main (c71899d9). Main had already made almost all of this PR's clippy fixes, so main's side was taken in the 12 conflicting files. One new commit for warnings main added since, behaviour-neutral: the card-compare test's two card_pass calls get the new capture argument ([0; 3], as the other callers; main's tests did not compile), seed.is_multiple_of(3), the duplicate MB closure in copystat.rs removed (the later fn mb is used again), and #[allow(dead_code)] on Shadow::ranged (no caller since 8ab3c034) and the test-only Lowered::loop_caps. Both CI clippy commands (--workspace --all-targets --locked -D warnings, with and without --all-features) pass for the Windows target; victory-shader lib tests pass (332).

**@⁠eleboucher** on GitHub · 2026-11-30 14:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7282223370) Merged main (c71899d9). Main had already made almost all of this PR's clippy fixes, so main's side was taken in the 12 conflicting files. One new commit for warnings main added since, behaviour-neutral: the card-compare test's two `card_pass` calls get the new `capture` argument (`[0; 3]`, as the other callers; main's tests did not compile), `seed.is_multiple_of(3)`, the duplicate MB closure in copystat.rs removed (the later `fn mb` is used again), and `#[allow(dead_code)]` on `Shadow::ranged` (no caller since 8ab3c034) and the test-only `Lowered::loop_caps`. Both CI clippy commands (`--workspace --all-targets --locked -D warnings`, with and without `--all-features`) pass for the Windows target; victory-shader lib tests pass (332).
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 20:51 UTC · original

#4297 now covers what this PR set out to do: both Clippy passes on main (the same loop_caps, Shadow::ranged and is_multiple_of findings fixed here in 7ab1e6f4), plus the two victory-gpu tests that fail on this PR's CI run (list::thin::tests::bindings_record_no_work, shader_cache::tests::every_switch_of_the_translator_is_in_the_key). Those two failures are main's own stale tests, not this PR's change: #4297 edits exactly list/thin.rs and shader_cache.rs for them.

So one of the two is enough to review. #4297 is the more complete one; if it lands, I'll close this one.

**@⁠eleboucher** on GitHub · 2026-11-30 20:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7291565002) #4297 now covers what this PR set out to do: both Clippy passes on main (the same `loop_caps`, `Shadow::ranged` and `is_multiple_of` findings fixed here in 7ab1e6f4), plus the two `victory-gpu` tests that fail on this PR's CI run (`list::thin::tests::bindings_record_no_work`, `shader_cache::tests::every_switch_of_the_translator_is_in_the_key`). Those two failures are main's own stale tests, not this PR's change: #4297 edits exactly `list/thin.rs` and `shader_cache.rs` for them. So one of the two is enough to review. #4297 is the more complete one; if it lands, I'll close this one.
github-bot closed this pull request 2026-11-30 23:48:18 +00:00
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 23:45 UTC · original

Closing: #4297 (merged) covers this, the Clippy findings and the two stale victory-gpu tests.

**@⁠eleboucher** on GitHub · 2026-11-30 23:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2048#issuecomment-7295496409) Closing: #4297 (merged) covers this, the Clippy findings and the two stale victory-gpu tests.

Pull request closed

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!2048
No description provided.