CI passes on main again: clippy clean in both CI configurations, tests green (includes #67), no behaviour change #86

Closed
harrisotiropoulos-jpg wants to merge 3 commits from upstream-pr/86 into main
harrisotiropoulos-jpg commented 2026-11-27 17:34:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by harrisotiropoulos-jpg on 2026-11-27T17:34:26Z.


CI fails on main right now, so every open pull request's CI fails too, whatever the PR changes:

  • both clippy steps (-D warnings) stop on about 45 errors, nearly all in victory-gpu;
  • cargo test --workspace fails 2 tests (indirect::tests::host_list_budget_starts_empty_at_each_submission, warp_batch_charges_every_execution).

This PR makes all three CI steps pass without changing what the code does.

What changed

  • Includes #67 (merged in first, unchanged): it fixes the two budget tests. If #67 is merged first, this PR's diff shrinks to the clippy part.
  • clippy's own fixes (cargo clippy --fix), each reviewed by hand:
    • x % n == 0 becomes x.is_multiple_of(n). The one divisor that comes from a setting (VICTORY_FRAMEGEN_CYCLE) is already checked > 0.
    • needless borrows and casts;
    • mem::replace(x, default) becomes mem::take;
    • slice::from_ref;
    • one precedence parenthesis;
    • an unused binding prefixed with _.
  • Manual changes, same behaviour:
    • descending sorts written as sort_*_by_key(Reverse(..)): same order, and the stable sort stays stable;
    • hex literals regrouped: same values;
    • drop(<Copy value>) becomes let _ =;
    • get(..).is_none() becomes !contains_key(..) in xmem tests.
  • replay/play/diverge.rs:1217: if s.kind == SRV { 8 } else { 8 } becomes 8. It's the same value, but the lines above it all differ between the two branches, so the original may be a typo. Worth a look by whoever wrote it.
  • Scoped #[allow]s, each with a note, where a "real" fix would delete or restructure code other open PRs touch:
    • unused items: host/indirects.rs, Touch::Title, placed_filler_twins, a test field, book.rs's held heap;
    • large_enum_variant: host.rs's Late (boxing it would add an allocation per flight) and the CLI's Command;
    • too_many_arguments on two functions;
    • wrong_self_convention on from_level;
    • a test's deliberate write after taking a pointer.

Checked locally, with CI's exact commands (Windows 11, toolchain 1.98.1)

  • 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: 0 failures (victory-gpu 420 passed, 35 ignored; the rest of the workspace passes too)
  • cargo xtask policy --staged: ok

Formatting is untouched: CI doesn't check it, and most files already differ from rustfmt.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5530738342 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/86). Originally posted by [harrisotiropoulos-jpg](https://github.com/harrisotiropoulos-jpg) on 2026-11-27T17:34:26Z. --- CI fails on `main` right now, so every open pull request's CI fails too, whatever the PR changes: - both clippy steps (`-D warnings`) stop on about 45 errors, nearly all in `victory-gpu`; - `cargo test --workspace` fails 2 tests (`indirect::tests::host_list_budget_starts_empty_at_each_submission`, `warp_batch_charges_every_execution`). This PR makes all three CI steps pass **without changing what the code does**. ### What changed - **Includes #67** (merged in first, unchanged): it fixes the two budget tests. If #67 is merged first, this PR's diff shrinks to the clippy part. - **clippy's own fixes** (`cargo clippy --fix`), each reviewed by hand: - `x % n == 0` becomes `x.is_multiple_of(n)`. The one divisor that comes from a setting (`VICTORY_FRAMEGEN_CYCLE`) is already checked `> 0`. - needless borrows and casts; - `mem::replace(x, default)` becomes `mem::take`; - `slice::from_ref`; - one precedence parenthesis; - an unused binding prefixed with `_`. - **Manual changes, same behaviour:** - descending sorts written as `sort_*_by_key(Reverse(..))`: same order, and the stable sort stays stable; - hex literals regrouped: same values; - `drop(<Copy value>)` becomes `let _ =`; - `get(..).is_none()` becomes `!contains_key(..)` in xmem tests. - **`replay/play/diverge.rs:1217`:** `if s.kind == SRV { 8 } else { 8 }` becomes `8`. It's the same value, but the lines above it all differ between the two branches, so the original may be a typo. Worth a look by whoever wrote it. - **Scoped `#[allow]`s, each with a note**, where a "real" fix would delete or restructure code other open PRs touch: - unused items: `host/indirects.rs`, `Touch::Title`, `placed_filler_twins`, a test field, `book.rs`'s held heap; - `large_enum_variant`: `host.rs`'s `Late` (boxing it would add an allocation per flight) and the CLI's `Command`; - `too_many_arguments` on two functions; - `wrong_self_convention` on `from_level`; - a test's deliberate write after taking a pointer. ### Checked locally, with CI's exact commands (Windows 11, toolchain 1.98.1) - `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`: 0 failures (victory-gpu 420 passed, 35 ignored; the rest of the workspace passes too) - `cargo xtask policy --staged`: ok Formatting is untouched: CI doesn't check it, and most files already differ from `rustfmt`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JoeY54 commented 2026-11-27 20:50:25 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JoeY54 on 2026-11-27T20:50:25Z.


Supplemental Windows / Rust 1.98.1 validation and two small follow-up fixes for integration with newer main.

PR head 388485b91f253032f2af7d530c977c6e6290de17 includes #67. Both workspace Clippy configurations pass at that head. The initial 8-thread workspace run had 1052 passed, 2 failed and 46 ignored: watch::tests::faults_that_take_no_lock_tell_the_same passed on isolated serial retry; modules::net::tests::only_loopback_is_reachable passed outside the execution sandbox. These retries are not a single green full run or proof of a PR regression.

Merging this PR into main e69e39c55b92f71a40ea3eadaa3439678df4e721 produced a single successful serial workspace run: 1064 passed, 0 failed, 46 ignored (cargo test --workspace --locked --no-fail-fast -- --test-threads=1 --nocapture). Both budget tests passed. Internally skipped optional paths are not claimed as covered; no game launch or assets were used.

That integration exposed two lints in newer main code, still present at f3534e6b09f113e369c3ade2a13ff3d711ce0cf1 and not covered by #265's changed-file list:

  • manual_is_multiple_of: use the equivalent block-length predicate (N = 2048).
  • items_after_test_module: move default_paths unchanged before the test module.

The patch below applies to the integration with newer main, not directly to this older PR head. After applying it, both cargo clippy --workspace --all-targets --locked -- -D warnings and the same command with --all-features pass. The two convolution unit tests and all 22 CLI tests pass; cargo xtask policy also passes. The 1064-test full run above was before these mechanical fixes; it was not repeated afterward. No lint suppressions or runtime behavior changes were added.

Sharing the small follow-up here for adoption by this PR's author, rather than opening a competing CI-cleanup PR.

diff --git a/apps/victory/src/main.rs b/apps/victory/src/main.rs
index e4517f8..60b39e3 100644
--- a/apps/victory/src/main.rs
+++ b/apps/victory/src/main.rs
@@ -468,6 +468,20 @@ fn show_config() -> Result<()> {
     Ok(())
 }
 
+/// Paths given on the command line, or the configured game + test titles.
+pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> {
+    if !paths.is_empty() {
+        return Ok(paths);
+    }
+    let cfg = victory_core::Config::load()?;
+    let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect();
+    anyhow::ensure!(
+        !all.is_empty(),
+        "no paths given and none configured (see victory.example.toml)"
+    );
+    Ok(all)
+}
+
 #[cfg(test)]
 mod tests {
     /// A D3D12Core.dll's VS_FIXEDFILEINFO: signature, structure version, then
@@ -491,17 +505,3 @@ mod tests {
         assert_eq!(super::agility_version(&core_bytes(1, 620)[..48]), None);
     }
 }
-
-/// Paths given on the command line, or the configured game + test titles.
-pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> {
-    if !paths.is_empty() {
-        return Ok(paths);
-    }
-    let cfg = victory_core::Config::load()?;
-    let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect();
-    anyhow::ensure!(
-        !all.is_empty(),
-        "no paths given and none configured (see victory.example.toml)"
-    );
-    Ok(all)
-}
diff --git a/crates/victory-hle/src/modules/dsp/convolve.rs b/crates/victory-hle/src/modules/dsp/convolve.rs
index 88311f4..ced4e8c 100644
--- a/crates/victory-hle/src/modules/dsp/convolve.rs
+++ b/crates/victory-hle/src/modules/dsp/convolve.rs
@@ -91,7 +91,7 @@ pub(super) struct Convolver {
 impl Convolver {
     /// `None` when the response is not in the layout described above.
     pub(super) fn new(ir: &[f32]) -> Option<Self> {
-        if ir.is_empty() || ir.len() % N != 0 {
+        if ir.is_empty() || !ir.len().is_multiple_of(N) {
             return None;
         }
         let mut blocks = ir.len() / N;

AI-assisted by OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7227890159 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/86#issuecomment-7227890159). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-27T20:50:25Z. --- Supplemental Windows / Rust 1.98.1 validation and two small follow-up fixes for integration with newer main. PR head `388485b91f253032f2af7d530c977c6e6290de17` includes #67. Both workspace Clippy configurations pass at that head. The initial 8-thread workspace run had 1052 passed, 2 failed and 46 ignored: `watch::tests::faults_that_take_no_lock_tell_the_same` passed on isolated serial retry; `modules::net::tests::only_loopback_is_reachable` passed outside the execution sandbox. These retries are not a single green full run or proof of a PR regression. Merging this PR into main `e69e39c55b92f71a40ea3eadaa3439678df4e721` produced a single successful serial workspace run: **1064 passed, 0 failed, 46 ignored** (`cargo test --workspace --locked --no-fail-fast -- --test-threads=1 --nocapture`). Both budget tests passed. Internally skipped optional paths are not claimed as covered; no game launch or assets were used. That integration exposed two lints in newer main code, still present at `f3534e6b09f113e369c3ade2a13ff3d711ce0cf1` and not covered by #265's changed-file list: - `manual_is_multiple_of`: use the equivalent block-length predicate (`N = 2048`). - `items_after_test_module`: move `default_paths` unchanged before the test module. The patch below applies to the integration with newer main, not directly to this older PR head. After applying it, both `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same command with `--all-features` pass. The two convolution unit tests and all 22 CLI tests pass; `cargo xtask policy` also passes. The 1064-test full run above was **before** these mechanical fixes; it was not repeated afterward. No lint suppressions or runtime behavior changes were added. Sharing the small follow-up here for adoption by this PR's author, rather than opening a competing CI-cleanup PR. ```diff diff --git a/apps/victory/src/main.rs b/apps/victory/src/main.rs index e4517f8..60b39e3 100644 --- a/apps/victory/src/main.rs +++ b/apps/victory/src/main.rs @@ -468,6 +468,20 @@ fn show_config() -> Result<()> { Ok(()) } +/// Paths given on the command line, or the configured game + test titles. +pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> { + if !paths.is_empty() { + return Ok(paths); + } + let cfg = victory_core::Config::load()?; + let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect(); + anyhow::ensure!( + !all.is_empty(), + "no paths given and none configured (see victory.example.toml)" + ); + Ok(all) +} + #[cfg(test)] mod tests { /// A D3D12Core.dll's VS_FIXEDFILEINFO: signature, structure version, then @@ -491,17 +505,3 @@ mod tests { assert_eq!(super::agility_version(&core_bytes(1, 620)[..48]), None); } } - -/// Paths given on the command line, or the configured game + test titles. -pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> { - if !paths.is_empty() { - return Ok(paths); - } - let cfg = victory_core::Config::load()?; - let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect(); - anyhow::ensure!( - !all.is_empty(), - "no paths given and none configured (see victory.example.toml)" - ); - Ok(all) -} diff --git a/crates/victory-hle/src/modules/dsp/convolve.rs b/crates/victory-hle/src/modules/dsp/convolve.rs index 88311f4..ced4e8c 100644 --- a/crates/victory-hle/src/modules/dsp/convolve.rs +++ b/crates/victory-hle/src/modules/dsp/convolve.rs @@ -91,7 +91,7 @@ pub(super) struct Convolver { impl Convolver { /// `None` when the response is not in the layout described above. pub(super) fn new(ir: &[f32]) -> Option<Self> { - if ir.is_empty() || ir.len() % N != 0 { + if ir.is_empty() || !ir.len().is_multiple_of(N) { return None; } let mut blocks = ir.len() / N; ``` AI-assisted by OpenAI Codex.
trustno1-coder commented 2026-11-28 18:27:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T18:27:28Z.


Thanks for this. I'm closing it without merging because it conflicts with the current main in the files it changes, and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request. Thanks for the work.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243804555 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/86#issuecomment-7243804555). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T18:27:28Z. --- Thanks for this. I'm closing it without merging because it conflicts with the current main in the files it changes, and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request. Thanks for the work.

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
trustno1-coder/VIctory-NVIDIA!86
No description provided.