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

Open
github-bot wants to merge 3 commits from github-bot/gh-86 into main AGit
Owner

@⁠harrisotiropoulos-jpg on GitHub · 2026-11-27 17:34 UTC · original
harrisotiropoulos-jpg:ci/main-green → main · +69 −37 · 30 files · 3 commits · open

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

**@⁠harrisotiropoulos-jpg** on GitHub · 2026-11-27 17:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/86) `harrisotiropoulos-jpg:ci/main-green` → `main` · +69 −37 · 30 files · 3 commits · open 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)
`cargo clippy --workspace --all-targets --locked -- -D warnings` (and the same
with --all-features) failed with about 45 errors, so every pull request's CI
was red whatever it changed. This makes both pass without changing what the
code does:

- clippy's own machine-applicable fixes (`cargo clippy --fix`): `% n == 0`
  as `is_multiple_of(n)` (the one divisor that comes from a setting,
  VICTORY_FRAMEGEN_CYCLE, is checked > 0 first), needless borrows and casts,
  `mem::replace(.., default)` as `mem::take`, `slice::from_ref`, a
  precedence parenthesis, an unused binding prefixed with `_`.
- sorts by a descending key as `sort_*_by_key(Reverse(..))` (same order;
  the stable sort stays stable); hex literals regrouped (same values);
  `drop(<Copy value>)` as `let _ =`; `contains_key` for `get(..).is_none()`
  in xmem tests; `if a { 8 } else { 8 }` in the replay tool as `8` (same
  value; maybe a typo for its author to look at).
- scoped `#[allow]`s, with a note, where a fix would change code others are
  working on: 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, the CLI's Command),
  too_many_arguments (two functions), wrong_self_convention (from_level),
  and a test's deliberate write after taking a pointer.

Includes #67 (merged in first), which fixes the two indirect budget tests.

Checked locally with CI's exact commands: both clippy steps exit 0;
`cargo test --workspace --locked` passes with 0 failures (victory-gpu 420
passed, 35 ignored); `cargo xtask policy --staged`: ok.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:42:19 +00:00
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-27 20:50 UTC · original

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.

**@⁠JoeY54** on GitHub · 2026-11-27 20:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/86#issuecomment-7227890159) 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.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/resource.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/86/head:github-bot/gh-86'
git switch 'github-bot/gh-86'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-86'
git switch 'github-bot/gh-86'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-86'
git switch 'github-bot/gh-86'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-86'
git switch 'main'
git merge --squash 'github-bot/gh-86'
git switch 'main'
git merge --ff-only 'github-bot/gh-86'
git switch 'main'
git merge 'github-bot/gh-86'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.