GPU: reuse unchanged page checks across shadow copy-back ranges #124
No reviewers
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!124
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/124/head"
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-24 00:42 UTC · original
TG0000:perf/shadow-copyback-page-cache→main· +200 −8 · 1 files · 1 commits · closed without mergingSummary
GPU buffer copy-back compares each declared write range with the pre-submission snapshot. Distinct ranges can cover many of the same pages. This change remembers fully compared unchanged 64 KiB pages until the snapshot is released. Changed pages and unchecked parts of pages still go through the existing comparison and write-back path.
Synthetic release benchmark
On Windows MSVC with a Ryzen 9 5900X, the median of five CPU comparison runs dropped from 269.9 ms to 12.6 ms (21.5×). The fixture generates 24 distinct overlapping ranges across 128 MiB and changes one byte on every 64th page. Both paths report the same changed-page count. In-game frame time remains unmeasured.
Verification
cargo +stable-x86_64-pc-windows-msvc test --workspace(258 passed, four ignored by default)cargo +stable-x86_64-pc-windows-msvc clippy --workspace --all-targets(existing warnings)cargo +stable-x86_64-pc-windows-msvc xtask policy(151 files passed)AI-assisted.
@DaviTostes on GitHub · 2026-11-24 00:52 UTC · original
Tested
a6deb46under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gpu: 40 passed, 3 failed, 1 ignored — this PR adds 4 tests and they pass.main(argument_clamp_builds,a_rejected_blob_gives_an_empty_library, #128'sVirtualQueryupload skip). Note the last one goes through the same shadow copy-back path this PR optimises, so if it is ever fixed (#128), re-running here would exercise the new reuse path end to end.shadow::tests::benchmark_overlapping_copy_backstays ignored (synthetic CPU benchmark).No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@KevinPratap on GitHub · 2026-11-24 13:27 UTC · original
Measured in the world on an RTX 4050 Laptop (Windows 11, title 1.0.2.1, diagnostics build of an integration branch with per-page snapshots, scripted input): the same idea, a page that copy-back already went over in this submission is skipped by later ranges, took copying back from 1.1-4.2 s to about 0.2 s per frame, and world frames from 9-13 s to about 1 s.
Before it, stack samples of world frames found the submitting thread in
copy_back's comparison in 12 of 17 samples. The world declares dozens of overlapping views of the 174 MB heap per submission, so each page was compared once per declared range.On that branch the snapshot is per page, so the mark is a
donesubmission number on each page's snapshot. Any write to the snapshot resets it, and it counts only when the whole snapshot part of the page was gone over.AI-assisted.
@Yaekai on GitHub · 2026-11-24 16:20 UTC · original
Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head
a6deb46:cargo test -p victory-gpu --lib: 43 passed, 0 failed.cargo clippy -p victory-gpu -- -D warnings: 0 warnings.1.0.2.1,--console series-s, 19-min world run): verified shadow copy-back page-check reuse with zero corruption or stalls. Ready to merge!@TG0000 on GitHub · 2026-11-24 16:30 UTC · original
Thanks for testing it in a long world run on another GPU vendor, that is the case I could not cover on an RX 6800.
AI-assisted (Claude Code).
Pull request closed