Clip GPU-read-only PAGE_GRAPHICS_* sub-ranges from shader UAV writes (+16% FPS) #1014
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!1014
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1014"
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?
@mikael-jarvinen on GitHub · 2026-11-28 11:07 UTC · original
mikael-jarvinen:gpu-ro-uav-clipping→main· +701 −17 · 9 files · 3 commits · merged 2026-11-29 08:16 UTCSummary
Tracks Xbox GDK read-only GPU page protections (
PAGE_GRAPHICS_READONLY,PAGE_GRAPHICS_EXECUTE,PAGE_GRAPHICS_EXECUTE_READ) fromXMemVirtualAlloc(includingMEM_REPLACE_PLACEHOLDER) andVirtualProtect, and subtracts those read-only intervals from shader UAV write declarations (Shadow::shader_writes).Why
On console hardware, a title can reserve a virtual placeholder (
MEM_RESERVE_PLACEHOLDER), split it viaVirtualFree(..., MEM_PRESERVE_PLACEHOLDER), replace each sub-range viaXMemVirtualAlloc(..., MEM_REPLACE_PLACEHOLDER, protect)with differentPAGE_GRAPHICS_*protections, and place a single large buffer and raw UAV across adjacent regions of mixed GPU protection.Specifically, the 174 MiB (
0xae00000) heap noted indocs/findings.mdspans:0x1b00000) prefix:PAGE_GRAPHICS_EXECUTE_READ(CPU-written constant/upload ring — hardware GPU-read-only)0x9300000) suffix:PAGE_GRAPHICS_READWRITE(GPU-writable pools)Because
XMemVirtualAllocpreviously returned early onMEM_REPLACE_PLACEHOLDERwithout noting GPU protection bits, binding one raw UAV over all 174 MiB declared the 27 MiB CPU constant ring as shader-writable. Every CPU upload-buffer fill reading from that prefix then either stalled waiting for in-flight submissions or was diverted intocard_steps(~4,000–7,500 fills/frame).Changes
crates/victory-hle/src/modules/xmem.rs: Records read-only GPU protection bits (PAGE_GRAPHICS_READONLY | PAGE_GRAPHICS_EXECUTE | PAGE_GRAPHICS_EXECUTE_READ, without writable bits, and excludingPAGE_GRAPHICS_NOACCESSused on empty placeholder reservations) inXMemVirtualAlloc(bothMEM_REPLACE_PLACEHOLDERand normal allocations) andVirtualProtect, aligned to whole 4 KiB host pages; clears stale records on fresh reservations (null-base or fixed-addressMEM_RESERVE), writable transitions, and successfulMEM_COALESCE_PLACEHOLDERSfrees.crates/victory-gpu/src/shadow.rs:GPU_READONLY) with lock-free atomic min/max bounds for a zero-allocation fast path when a UAV does not overlap any read-only range.Shadow::shader_writes, subtracting GPU-read-only sub-ranges whenVICTORY_GPU_RO_SKIPis enabled (on by default;VICTORY_GPU_RO_SKIP=0disables), while keeping explicit host-recordedCopyBufferRegiondestinations on unclippedShadow::gpu_writes.gpu_readonly_tests) covering prefix clipping, middle holes, suffix clipping, merging, splitting, freeing, and zero-lengthMEM_RELEASEover interior/split sub-ranges.crates/victory-gpu/src/draw.rs&memory.rs: Route root UAV, descriptor-table UAV, and small-buffer shader writes throughShadow::shader_writes.crates/victory-gpu/src/host.rs: AddsVICTORY_GPU_RO_CHECK=1verification mode (CardPlan::check_gpu_ro) to keep full ranges declared and warn if any compared, non-picked 64 KiB piece that changed on the card overlaps a GPU-read-only region; reports clipped MB/frame (GPU_RO_LEFT) alongsideVICTORY_WC_NO_BACK.crates/victory-gpu/src/lib.rs&watch.rs: Exportstitle_memory_gpu_readonly/title_memory_gpu_writableand resolves zero-lengthMEM_RELEASEallocation extents viaallocation_end(VirtualQuery) before clearing intervals intitle_memory_freed.docs/findings.md&docs/README-foxhound.md: Documents the mechanism, switches (VICTORY_GPU_RO_SKIP,VICTORY_GPU_RO_CHECK), and A/B benchmark results.Verification & A/B Benchmarks
Tested on Windows 11, NVIDIA GeForce RTX 3080 10 GB (driver 621.14), Series X profile, 2560×1440 output, release build, warm shader/pipeline cache (
0pipelines compiling), frame generation off, identical scripted startup/cutscene/world sequence (115–120 s per run).Correctness (
VICTORY_GPU_RO_CHECK=1, diagnostics build)0xa00000,0x100000, and the0x1b00000/ 27 MiB prefix of the 174 MiB buffer).0warnings across boot, menu, cutscene, and gameplay (~320 GPU compare passes/frame): zero GPU writes ever touched any compared, non-picked 64 KiB piece inside a GPU-read-only region. (Note:VICTORY_GPU_RO_CHECK=1checks compared non-picked card ranges; write-combined and uncompared writes are not covered by this diagnostic.)DLSS Performance (2560×1440 output, 1280×720 internal — CPU/submission-bound)
VICTORY_GPU_RO_SKIP=0VICTORY_GPU_RO_SKIP=1preparing(median / late)waiting for flights(median / gameplay)planning card_steps(median)card_stepsfills/frame (median)merge_under_writes(median)Native 2560×1440 (
--dlss off— GPU-bound in 5,000-draw scenes)VICTORY_GPU_RO_SKIP=0VICTORY_GPU_RO_SKIP=1preparing(median)waiting for flights(median)planning card_steps(median)card_stepsfills/frame (median)Independent Community A/B Results
card_stepsfills −76.1% / −85.3% KB (4,494 → 1,072),planning card_steps−53.1% (3.2 → 1.5 ms),preparing−8.3% (32.7 → 30.0 ms), mid-scene gameplay +11.2% FPS (27.6 → 30.7), peak +11.6% (36.3 → 40.5), clean visuals &0faults.card_stepsfills ~4× lower (1,685–1,939 → 375–479), clean visuals, no FPS change (35.2 vs 35.2cutscene,+0.85fps after scene change — within noise, as fills are not the bottleneck on Series S with DLSS off).VICTORY_WAIT_RESIDENT=0,VICTORY_LAND_SKIP=1, 20-min 3D A/B): 0 errors / clean visuals,card_stepsfills −79.7%, upload ranges −66.5%, strong gains on heavy scenes (7k–10k+4.1%,>=10k+21.3%), net regression on1k–7kdraw frames (−4.5%to−11.4%) wherewaiting for flightswas already0.1 msand CPUstepsgrew (refreshes +5.6 ms,copies&fills +2.6 ms).Automated Checks
cargo test -p victory-gpu --lib: 457 passed, 0 failed (including 4gpu_readonly_tests)cargo test -p victory-hle --lib: 189 passed, 0 failed, 3 ignored (includinggpu_protection_page_alignment)cargo clippy -p victory-gpu -p victory-hle --all-targets&--all-features: 0 new warningscargo xtask policy: 294 files ok@Bj0rnis on GitHub · 2026-11-28 12:30 UTC · original
Independent RTX 5070 Ti 16 GB + Ryzen 7 9800X3D verification on
259c9930vsmain(63b902f), Windows 11, driver621.24, Rust 1.98.1,--releasebuild from source, Series X profile, 2560×1440, DLSS Quality, Frame Generation off, warm shader/pipeline cache (VICTORY_HOST_WAVE=32), manual opening → prison cell → break room runs.main(63b902f)#1014(259c9930)card_stepsfills / frameplanning card_stepswaiting for flightspreparing3.5k–6.5kdraws, avg ~4.9k)Visuals rendered cleanly with no new glitches or corruption observed (break-room memory stayed at 27.4 GB RAM / 12.9 of 14.5 GB VRAM; note break-room camera angle had ~10% more draws in the PR run [
10,231vs9,301], though submit-thread prep still improved from30.3–35.8 msto28.9–30.4 ms).Automated checks: Clean merge-tree on
63b902f;cargo test --locked -p victory-gpu --lib gpu_readonly_tests3/3 passed;cargo xtask policy294 files ok;cargo test --locked -p victory-hle --lib187 passed (1 NTFS hard-link test failed only due to restricted sandbox temp dir).Not tested:
VICTORY_GPU_RO_CHECK=1diagnostics build orVICTORY_GPU_RO_SKIP=0on the PR binary directly (compared againstmain63b902f). No game data, logs, or captures attached.AI-assisted test run and summary.
@urielbeaupre on GitHub · 2026-11-28 12:43 UTC · original
An A/B on a different setup: RTX 4070 Ti 12 GB, Ryzen 9 7900X, Series S profile, DLSS off. This PR's head (
259c993, based on current main), one build,VICTORY_GPU_RO_SKIPalternated 1/0/1/0, same save, warm cache. Seconds 60–110 after input are a cutscene; 110–165 come after the scene change. About 10 readings each.VICTORY_GPU_RO_SKIPcard_stepsfills/framecard_stepsfills drop about 4×.So the gain looks tied to setups where those fills are expensive, like Series X at 1440p with DLSS on your RTX 3080. With Series S and DLSS off, the fills don't seem to be the limit. That might be worth a line in the description.
🤖 Generated with Claude Code
@CuteBooty on GitHub · 2026-11-28 13:39 UTC · original
A review note from reading the diff, before I run it. I have not tested it.
shadow.rs:gpu_readonly_freed(at, len)withlen == 0only drops intervals that start exactly atat:A zero length is the normal case:
xmem.rs's free path callsvictory_gpu::title_memory_freed(address, size), and aMEM_RELEASEpasses size 0 for "the whole allocation atat" (the comment onwatch.rs:title_memory_freedsays so). So a read-only interval that sits inside a released reservation, but does not start at its base, survives the release. That covers a read-only sub-range replaced into the middle of a placeholder, or one left aftertitle_memory_gpu_writablesplit a merged interval.If the title then maps writable memory at that address, through an allocation without GPU protection bits, or a fixed-address reuse that doesn't pass the null-base clear in
XMemVirtualAlloc,Shadow::shader_writeswould still subtract the stale interval. A real UAV write there would then lose its hazard tracking and copy-back, and the CPU would read stale bytes.The test
gpu_readonly_freed(base + 0x2_0000, 0)frees at the interval's own start, so it doesn't cover this.A test that should fail as written:
gpu_readonly_freed(base, 0)for the whole reservation.writable_subranges(base, total)gives back the whole range.Possible fixes:
[base, base + extent).Two smaller points from the same read:
title_virtual_protectnotes the requested bytes, not the whole pages a protection change affects.CardPlan::check_gpu_ro(VICTORY_GPU_RO_CHECK=1) runs only on non-picked, compared card ranges. Write-combined and uncompared writes would not trip it, so zero warnings don't rule this case out.(Read with my AI assistants, Claude Code and Codex; nothing run yet.)
@POMXARK on GitHub · 2026-11-28 13:41 UTC · original
Tested this PR in a full 20-minute 3D A/B run on Windows 11 (8C/16T CPU + RTX 5080 + DLSS Quality + MFG 4x) — mixed result: 0 errors and strong gains on heavy draw workloads (
7k–10k+4.1%,>=10k+21.3%) with-79.7%card_stepsfills and-66.5%upload ranges, but a net regression on lighter/mid draw workloads (1k–7k) and1s frame_timestails because CPUsteps(refreshes+copies and fills) grew by+10.0 ms.Setup
tearing=true), default4 MiBwindows,VICTORY_GPU_BCPACK=0,VICTORY_WAIT_RESIDENT=0,VICTORY_TEXTURE_ROOM_PERCENT=70,VICTORY_LAND_SKIP=1, defaultVICTORY_GPU_RO_SKIP=1.v2026.11.27.10(8fc2254) + AVX2/ThinLTO + PR #516 + PR #340 + PR #81 + PR #666 + AVX2Shadow::take/ PR #498 + PR #801 + PR #834 + lock-freenothing_new_with/wide_chunks(32)(6df0ae5).shadow::(42/42 including all 3gpu_readonly_tests) andvictory-hle(188/188) passed.20-Minute 3D A/B Results (Strict 3D-only, Draw-Count-Matched)
6df0ae5, 20m)VICTORY_GPU_RO_SKIP=1, 20m)0 / 0 / 00 / 0 / 00.0 MB/frame311.4 MB/frame(28.3 MBprefix)card_stepsfills/frame (p50)3,514714-79.7%38,86213,034-66.5%6,3255,449-13.9%planning card_steps/under(p50)4.2 ms/4.4 ms1.7 ms/2.7 ms-2.5 ms/-1.7 mssteps:refreshes/copies&fills(p50)22.5 ms/2.4 ms28.1 ms/5.0 ms+5.6 ms/+2.6 ms22.5 MB/frame26.4 MB/frame+3.9 MBframe_times(3D)65.4med /85.9p95 /97.7p99 (1,354>100ms)68.8med /93.2p95 /105.0p99 (1,764>100ms)p95 +7.3 ms,>100ms +30.3%n=167 / 170)13.9p50 /13.91mean (Prep 58.1 ms)12.2p50 /12.73mean (Prep 67.8 ms)-12.2%p50 (Prep +9.7 ms)n=103 / 96)17.50p50 (copies 19.6 ms)15.50p50 (copies 28.8 ms)-11.4%(copies +9.2 ms)n=46 / 46)13.40p50 (copies 29.9 ms)12.80p50 (copies 34.8 ms)-4.5%n=34 / 37)11.05p50 /11.06mean (90.4 ms)11.50p50 /11.54mean (86.9 ms)+4.1%n=5 / 6)8.00p50 (copies 73.3 ms)9.70p50 (copies 55.5 ms)+21.3%(copies -17.8 ms)Key Observation
waiting for flightswas already0.1 msat baseline (withVICTORY_WAIT_RESIDENT=0and fast RTX 5080), so clipping the28.3 MBGPU-RO prefix did not recover large flight-wait time here.card_stepsshifted work back onto CPUsteps(refreshes 22.5 -> 28.1 ms,copies&fills 2.4 -> 5.0 ms,card_up_MB 22.5 -> 26.4 MB). That is a clear win in heavy>=7kdraw workloads (+4.1%/+21.3%), but slowed1k–7kdraw workloads on an 8C/16T CPU.0errors,0visual glitches).@sawetco on GitHub · 2026-11-28 13:55 UTC · original
I reproduced the interior-range case in a synthetic unit test on
259c993using native Windows and Rust 1.98.1. The three existinggpu_readonly_testspassed. The new case reached the whole-allocation release throughwatch::title_memory_freed(base, 0). After the release,writable_subrangesstill returnedSome([])for the interior range. The expected result isNone, which would leave that range eligible for GPU write tracking. Earlier reviewThis checks the range bookkeeping with the game closed.
@tippythetaidum on GitHub · 2026-11-28 14:54 UTC · original
Tested on an RTX 5080 + Ryzen 7 9800X3D (8 cores, one CCD), 32 GB, Windows 11 26200. This PR is cherry-picked onto
63b902fwith #393, Series X, DLSS Quality 2560x1440, frame generation off, warm pipeline cache, standing indoors (Jason's house, the same save restored before every run, about 5,000 to 7,500 draws a frame).Verification:
VICTORY_GPU_RO_CHECK=1, one run of about 4 minutes from start to the world, 0 warnings. The three read-only ranges were noted at start (0x5eb70000+0xa00000,0x5f570000+0x100000,0x5f670000+0x1b00000).A/B in one process. A local switch turned
gpu_ro_skip()off every other 30 s, so both sides saw the same scenes. This was 4 minutes, with 5-second frame lines cut at the switches:So the fills drop as described (about -55 to -65 %), and the submitting thread's cost per draw drops about 5 %. The frame rate here didn't change beyond the noise. In this scene the title waits 11 to 16 ms a frame at presents either way, and the PC was paging (32 GB, 0.4 to 0.8 GB free). The frame isn't set by the preparing alone on this machine, unlike the RTX 3080 numbers in
findings.md. No visual change was seen.@mikael-jarvinen on GitHub · 2026-11-28 15:02 UTC · original
Thanks @CuteBooty and @sawetco for catching and reproducing the zero-length release bug, and @Bj0rnis, @urielbeaupre, and @POMXARK for the independent A/B runs.
Review fixes pushed
MEM_RELEASEclearing (watch.rs,shadow.rs):watch::title_memory_freed(at, 0)now resolves the live Windows allocation extent viaallocation_end(at, at)(VirtualQuery, gated behind a lock-freeshadow::has_gpu_readonly_from(at)check) before callinggpu_readonly_freed. Becausetitle_virtual_freenotifiesvictory-gpubefore callingVirtualFree, this clears interior GPU-read-only sub-ranges and split tails across the whole reservation without touching adjacent separate reservations.xmem.rs):note_gpu_protectionnow aligns ranges to whole 4 KiB host pages (page_aligned_range), matching WindowsVirtualProtect/VirtualAlloc2granularity. Fresh fixed-addressMEM_RESERVEcalls (not only null-base reservations) and successfulMEM_COALESCE_PLACEHOLDERSfrees now also clear stale GPU-read-only records over the affected pages.shadow::gpu_readonly_tests::zero_length_release_clears_readonly_range_inside_reservation(using realVirtualAllocreservations with committed interior sub-regions, a split RO tail, and a second unrelated reservation to verify isolation) andxmem::tests::gpu_protection_page_alignment.victory-gpu --lib(457 passed, including 4/4gpu_readonly_tests),victory-hle --lib(189 passed, includinggpu_protection_page_alignment),clippy(default +--all-features, 0 new warnings),cargo xtask policy(294 files ok).VICTORY_GPU_RO_CHECK=1inspects compared, non-picked card ranges (so write-combined / uncompared writes are outside its check).Note on @POMXARK's mixed light- vs heavy-scene result
Traced why
1k–7kdraw frames regressed on your 5080 +VICTORY_WAIT_RESIDENT=0+ 8C/16T stack while>=7kdraw frames gained+4.1%to+21.3%:Shadow::pending, so dirty ring pages move from byte-diffedShadow::merge_under_writes(under−1.7 ms, upload ranges −66.5%) to whole-pageShadow::copy_stale(refreshes+5.6 ms,+3.9 MBuploaded), while ~2,800 fills/frame move fromcard_stepsplanning (−2.5 ms) back to CPUcopy_mappedfills (copies&fills+2.6 ms).waiting for flightsis non-trivial (3–35 mson RTX 3080,2.4–5.8 msin the break room on 5070 Ti) or in heavy>=7kdraw scenes, avoiding false UAV hazards and flight waits clearly wins; whenwaiting for flightsis already0.1 msat baseline on lighter scenes, there is no wait time left to recover on an 8-core CPU. Updated the PR description to note this tradeoff (andVICTORY_GPU_RO_SKIP=0remains available to toggle it off).@bigboss22869 on GitHub · 2026-11-28 20:35 UTC · original
Tried the PR's single commit on trustno1 main of 2026-11-28: RTX 5070 Ti 16 GB, Ryzen 7 7800X3D, 64 GB, Windows 11, Series X profile, native 1440p, no DLSS. Same save at a pier, camera still, scripted 4-minute runs.
VICTORY_CARD_STEPS=2VICTORY_CARD_STEPS=1CARD_STEPS=2CARD_STEPS=1VICTORY_GPU_RO_CHECK=1,CARD_STEPS=1396 MB declared written in GPU-read-only memory clippeda frame.VICTORY_GPU_RO_CHECK=1logged no changed bytes in 2.5 minutes, and the draw count was back. So the check mode does not catch whatever goes wrong.rtx5070ti) the clipping is off unlessVICTORY_GPU_RO_SKIP=1.AI-assisted (Claude Code); runs and observations by me; no game data.
@futurepro62 on GitHub · 2026-11-28 20:44 UTC · original
Tested on main
9300875+ this PR. System: RTX 5070 Ti 16 GB (driver 621.40), Ryzen 7 9800X3D (SMT on, 16 threads), 32 GB DDR5, Windows 11 build 26300, pagefile C: 32–64 GB (custom). Title 1.0.2.1. Script launcher, mode 6, Series X, DLSS + DLSS frame generation 4x. Built from source.. Output 3840x2160 + DLSS Performance.a texture picked by index changed after its uploadreached the log's cap of 200 lines 85 s into the run, compared with 96 lines in 5 min on main without the PR (MEASURED). So the skipped range may hold texture data the GPU does write (ASSUMED).VICTORY_GPU_RO_CHECK=1wasn't tried.068ef3fdeato537584f052@mikael-jarvinen on GitHub · 2026-11-28 21:45 UTC · original
Rebased cleanly onto
main(923e38c, head537584f; 4/4gpu_readonly+ 23/23xmemtests pass, 0 new warnings) and re-measured on RTX 3080 10 GB + Ryzen 7 7800X3D (diagbuild, warm shader cache, 1440p DLSS Performance, FG off, 115 s scripted run):main(923e38c)537584f)planning card_stepsmerge_under_writesasking write watch254.8 MB/frclipped)@Luqueze on GitHub · 2026-11-28 21:48 UTC · original
Heads-up: this no longer applies to current
main(77df871). The two commits conflict incrates/victory-gpu/src/draw.rsanddocs/findings.md.In
draw.rs,mainnow has, in the root-UAVreadyclosure:with
let pipeline = self.pipeline;declared only under#[cfg(feature = "diagnostics")]. Taking this PR'ss.shader_writes(list, a, len, self.pipeline)there doesn't build:selfis borrowed by the closure. What builds and passescargo test -p victory-gpu --lib(564 passed) is to keepmain's diagnostics line, calls.shader_writes(list, a, len, pipeline), and drop thecfgonlet pipeline.docs/findings.mdonly needs both sections kept.For the record, I ran it in a bundle with #799, #1279, #666, #1497, #1442, #1397, #1358 and #1417 on that
main: RTX 4070 SUPER, Ryzen 7 5700X3D, Series X, native 1440p, DLSS off. The ranges were noted (GPU-read-only title memory noted ... len=0x1b00000) and there was no crash. I can't give a number for this PR alone, because the bundle changed too much at once.@POMXARK on GitHub · 2026-11-28 22:18 UTC · original
@mikael-jarvinen — ran a full 20-minute gameplay A/B of the updated
537584fhead on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches, stacked on#1038+#1094+#516withVICTORY_WC_NO_BACK=1,VICTORY_LAND_SKIP=1,VICTORY_CARD_STEPS=2):Verification
gpu_readonly4/4 PASS (0.00s, includingzero_length_release_clears_readonly_range_inside_reservation),xmem24/24 PASS (0.11s).0errors,refused=2, clean visuals throughout;VICTORY_GPU_RO_SKIP=1engaged cleanly (~141–342 MB/frame clipped on top of ~2.9–83.6 GB/frame already skipped byVICTORY_WC_NO_BACK).20-minute A/B (matched draw buckets)
#1038, no#1014)537584f)67.4 ms)77.5 ms)+10.1 ms)cop 17.8 ms / 34.7 MB)cop 25.9 ms / 43.9 MB)+8.1 mscopies)cop 21.9 ms / 40.1 MB)cop 31.9 ms / 54.8 MB)+10.0 mscopies)cop 35.9 ms / 65.9 MB)cop 51.3 ms / 89.5 MB)+15.4 mscopies)steps 28.3 ms)steps 38.7 ms)+10.4 mssteps)>100ms(5s bins)Observation
-2.2 ms(13.6 -> 11.4 ms) and CPU time dropped (5,850 -> 5,460 s), with0errors and clean visuals (theMEM_RELEASEfix is solid).#1038+VICTORY_WC_NO_BACK=1+VICTORY_LAND_SKIP=1, clipping ~140–340 MB/f of RO sub-ranges increasedpreparing: copies(22.1 -> 31.4 ms,40.7 -> 53.7 MB/f) andsubmitting steps(28.3 -> 38.7 ms), plus peak Working Set rose+1.6 GB— likely from extra interval-splitting / buffer-copy fragmentation when sub-ranges are clipped on theCARD_STEPS=2path.537584f052to0575055309@mikael-jarvinen on GitHub · 2026-11-28 22:23 UTC · original
Thanks for the detailed reports @bigboss22869, @futurepro62, and @Luqueze — I investigated all three and pushed an update rebased onto
main(d4b5d51, head0575055):1. Rebase conflict (@Luqueze)
Resolved against
main(d4b5d51):let pipeline = self.pipeline;is unconditional and passed intos.shader_writes(list, a, len, pipeline), anddocs/findings.mdmerges cleanly.2.
VICTORY_GPU_RO_CHECK=1blind spots & GPU protection clearing (@bigboss22869)Auditing why
VICTORY_GPU_RO_CHECK=1could log 0 warnings turned up three real gaps, now fixed in0575055:Host::card_backdid not callplan.check_gpu_ro(differs)(onlyHost::relay_card_backdid).< 64 KiB/ windows) & uncompared card ranges:VICTORY_GPU_RO_CHECK=1only inspected comparedCardPlanranges. AddedShadow::check_gpu_ro_mergeacross all six GPU-to-title merge paths (copy_back_with,relay_merge,card_merge,card_merge_relay,land_card,land_back) with zero overhead when the check is off.259c9930) lacked commit 2 (33a9ee7, fixing zero-lengthMEM_RELEASEextent resolution,MEM_COALESCE_PLACEHOLDERS,MEM_RESERVEreuse, and 4 KiB page alignment). In0575055,xmem::note_gpu_protectionalso conservatively clearsGPU_READONLYwhen plain CPU protection (noPAGE_GRAPHICS_*bits) is passed.3. Live verification (RTX 3080, Series X, native 1440p
--dlss off,VICTORY_CARD_STEPS=1)VICTORY_UPCOPY_CHECK=1+VICTORY_CARD_STEPS=1+VICTORY_GPU_RO_SKIP=1: 0 differing words on the 174 MiB buffer (0x1b00000prefix +0x9300000suffix) or any other 32-bit / GPU-RO region at both send time and whole-buffer rest checks.VICTORY_CARD_STEPS=1A/B (same scripted sequence):VICTORY_GPU_RO_CHECK=1(SKIP=0): 10.5–12.1 fps (90.6–92.3 msprep,51.1–55.0 mswaiting for flights on1.00 a buffer copyrefused/fr), 7,803–9,308 draws/frame (ending8,041), 0VICTORY_GPU_RO_CHECKwarnings with all blind spots closed,23texture-recheck warnings.VICTORY_GPU_RO_SKIP=1: 16.0–17.8 fps (43.0–48.9 msprep,0.0 mswaiting for flights), 7,726–8,373 draws/frame (ending8,197),14texture-recheck warnings.a texture picked by index changed after its uploadhits 64-bit dynamic texture addresses (e.g.0x7...,0xb...), disjoint from the 32-bit0x1b00000GPU-RO region, and varies0–26across runs both with and without this PR (and coloured skin/cloth noise in the opening is a known intermittent race documented incard_steps.rs/list/thin.rs).@bigboss22869 if you get a chance to re-test
0575055on the pier save — especially with the expandedVICTORY_GPU_RO_CHECK=1(and/orVICTORY_UPCOPY_CHECK=1) — any warning hit or draw-count log from that save would immediately pinpoint if something pier-specific is still slipping through.