GPU: guard non-positive frame counts and test copystat #2067
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2069"
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 fuzeofficlal on 2026-11-25T04:20:39Z.
Closes #919.
Summary
framesinputs incopystat::logto1.0so per-frame averages never formatNaNorinfwhile still draining counters, snapshots, and copy-range maps.parse_modefor deterministicVICTORY_COPY_MODEunit testing.Testing
crates/victory-gpu/src/copystat.rsverifying counter array length alignment,parse_mode, range/snapshot accumulation and draining,NaN/inf-free log formatting across0.0,-3.0,NAN, and±INFINITY, and process memory queries.cargo test -p victory-gpu --features diagnostics --locked copystat,cargo clippy, andcargo xtask policy.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:26:33Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Non-positive frame counts guarded + copystat test — validation hardening on the copy path.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:41:41Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-gpu --features diagnostics --lib copystat::— 4 passed, 0 failedcargo clippy -p victory-gpu --features diagnostics --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean non-positive frame-count guard and unit test coverage for
copystat. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:25:00Z.
Triage verdict — Keep the diagnostic guard, isolate the global-state regression (
98dd74f)Evidence
mainand checks the formatted output rather than treating a floating-point divide as a panic. The older PR closed without merging. Current guard · Prior maintainer feedbackChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:41:55Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
98dd74f.cargo test -p victory-gpu --locked: 141 passed, 2 failed, 2 ignored. The 2 are #1744's heap-cap failures onmain. The new tests aren't in this run, becausecopystatiscfg(all(windows, feature = "diagnostics")).--features diagnostics -- copystat: 4 passed (counter_enum_matches_array_length,parse_mode_maps_known_and_unknown_values,process_memory_queries_succeed,range_and_snapshot_accumulate_and_log_guards_invalid_frames).Same as
mainon this hardware. Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T05:00:37Z.
Updated in
9fe73dfe— thanks @jeremygold02. Encapsulated counter/range/snapshot state inStatsso unit tests exercise an isolatedStats::new()instance without racing concurrentdiagnosticsproducers on the process-wideSTATSsingleton.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:25:50Z.
Automated triage for the maintainers.
Proposed close: the guard is for a case that can't happen, and the rest is a refactor of a diagnostics-only module.
copystat::loghas one caller, in theframe()function ofvictory-gpu/src/host.rs. That function incrementscopy_stats_framesjust before it callslog, soframesis always at least 1. The same guard was the reason #1188 was closed.Statsstruct and add tests of the log formatting, all for a module that only builds with--features diagnostics. No behaviour changes.A bug in what
copystatmeasures would change this verdict. The PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T10:46:02Z.
Agreed with the triage analysis —
host.rs::frame()incrementscopy_stats_framesimmediately before callingcopystat::log, soframes == 0cannot occur onmain. Closing to keep the review queue focused.Pull request closed