GPU: copy statistics per frame count the frames since their last line #228
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!228
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-228"
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?
@Ingenioeren on GitHub · 2026-11-26 05:07 UTC · original
Ingenioeren:fix/copystat-frame-window→main· +44 −5 · 1 files · 1 commits · openWhat
Count presented frames between copy-statistics log lines. Use that count to compute the per-frame figures and reset it when the next line is logged.
Why
A local test run reported implausibly large copy figures, including several gigabytes refreshed per frame. The copy counters covered roughly five seconds, while the divisor counted only the frames in the latest one-second FPS sample.
Testing
cargo test -p victory-gpupassed on two reruns with 114 passed and four ignored. The new test checks that five windows of 10 frames produce a divisor of 50 and that the next interval starts fresh. Reinstating the one-second reset made the test fail with a divisor of 10. The regression test also passed with--features diagnostics.origin/mainruns. A serial run reproducedwritten_pages_are_reported_to_every_askeron both revisions. A separate occlusion-query test failed once onorigin/main.cargo clippy -p victory-gpu --all-targetscompleted with the same warnings asorigin/main.cargo run -p xtask -- policy --stagedpassed.AI assistance: prepared with Claude Code, reviewed by Ingenioeren.
This matches the separate frame counter upstream VIctory already uses for its copy statistics (
copy_stats_frames).@adrianmjim on GitHub · 2026-11-26 19:55 UTC · original
Tested natively on Windows 11 (MSVC, RX 7900 XT, driver 32.0.32029.2010), head
faab565against base4f62c2a. Other heavy jobs were running on the machine at the same time.cargo clippy -p victory-gpu --no-deps --all-targets, with and without--features diagnostics: same warnings as base, none new.cargo test -p victory-gpu --lib --features diagnostics, 20 runs each, base and PR interleaved: 6/20 base runs and 4/20 PR runs had a failure. None of the failing tests is inhost.rs. Tests that failed on the PR side and never on base in these runs, once each:query::tests::host_timestamps_are_on_the_title_clock,queue::tests::present_runs_after_a_queues_waitandpipeline::library::tests::concurrent_atomic_writes_publish_one_complete_file. The last two are intermittent on this machine under load.diagnostics.I also ran a local test (not part of this PR). It drives a
Meterwith a null HWND at 3 fps for 11 s, which gives two log lines. Each frame adds 1 MB of title copies throughcopystat::add/copystat::rangeand touches 256 fresh pages. I ran it withGPU_TIMESempty and with it filled (10 ms per frame), 3 runs each:4f62c2accbf888)GPU timeline read 10.0 ms/frame in all three builds, because it already used the interval's frames on base.copystat::logstarts its fault baseline at 0, so the first line also counts start-up faults. This is the same on base, and neither PR changes it.LogWindow::takeis only reached fromMeter::frameafterframe(), so the divisor is at least 1.Test coverage: I put the call site back to
crate::copystat::log(frames)and keptLogWindow.copy_statistics_count_all_frames_since_the_last_logstill passes, but theMetertest reports 4.0 to 5.7 MB/frame. So the new test coversLogWindowon its own, not howMeter::frameuses it.Overlap with #213: both fix the same divisor and gave the same numbers above. They conflict in
Meter::frame, in the 5 sifand in thecopystat::logcall, so only one can merge as is. The differences:TIMED_FRAMES(diagnostics only), so the GPU time line and the copy line share one count. It adds no test.LogWindow, present in all builds) and leavesTIMED_FRAMESfor the GPU time line. It adds a unit test forLogWindow.Not tested: running the game with this build.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.