GPU: guard non-positive frames and add unit tests for copystat.rs #919
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T14:09:56Z.
Summary
Adds 5 deterministic unit tests for
crates/victory-gpu/src/copystat.rs(previously 0 tests) and guardslog(frames)against zero/non-finite frame counts so per-frame divisions never emitNaN/inf.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/gpu-copystat-testsgeiyiliyabumo/VIctory@6765a7b(based onmainffe310e)Changes (
crates/victory-gpu/src/copystat.rs)parse_mode(Option<&str>) -> u8for deterministicVICTORY_COPY_MODEparsing without mutating process env.log(frames: f64)to clamp non-positive / non-finiteframesto1.0.copystat::tests:counter_enum_matches_array_lengthparse_mode_maps_known_and_unknown_valuesrange_accumulates_same_key_and_separates_distinct_rangesadd_and_log_drain_counters_and_rangespage_faults_queries_current_processVerification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-gpu/src/copystat.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --features diagnostics --locked -- copystat::: 5 passed, 0 failedAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:59:43Z.
Automated triage for the maintainers.
The pull request for this branch, #1188, was reviewed and closed: on current
mainitscounter_enum_matches_array_lengthtest fails (the counter list incrates/victory-gpu/src/copystat.rshas grown), and the guard inlogprotects anf64division, which cannot panic (a zero frame count givesinf/NaNin a log line, nothing worse). If you still want these tests, a rebased PR against currentmainis welcome; whether to take them is for the maintainers.Generated by Claude Code