GPU: scan virtual regions on copy_mapped and write_mapped fallback (#783) #1350
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!1350
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1350/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?
@wbkepler on GitHub · 2026-11-24 17:34 UTC · original
wbkepler:gpu/region-scan-copy-fallback→main· +357 −29 · 1 files · 1 commits · closed without mergingSummary
Implements #783:
VirtualQueryregion-scan copy fallback incopy_mappedandwrite_mapped(crates/victory-gpu/src/host.rs) so mapped copies spanning uncommitted or guard-page gaps copy committed sub-regions safely instead of failing the entire span.Verification
cargo clippy -p victory-gpu --all-targets— passedcargo test -p victory-gpu— passedcargo xtask policy— passed@maplerouteadmin-dev on GitHub · 2026-11-24 17:58 UTC · original
Tested on hardware that hits the fallback path hard; it helps a lot here.
Setup: RTX 5070 12 GB (driver 32.0.16.2114), Ryzen 5 5600X, 32 GB, Windows 11; Xbox Series 1.0.2.1; diag build (
--profile diag --features diagnostics),VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, warm shader cache. Base:mainatffe310eplus #966, Peppacodesexp/mesh-host-lanes(#940/#189) and a port of the #951 fix, needed to reach the world on NVIDIA. #1350 merged on top with one trivial conflict (both sides append at the end ofhost.rs; kept both).cargo test -p victory-gpupasses. No game data used.Same route both runs: boot, menus, first cutscene into the world, about 60 s there. Medians over the 5 s frame-rate lines with frames over 500 ms (world only):
The two runs do not copy the same amount per frame (the scene differs from second to second), so the per-GB figure is the fairer comparison: about 3x cheaper.
moves(the firstReadProcessMemory) stays at 65-90 ms/frame in both, so before the change almost all of the copy time was the 64 KiB / 4 KiB retry.Unchanged by the PR: draws dropped without a host pipeline are similar in both runs (hundreds to thousands per frame, untranslated shaders) and the scene is black in both. No crash, no device removal.
What dominates with the PR in: copies are still ~1.2 s/frame, and in some lines write-watch askings take up to ~1.2 s/frame (
1480 watches 1175.70 ms, 14644.6 MB checked, 10186.5 MB unchanged), with GPU time spiking to 1.2-1.4 s in a few lines.@DaviTostes on GitHub · 2026-11-24 18:09 UTC · original
In-game A/B on AMD/Linux, since the PR has unit/WARP checks but no title numbers.
Setup: RX 9060 XT (RDNA4, RADV 26.3.1), Arch, Wine 11.22, DXVK 3.1.1
dxgi, vkd3d-proton 3.2.0,WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"; release MSVC build, package 1.0.2.1 (build unknown (b99f876b…)); scripted Enter through the menus, 600 s per run.mainffe310e2f27ea1So the fallback does what it says on AMD/Wine too: copy time roughly halves to a third in the world, and the frame gets shorter. Directional only — two runs, not the same save/frame window.
Both runs reach the prologue (credits render; the 3D scene behind stays black, #841), then hit
RtlReleaseSRWLockExclusiveand the title's+0x2215c35null write (#774); no device removal in either. Not tested: Windows/NVIDIA, controlled same-save, long sessions.@maplerouteadmin-dev on GitHub · 2026-11-24 21:15 UTC · original
Correction to my earlier numbers on #1350 and #1351. After posting them I found a background GPU process on the test machine (a hidden CUDA miner, since removed) holding about 2.8 GB of VRAM and using the GPU. Every build was measured under the same conditions, so the comparisons between builds hold, but the absolute frame times and some of the device removals were inflated by it. Re-measured on the clean machine:
RTX 5070 12 GB (driver 32.0.16.2114), Ryzen 5 5600X, 32 GB, Windows 11; Xbox Series 1.0.2.1; diag build; same scripted input (
VICTORY_KEYS), 240 s per run, builds alternated, one process at a time. Base =mainffe310e+ #966 + Peppacodesexp/mesh-host-lanes+ a #951 port. Medians over world frame-rate lines (frames over 500 ms). No game data used.Same conclusions as before: #1350 cuts the copy cost sharply; #1351 as is copies more per draw (the copies left unwatched after a failed gap, see my comment on #1351); with the gap fix it is the fastest of the four. The device removals are real on this card without the background process too: about one run in two, on every build, so they are not caused by either PR.
@Marvisak on GitHub · 2026-11-25 00:38 UTC · original
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #943. The same VirtualQuery region walk as #943 (same issue), larger (357 lines), without measurements, and its test must find a 5 MiB MEM_FREE hole in a shared test process within 16 tries (flaky).
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed