Chores: clippy -D warnings clean, xtask policy green, stable tests #154

Closed
dutch2005 wants to merge 8 commits from upstream-pr/154 into main
dutch2005 commented 2026-11-25 17:37:42 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T17:37:42Z.


Why

cargo clippy --workspace --all-targets --locked -- -D warnings failed on ten pre-existing victory-shader errors and more in victory-gpu; cargo test -p xtask failed because lower.rs is source, not a game asset. Two timing/global-state tests also flaked under load. This PR makes the full Windows toolchain green.

What

  • Fixes the ten shader lint errors (hex grouping, complex types via aliases, needless returns/borrows, u32::from, dead int_value).
  • cargo clippy --fix for machine-applicable GPU lints; documented crate-level allows for the fork's low-level unsafe/tuple-heavy code.
  • Corrects the diagnostics-only frame::wait binding (_wait vs wait), which broke --all-features.
  • xtask asset policy no longer applies its size limit to .rs source files; lower.rs remains source, as the README says.
  • Makes the write-watch and frame-tick tests order/timing independent.
  • To keep the branch green it also carries cherry-picks of #92 (wave64 WaveSize) and #93 (xmem whole-view fix + test). Drop them once those PRs merge.

Testing (RX 6700 XT, Windows 11, Rust 1.98.1)

  • cargo clippy --workspace --all-targets --locked -- -D warnings — passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — passed.
  • cargo test --workspace --locked -- --test-threads=1 — 563 passed, 0 failed.
  • cargo test -p xtask --locked — 4 passed, 0 failed.
  • Watch test: 0 failures in 30 repeated runs.

Notes

No game data on this machine; this is toolchain/test quality only.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6610170305 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/154). Originally posted by [dutch2005](https://github.com/dutch2005) on 2026-11-25T17:37:42Z. --- ## Why `cargo clippy --workspace --all-targets --locked -- -D warnings` failed on ten pre-existing `victory-shader` errors and more in `victory-gpu`; `cargo test -p xtask` failed because `lower.rs` is source, not a game asset. Two timing/global-state tests also flaked under load. This PR makes the full Windows toolchain green. ## What - Fixes the ten shader lint errors (hex grouping, complex types via aliases, needless returns/borrows, `u32::from`, dead `int_value`). - `cargo clippy --fix` for machine-applicable GPU lints; documented crate-level allows for the fork's low-level unsafe/tuple-heavy code. - Corrects the diagnostics-only `frame::wait` binding (`_wait` vs `wait`), which broke `--all-features`. - xtask asset policy no longer applies its size limit to `.rs` source files; `lower.rs` remains source, as the README says. - Makes the write-watch and frame-tick tests order/timing independent. - To keep the branch green it also carries cherry-picks of #92 (wave64 `WaveSize`) and #93 (xmem whole-view fix + test). Drop them once those PRs merge. ## Testing (RX 6700 XT, Windows 11, Rust 1.98.1) - `cargo clippy --workspace --all-targets --locked -- -D warnings` — passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` — passed. - `cargo test --workspace --locked -- --test-threads=1` — **563 passed, 0 failed**. - `cargo test -p xtask --locked` — 4 passed, 0 failed. - Watch test: 0 failures in 30 repeated runs. ## Notes No game data on this machine; this is toolchain/test quality only.
KernelSmoker commented 2026-11-25 17:52:30 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by KernelSmoker on 2026-11-25T17:52:30Z.


Additional validation on PR head 4d11f00: both Clippy commands passed in the pinned Rust 1.98.1 Fedora 45 container, cross-targeting x86_64-pc-windows-gnu:

  • cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnu --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnu --locked -- -D warnings

This confirms the lint cleanup on the Windows GNU target; it is not a native Windows/MSVC CI run.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7170120787 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/154#issuecomment-7170120787). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-25T17:52:30Z. --- Additional validation on PR head `4d11f00`: both Clippy commands passed in the pinned Rust 1.98.1 Fedora 45 container, cross-targeting `x86_64-pc-windows-gnu`: - `cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnu --locked -- -D warnings` - `cargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnu --locked -- -D warnings` This confirms the lint cleanup on the Windows GNU target; it is not a native Windows/MSVC CI run.
adrianmjim commented 2026-11-25 18:57:16 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by adrianmjim on 2026-11-25T18:57:16Z.


Checked head 4d11f00 on an RX 7900 XT (Windows 11 build 26300, Rust 1.98.1, MSVC), with separate target dirs. I did not run the game.

KernelSmoker found both clippy commands passing on the GNU target. They also pass here on MSVC. cargo test --workspace --locked -- --test-threads=1 gives 563 passed, 0 failed, as in the description.

Three problems:

  1. .cargo/config.toml loses the [alias] xtask line. The policy check itself passes (cargo run -p xtask -- policy reports "asset policy: 184 files ok"). But cargo xtask policy fails with error: no such command: xtask, and the same goes for the README's cargo xtask install-hooks and for the pre-commit hook (cargo xtask policy --staged). This was found on #93 and fixed there in 011020b. This branch carries #93 only up to 30132fc, so that fix is missing. cargo test -p xtask still passes, so it does not catch the missing alias.

  2. Clippy is clean on this PR's base (71652a2) but not after merging current main. I merged it locally onto main 000ffdd; there were no conflicts:

    • cargo clippy --workspace --all-targets --locked -- -D warnings fails with function layout is never used at crates/victory-gpu/src/watch.rs:297.
    • The --all-features run fails with two casting to the same type is unnecessary (usize -> usize) at crates/victory-gpu/src/copystat.rs:145.
      Both come from main's 0434b3a. Clippy stops at victory-gpu, so the crates after it were not linted in the merged tree.
  3. The crate-level #![allow(clippy::undocumented_unsafe_blocks)] in victory-gpu and victory-hle disables a lint the workspace turns on deliberately ([workspace.lints.clippy] undocumented_unsafe_blocks = "warn"). These are the two crates with most of the unsafe code. too_many_arguments and type_complexity are also disabled for the whole of victory-gpu. #52 makes victory-gpu clippy-clean with per-item allows and SAFETY comments instead.

Overlap with other open PRs:

  • The victory-shader changes address the same ten lints as #3.
  • Exempting all .rs files from the size limit is an alternative to splitting lower.rs (#84, #72). That choice is the maintainer's.
  • The watch-test change overlaps #115 and #112.
<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7171626199 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/154#issuecomment-7171626199). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-25T18:57:16Z. --- Checked head 4d11f00 on an RX 7900 XT (Windows 11 build 26300, Rust 1.98.1, MSVC), with separate target dirs. I did not run the game. KernelSmoker found both clippy commands passing on the GNU target. They also pass here on MSVC. `cargo test --workspace --locked -- --test-threads=1` gives 563 passed, 0 failed, as in the description. Three problems: 1. `.cargo/config.toml` loses the `[alias] xtask` line. The policy check itself passes (`cargo run -p xtask -- policy` reports "asset policy: 184 files ok"). But `cargo xtask policy` fails with `error: no such command: xtask`, and the same goes for the README's `cargo xtask install-hooks` and for the pre-commit hook (`cargo xtask policy --staged`). This was found on #93 and fixed there in 011020b. This branch carries #93 only up to 30132fc, so that fix is missing. `cargo test -p xtask` still passes, so it does not catch the missing alias. 2. Clippy is clean on this PR's base (71652a2) but not after merging current main. I merged it locally onto main 000ffdd; there were no conflicts: - `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with `function layout is never used` at `crates/victory-gpu/src/watch.rs:297`. - The `--all-features` run fails with two `casting to the same type is unnecessary (usize -> usize)` at `crates/victory-gpu/src/copystat.rs:145`. Both come from main's 0434b3a. Clippy stops at `victory-gpu`, so the crates after it were not linted in the merged tree. 3. The crate-level `#![allow(clippy::undocumented_unsafe_blocks)]` in `victory-gpu` and `victory-hle` disables a lint the workspace turns on deliberately (`[workspace.lints.clippy] undocumented_unsafe_blocks = "warn"`). These are the two crates with most of the unsafe code. `too_many_arguments` and `type_complexity` are also disabled for the whole of `victory-gpu`. #52 makes `victory-gpu` clippy-clean with per-item allows and SAFETY comments instead. Overlap with other open PRs: - The `victory-shader` changes address the same ten lints as #3. - Exempting all `.rs` files from the size limit is an alternative to splitting `lower.rs` (#84, #72). That choice is the maintainer's. - The watch-test change overlaps #115 and #112.

Pull request closed

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
Belobug/VIctory-Belobug-AMD!154
No description provided.