GPU: VICTORY_COLD_SKIP=1: refreshes pass over 2 MiB chunks with no write since (off by default) #1358
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/fxceless--victory-fork!1358
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1358"
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?
@TG0000 on GitHub · 2026-11-26 18:08 UTC · original
TG0000:pr/cold-skip→main· +580 −72 · 4 files · 1 commits · openAI-assisted (Claude). Off by default. This branch has not been run in the game: the numbers below come from an earlier version of the change on a local stack. Reports from other GPUs and CPUs are very welcome.
What
A refresh of a host copy walks every 64 KiB page of its range and compares the page's last copy with its last noted write (
Shadow::copy_stale). A large copy that many submissions refresh is walked whole each time, mostly to find nothing.With
VICTORY_COLD_SKIP=1:Marks are read under the same lock as the written pages. A page still stale after its copy (taken in part, or numbered after a standing asking) keeps its chunk walked, so the same pages are copied as without the switch.
VICTORY_COLD_SKIP=altturns it on and off every 20 s. A log line with the frame-rate line says how many pages were passed over. With the switch unset no marks are kept and every page is looked at as before.Measured
AMD Radeon RX 6800 16 GB (RDNA2), Adrenalin 26.11.2, Ryzen 9 5900X, Windows 11, 1440p internal. One 240 s launch alternating the switch, 43 paired blocks, on a local stack with many other switches on (older base than this branch).
VICTORY_REFRESH_CHECK=1: no "stale after its refresh" line. That check samples the first 256 bytes of each 64 KiB block, so it is evidence, not proof.Difference from the measured version: while porting I found that it could remember a chunk holding a page that was still stale (written after a standing asking), and so not take that page again as the walk without the switch does. This PR keeps such a chunk walked; there is a test for it. The fixed version has not been measured.
Checks (on this branch, rebased on
52ac4ec0)Built on macOS (Apple M3 Pro), cross-targeting Windows where noted:
cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features, targetx86_64-pc-windows-msvc: clean.victory-gpuandvictory-shaderWindows test binaries build. They were not run.cargo testforvictory-core,victory-formats,victory-pipeline,victory-shader: pass.cold_skip.rs(standard library only): 9 of 9 tests pass withrustc --test, including a randomized comparison of the copied runs with and without the skip, with standing askings and partly held pages. These tests model the walk; they do not driveShadow::copy_staleitself.cargo xtask policyreports two files over the size limit (host.rs,lower.rs). Both already are onmain, and this PR touches neither.Related
VICTORY_LIGHT_REFRESH=1already returns early for a range with nothing new. This works per 2 MiB chunk, so it also helps when part of a range changed, and it does not need that switch. The two together are untested, as isVICTORY_DIRTY_4K.copy_stale.To try it
VICTORY_COLD_SKIP=altand compare the two phases; once,VICTORY_COLD_SKIP=1 VICTORY_REFRESH_CHECK=1and look for "stale after its refresh". Please report GPU, CPU, driver, the "passed over" percentage and both phases' preparing and frame times.🤖 Generated with Claude Code
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.