CI: cargo clippy --workspace --all-targets fails on main in victory-shader #1439

Open
opened 2026-11-27 06:40:29 +00:00 by n-romanovich · 2 comments
n-romanovich commented 2026-11-27 06:40:29 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by n-romanovich on 2026-11-27T06:40:29Z.


Summary

cargo clippy --workspace --all-targets --locked -- -D warnings currently fails on main (9a9091d) with 7 errors in victory-shader (lib test target), causing CI to fail on all PRs regardless of which crate they touch.

Failing Lints

  1. crates/victory-shader/src/emit/wave64_after_loop.rs:533 (clippy::precedence)

    lanes = std::array::from_fn(|i| fp32_reference(op, old[(i / 16 ^ 1) * 16], old[i]));
    

    Clippy flags i / 16 ^ 1 as potentially ambiguous operator precedence. Parenthesizing (i / 16) ^ 1 preserves the exact evaluation order (/ binds tighter than ^).

  2. crates/victory-shader/src/emit/valu_tests.rs:608-617 (clippy::double_comparisons, clippy::neg_cmp_op_on_partial_ord)
    Inside every_f32_comparison_answers_nans_as_ieee, the ieee reference closure checks all 16 v_cmp_<op>_f32 predicates:

    • 0x5 => a < b || a > b / 0xA => !(a < b || a > b) (clippy::double_comparisons)
    • 0x9 => !(a >= b), 0xB => !(a > b), 0xC => !(a <= b), 0xE => !(a < b) (clippy::neg_cmp_op_on_partial_ord)

    Clippy's suggested rewrites (a != b or flipping comparison operators) are not equivalent for f32 when a or b is NaN (e.g. a < b || a > b is false for NaN, whereas a != b is true; !(a >= b) is true for NaN, whereas a < b is false). The ieee closure needs #[allow(clippy::double_comparisons, clippy::neg_cmp_op_on_partial_ord)] rather than changing the predicates.

Reproduction

