GPU: guard non-positive frames and add unit tests for copystat.rs #1188

Closed
github-bot wants to merge 1 commit from gh-pr/1188/head into gh-pr/1188/base
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:22 UTC · original
geiyiliyabumo:test/gpu-copystat-tests → main · +88 −5 · 1 files · 1 commits · closed without merging

Summary

Closes #919

Full verification details and change notes are documented in #919 (commit 6765a7b, based on main ffe310e).

 crates/victory-gpu/src/copystat.rs | 93 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 88 insertions(+), 5 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1188) `geiyiliyabumo:test/gpu-copystat-tests` → `main` · +88 −5 · 1 files · 1 commits · closed without merging ### Summary Closes #919 Full verification details and change notes are documented in #919 (commit `6765a7b`, based on `main` `ffe310e`). ```text crates/victory-gpu/src/copystat.rs | 93 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 5 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:58 +00:00
github-bot closed this pull request 2026-11-26 04:22:58 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 17:25 UTC · original

Ran the new copystat tests at 6765a7b:

Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

cargo test -p victory-gpu --features diagnostics copystat
5 passed; 0 failed; 0 ignored      (exit 0)

All five pass: counters against the array length, mode parsing for known and unknown values, range accumulation and separation, drain behaviour, and the page-fault query against the current process.

One note that cost me a run and may help others: copystat is only compiled on Windows with --features diagnostics (mod copystat; is gated in lib.rs), so a plain cargo test -p victory-gpu lists none of these tests.

They are unit-level tests, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on this PR yet.

Not tested: a title run that actually drives these counters (no game data here), RDNA2/RDNA4 and Intel GPUs.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it with --features diagnostics, ran the tests, wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-24 17:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1188#issuecomment-7139162960) Ran the new `copystat` tests at `6765a7b`: Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` cargo test -p victory-gpu --features diagnostics copystat 5 passed; 0 failed; 0 ignored (exit 0) ``` All five pass: counters against the array length, mode parsing for known and unknown values, range accumulation and separation, drain behaviour, and the page-fault query against the current process. One note that cost me a run and may help others: `copystat` is only compiled on Windows with `--features diagnostics` (`mod copystat;` is gated in `lib.rs`), so a plain `cargo test -p victory-gpu` lists none of these tests. They are unit-level tests, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on this PR yet. Not tested: a title run that actually drives these counters (no game data here), RDNA2/RDNA4 and Intel GPUs. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it with `--features diagnostics`, ran the tests, wrote this report; no game data was used.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 6765a7b: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1188#issuecomment-7140022640) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 6765a7b: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:34 UTC · original

Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.

Merges textually but its test counter_enum_matches_array_length fails on main (TexChanged is variant 21, COUNTERS is 52 since today's commits). The guard it adds is for an f64 division, which cannot panic.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/1188#issuecomment-7148650352) Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today. Merges textually but its test counter_enum_matches_array_length fails on main (TexChanged is variant 21, COUNTERS is 52 since today's commits). The guard it adds is for an f64 division, which cannot panic. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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/Marvisak--VIctory!1188
No description provided.