GPU: guard non-positive frames and add unit tests for copystat.rs #919
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#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?
@geiyiliyabumo on GitHub · 2026-11-24 14:09 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 06:59 UTC · original
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