cargo clippy --workspace --all-targets --locked -- -D warnings
<!-- greyfinch-sync:fxceless/victory-fork:issue:6641433507 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1439). Originally posted by [n-romanovich](https://github.com/n-romanovich) on 2026-11-27T06:40:29Z. --- ### Summary `cargo clippy --workspace --all-targets --locked -- -D warnings` currently fails on `main` (`9a9091d`) with 7 errors in `victory-shader` (lib test target), causing CI to fail on all PRs regardless of which crate they touch. ### Failing Lints 1. **`crates/victory-shader/src/emit/wave64_after_loop.rs:533`** (`clippy::precedence`) ```rust lanes = std::array::from_fn(|i| fp32_reference(op, old[(i / 16 ^ 1) * 16], old[i])); ``` Clippy flags `i / 16 ^ 1` as potentially ambiguous operator precedence. Parenthesizing `(i / 16) ^ 1` preserves the exact evaluation order (`/` binds tighter than `^`). 2. **`crates/victory-shader/src/emit/valu_tests.rs:608-617`** (`clippy::double_comparisons`, `clippy::neg_cmp_op_on_partial_ord`) Inside `every_f32_comparison_answers_nans_as_ieee`, the `ieee` reference closure checks all 16 `v_cmp_<op>_f32` predicates: - `0x5 => a < b || a > b` / `0xA => !(a < b || a > b)` (`clippy::double_comparisons`) - `0x9 => !(a >= b)`, `0xB => !(a > b)`, `0xC => !(a <= b)`, `0xE => !(a < b)` (`clippy::neg_cmp_op_on_partial_ord`) Clippy's suggested rewrites (`a != b` or flipping comparison operators) are **not** equivalent for `f32` when `a` or `b` is `NaN` (e.g. `a < b || a > b` is `false` for `NaN`, whereas `a != b` is `true`; `!(a >= b)` is `true` for `NaN`, whereas `a < b` is `false`). The `ieee` closure needs `#[allow(clippy::double_comparisons, clippy::neg_cmp_op_on_partial_ord)]` rather than changing the predicates. ### Reproduction ```powershell cargo clippy --workspace --all-targets --locked -- -D warnings ```
CwWwWwW commented 2026-11-27 09:12:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T09:12:34Z.


A related second blocker in the same CI job, from an independent check of main 9a9091d:

The Tests step (cargo test --workspace --exclude victory-gpu) fails on the asset policy - xtask's repository_passes_policy - before it ever reaches the crate tests:

  • crates/victory-gpu/src/host.rs 571758 bytes
  • crates/victory-shader/src/emit/lower.rs 527045 bytes

both over the 524288-byte limit (cargo run -p xtask -- policy -> 2 violations; cargo test -p xtask -> policy::tests::repository_passes_policy FAILED). So fixing the Clippy step alone will not make CI green: the policy also needs a fix, e.g. #1361 (2 MiB ceiling for Rust source files) or #1357 (moving the test modules out).

For reference, #1322 combines the Rust-source ceiling with the host test split; a merge simulation of that branch onto 9a9091d in a scratch worktree is clean, gives cargo xtask policy -> asset policy: 245 files ok, cargo test -p xtask 6/6, cargo check --workspace --all-targets clean, victory-gpu 242 passed and victory-shader 252 passed (details: https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7214357383).

(Independent verification, synthetic/offline only; no game data.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7214407375 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1439#issuecomment-7214407375). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T09:12:34Z. --- A related second blocker in the same CI job, from an independent check of main `9a9091d`: The Tests step (`cargo test --workspace --exclude victory-gpu`) fails on the asset policy - xtask's `repository_passes_policy` - before it ever reaches the crate tests: - `crates/victory-gpu/src/host.rs` 571758 bytes - `crates/victory-shader/src/emit/lower.rs` 527045 bytes both over the 524288-byte limit (`cargo run -p xtask -- policy` -> 2 violations; `cargo test -p xtask` -> `policy::tests::repository_passes_policy` FAILED). So fixing the Clippy step alone will not make CI green: the policy also needs a fix, e.g. #1361 (2 MiB ceiling for Rust source files) or #1357 (moving the test modules out). For reference, #1322 combines the Rust-source ceiling with the host test split; a merge simulation of that branch onto `9a9091d` in a scratch worktree is clean, gives `cargo xtask policy` -> `asset policy: 245 files ok`, `cargo test -p xtask` 6/6, `cargo check --workspace --all-targets` clean, `victory-gpu` 242 passed and `victory-shader` 252 passed (details: https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7214357383). (Independent verification, synthetic/offline only; no game data.)
CwWwWwW commented 2026-11-27 09:19:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T09:19:58Z.


End-to-end verification of the complete CI path, on a scratch branch based on 9a9091d (offline; this host has only the windows-gnu toolchain, so the MSVC-only hle-probe fixture is the one thing that cannot run here - CI's windows-latest covers it):

Applied to main in order: our 5 open fix commits (ae849df, 804ec39, a2020cb, f7dba22, 8b9c6e6 - #1444, #1445, #1446, #1447, #1448) plus #1322's policy-ceiling commit (73e19bb). They cherry-pick cleanly, no conflicts.

With that branch:

  • cargo run -p xtask -- policy -> asset policy: 235 files ok (the Tests-step policy test passes)
  • cargo clippy --workspace --all-targets -- -D warnings with only #1440's three lint groups allowed (precedence, double_comparisons, neg_cmp_op_on_partial_ord) -> clean, i.e. #1440's fix is the remaining piece
  • cargo test --workspace --exclude victory-gpu -- --skip loads_binds_and_calls_probe -> 21/21 suites green (the skipped test is the MSVC-only hle-probe fixture; everything else, including xtask's policy test, passes)
  • cargo test -p victory-gpu --lib -- --test-threads=1 -> 243 passed, 0 failed, 7 ignored
  • per-crate clippy for victory-hle/victory-loader/victory-gpu: clean

So #1440 + #1322 (or #1361/#1357 for the policy half) + our five PRs is a verified path to a green CI on main. No external code was used; the branch was built for verification only and is not pushed.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7214554524 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1439#issuecomment-7214554524). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T09:19:58Z. --- End-to-end verification of the complete CI path, on a scratch branch based on `9a9091d` (offline; this host has only the windows-gnu toolchain, so the MSVC-only hle-probe fixture is the one thing that cannot run here - CI's windows-latest covers it): Applied to main in order: our 5 open fix commits (`ae849df`, `804ec39`, `a2020cb`, `f7dba22`, `8b9c6e6` - #1444, #1445, #1446, #1447, #1448) plus #1322's policy-ceiling commit (`73e19bb`). They cherry-pick cleanly, no conflicts. With that branch: - `cargo run -p xtask -- policy` -> `asset policy: 235 files ok` (the Tests-step policy test passes) - `cargo clippy --workspace --all-targets -- -D warnings` with only #1440's three lint groups allowed (`precedence`, `double_comparisons`, `neg_cmp_op_on_partial_ord`) -> clean, i.e. #1440's fix is the remaining piece - `cargo test --workspace --exclude victory-gpu -- --skip loads_binds_and_calls_probe` -> 21/21 suites green (the skipped test is the MSVC-only hle-probe fixture; everything else, including xtask's policy test, passes) - `cargo test -p victory-gpu --lib -- --test-threads=1` -> 243 passed, 0 failed, 7 ignored - per-crate clippy for victory-hle/victory-loader/victory-gpu: clean So #1440 + #1322 (or #1361/#1357 for the policy half) + our five PRs is a verified path to a green CI on main. No external code was used; the branch was built for verification only and is not pushed.
Sign in to join this conversation.
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
fxceless/victory-fork#1439
No description provided.