GPU change detection for copies in the PC's memory (VICTORY_GPU_DIRTY=1, F1 GPU CHANGE DETECTION) #4895
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4895
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4894"
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?
@NICKNAMErutschovkonikovan on GitHub · 2026-12-01 13:08 UTC · original
NICKNAMErutschovkonikovan:pr/gpu-dirty→main· +1481 −11 · 7 files · 1 commits · closed without mergingRefs #756
What it changes
Adds
VICTORY_GPU_DIRTY=1(off by default, read once throughasked_for!) and the F1 row ADVANCED > GPU CHANGE DETECTION (OFF, ON).The idea comes from the "GPU-side dirty bitmap" RFC in #756. That issue posted no patch, so none of its code is used.
Why: for host copies that have a side in the card's memory,
CARD_COMPAREalready finds on the card what shaders wrote. A copy that lives only in the PC's memory (no room on the card, below the card floor, or a window outside buffers) works differently. The CPU snapshots every declared range before the submission, then compares the whole range after the flight. The module notes ofhost/gpu_dirty.rsgo through a measured frame and show that none of the refresh time is a byte compare the card could take over: title memory is not readable by the card. What is left for the card is what shaders wrote to copies in the PC's memory.What: with the switch on, every such copy with at least 1 MiB of declared shader writes in a submission gets two passes of a new
GPU_DIRTYcompute shader. It usesCARD_COMPARE's hash and is compiled throughhlsl::compile_for.send_pre).send_post). Neither pass shares anExecuteCommandListscall with the title's UAV writes, and the flight's fence covers both.shadow::find_where), byte by byte as before. The snapshot stays as the merge's reference.Falls back to the CPU compare, as before: published submissions (
VICTORY_SUBMIT_SPLIT), copies under 1 MiB, missing memory or pipeline, a plan without readable bits, and a bit past the end.Owed blocks: a block found differing whose merge did not take stays in
OWED. It is compared again at every later landing until it is found the same. Its entries go when the copy's snapshot is given back or the copy is dropped.Stats line: once a second, a line reports plans, MB and pieces hashed on the card, pieces found changed, CPU bytes compared vs. left out, and the added CPU time.
Files: new
crates/victory-gpu/src/host/gpu_dirty.rs, plus hooks inhost.rs,shadow.rs(find_where,has_snapshot,forgetcalls) andcard_steps.rs(one test struct field). The menu row and about text inhost/menu.rsfollow the existing items. Also one paragraph indocs/unified-memory-audit.mdand one row each in the README's F1 guide and settings list.How it was tested
44bfa42c(branchpr/gpu-dirty, onmain5fabb46e).cargo test -p victory-gpu --lib --locked: 1106 passed, 0 failed, 68 ignored.host::gpu_dirty::tests: pieces, places, bits, joined ranges, pool, cover, owed blocks, forgetting a copy, and the two passes on WARP;shadow::find_where_tests:find_whereagainstfind_all.cargo test -p victory-gpu --lib --locked -- hardware_gpu_dirty --ignored: 1 passed on an RTX 5090 (the two passes on hardware set exactly the changed pieces' bits).cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: 5 errors, none in code this branch adds. All of them are in linesmainalready has:host/font.rs:213and:260(too_many_arguments),host/menu.rs(held[i] - REPEAT_DELAY) % REPEAT_EVERY == 0(manual_is_multiple_of, line 667 onmain), andhost/panel.rs:602and:668(collapsible_if; this branch does not change that file).cargo xtask policy --staged: 7 files ok.cargo testpassed for the crates it touches: yes (victory-gpu --lib)Checked for overlap
🤖 Generated with Claude Code
@tikD1337 on GitHub · 2026-12-01 13:28 UTC · original
Tested
VICTORY_GPU_DIRTY=1vs=0on the exact same--releasebinary (origin/main5fabb46e+#4885THIN_PEEPHOLE=1+#4877+#4872+#355601/03/04,VICTORY_PORT_CONSTANTS=0,VICTORY_WC_BAR=0):gpu_dirty10 passed; 0 failed; 2 ignored.621.1.0, ReBAR ON) + Win1126300, DLSS Quality,105 ssteady 3D runs,0crashes.VICTORY_GPU_DIRTY=0->1):>=200lists):27.93 -> 24.70 FPS(35.80 -> 40.48 ms, -3.23 FPS)submit_prep:31.6 -> 37.0 ms(+5.4 ms;steps 19.6 -> 24.2 ms,refr 10.0 -> 12.4 ms)5.3k–6.5kdraws:27.60 -> 25.00 FPS(host_prep 29.4 -> 34.9 ms)8.7 -> 13.8 ms(76% -> 66%busy)gpu_dirtytelemetry line reported0.0 plans, 0.0 copies, 0.0 MB in 0 piecesunder thisPORT_CONSTANTS=0+LOW_L0_DMA=1stack, yet the added per-frame overhead still regressedsubmit_prepby+5.4 ms.@trustno1-coder on GitHub · 2026-12-01 18:29 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed