GPU: drop draws whose fresh tables cannot be made; 2^18 dynamic slots #336
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!336
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/336/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?
@hophaver on GitHub · 2026-11-24 02:23 UTC · original
hophaver:fix/dynamic-descriptor-exhaustion→main· +76 −28 · 2 files · 2 commits · merged 2026-11-24 08:00 UTCRefs #59.
Problem
On an RX 9070 XT (RDNA4), the world removes the device about 60 s after start. The fault addresses are
0x7000037xxxxx,0x8000037xxxxx,0x33c4000or0x2610000, and the faulting pipeline is different on every run. I skipped 16 faulting pipelines one after another (VICTORY_SKIP_PIPELINES,VICTORY_GPU_TIMING), and the fault just moved to another one each time.Every run with diagnostics (13 of them) logs this 1 to 25 s before the device removal:
When
HostHeap::dynamicreturnsNone,State::tablescontinues. The stage's user data then falls back touser_value, which is the title's table offset. CBV tables are always made fresh and never mirrored, so the shader reads whatever host descriptor sits at those title slots as a constant buffer. On AMD, a texture or null descriptor read as a buffer descriptor gives a wild base address.Change
bindnow returnsfalsewhen a fresh table of a stage could not be made. The draw, mesh dispatch, dispatch or indirect execution is then dropped instead of reading the wrong descriptors. A warning is logged at powers of two.DYNAMICgoes from1 << 16to1 << 18.Tested
Windows 11, RX 9070 XT,
game_scarlett_master.exev1.0.2.1, diag build,VICTORY_KEYS=15:Enter,VICTORY_D3D12_DRED=1.d2a4bae+ this commit): the world loads, no exhaustion warning, no draws dropped, and the 60 s removal is gone. That run was removed later, at about 134 s, with a different signature:page fault ... inside freed ["texture 1024x1024 f99 ..." (type 34)]. That is a texture used after its release, which this PR does not address.cargo test -p victory-gpupasses, and so doescargo xtask policy.I also tried these, and none of them stopped the 60 s removal on this card: bounding root SRVs/CBVs, clamping buffer views to the host copy, re-binding heaps after the indirect clamp, and #185.
@jimokulou2-ops on GitHub · 2026-11-24 02:37 UTC · original
Tested
3c81420on a second RX 9070 XT. It reproduces the description's result: no exhaustion warning, and the world lasts more than twice as long. The later removal is the same freed-texture fault. Written by Claude Code (Claude Opus 5.5), which ran the commands and read the logs; I drove the pad into the world on my machine.Setup: Windows 11 Pro 10.0.26300, AMD Ryzen 7 9700X, RX 9070 XT (RDNA4, Adrenalin 26.11.2 / 32.0.32029.2010), Rust 1.98.1,
--profile diag --features diagnostics,VICTORY_D3D12_DRED=1, v1.0.2.1, Series X mode. Baseline:maind2a4bae+ #197 (input only). PR: the same tree +3c81420(local merge, no conflicts). I entered the world by hand, the same way in every run, and left it alone until the device was removed.no free dynamic descriptor slots0x32a90000x6000026350000x2bd50003c814200x3bf4c8000inside freed["texture 1024x1024 f98 flags 0x0 (type 34)"]So, as in the description:
f99. Here it is format 98. The same log line also saysview heap ... 0x2bc5d8000 past its end.World frame times are about the same: on average 1508 ms/frame with this PR over 24 intervals, against ~1400 ms/frame for the baseline over 10. The time goes to CPU preparation as before.
Tests (
d2a4bae+ #197 +3c81420, debug):cargo test --workspace --no-fail-fast: 265 passed, 0 failed, 4 ignored (the same as without this PR).The new drop path logged nothing in this run. Its warning fires at powers of two, starting at 1, so no draw was dropped.
Not tested: more than one run with the PR; #135 alongside this PR (it keeps replaced resources longer, which may be what the freed-texture fault needs); NVIDIA / Intel.
@tcurtsinger on GitHub · 2026-11-24 02:44 UTC · original
One measurement for the capped NVIDIA heap. On our RTX 4080 the 65,536-slot dynamic region had 136 slots free when a ten-slot request failed. The longest contiguous span was nine. That run used #135 and #251. Run report.
At the 1,000,000-descriptor host cap, this PR's 262,144-slot reserve leaves 737,856 slots mirrored directly, down from 934,464. That makes high-index tables worth covering when testing the larger reserve. A 4090 tester saw table references as high as slot 917,140, with null entries in that capture. Our 4080 run did not record its highest referenced slot or measure this split. RTX 4090 observations.
@GamingRipperDoc on GitHub · 2026-11-24 03:42 UTC · original
Windows 10 data point on a third RX 9070 XT: same result as the description, and one detail about the later freed-texture fault.
Setup: Windows 10 22H2 19045.7846, RX 9070 XT (driver 32.0.32015.7029), Ryzen 9 9900X.
maind2a4bae+ #175 (Agility SDK, needed on Windows 10) + this PR (3c81420), diag build,VICTORY_D3D12_DRED=1, Series X mode, driven with a pad into the first mission.Before (
d2a4bae+ #175 only), 3 runs: the world lasted 38 s, 10 s and 8 s, and every run loggedno free dynamic descriptor slots: a table is not madeabout 1 s before the device was removed (faults0x2527000,0x7000037a5000,0x7000037a7000; details on #304).After (+ this PR), 1 run: no exhaustion warning; the world lasted about 145 s, at 0.4–1.4 fps (1,000–2,500 draws per second dropped, most for shaders that don't translate yet). Then:
The detail: the mesh draw on the GPU at the stop reads its vertex data through root SRV
root3(title0xb925e6000). Its host copy is at0x408ae6000with0x21a000bytes left, which is exactly the end of that 4 MB title memory copy (0xb92400000+0x400000ends at title0xb92800000, host0x408d00000). The fault is0xa3000past that end, in the gap before the next copy (host0x409280000), where textures used to be. Root SRVs aren't bounds-checked, and vertex fetch reads them with no record limit, so this would fit a mesh shader reading its vertex stream past the end of the copied range: on the console the title's memory just continues there; on the host the next bytes belong to something else. That would make the "freed texture" only where the read happened to land, not the cause. One run, so this is a lead, not a result; it's the only in-flight draw reading from that copy.No game data used.
AI-assisted (Claude Code); I played the runs, and the logs were read with the model.
@hophaver on GitHub · 2026-11-24 03:55 UTC · original · edited 2026-11-24 03:58 UTC
Pushed
e8d3b64for the capped-heap case @tcurtsinger raised: the 2^18 dynamic range is now used only when the host takes the title's slots plus 2^18. Otherwise the heap falls back to 2^16 dynamic slots (the old size) before the existing 1,000,000 cap applies, so a capped NVIDIA heap mirrors the same 934,464 title slots as before this PR. The RX 9070 XT still gets 2^18.cargo test -p victory-gpupasses.On the later freed-texture fault, @GamingRipperDoc's reading matches what I saw: a local build that binds root SRVs as one-view tables bounded to the end of the host copy (reads past it return zero instead of faulting) ran 6+ minutes in the world without that removal.
@walterwallaceson on GitHub · 2026-11-24 05:54 UTC · original
Tested
e8d3b64on a capped NVIDIA heap: Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, release build. The host view heap is capped at 1,000,000 here (count=1245184refused with0x80070057), so this exercises the 2^16 fallback. Stacked on #175 (19aec59) + #233 (3098672) + #55 (56f1d41) + #89 (081afbd); all merged cleanly.no free dynamic descriptor slots0x887A0006, no breadcrumbs)dropped=counter goes 1 → 1024 in the first 3 s and reaches 32768 about 25 s before the removal. So on a capped heap the 2^16 slots don't recover; the run survives longer because the bad draws are dropped, not because there are enough slots.cargo test --workspace: only the known Windows 10 failures (#118/#152, #362).No game data in this report.
AI-assisted (Claude Code); everything above was run on my machine.
@SlopComp on GitHub · 2026-11-24 05:58 UTC · original
Data point for the capped-heap tradeoff in
e8d3b64: 2^18 dynamic slots on a capped NVIDIA heap (737,855 title slots mirrored) instead of the 2^16 fallback.Driver 616.92, Windows 11, diag build; both cards cap the view heap at 1,000,000. Base is Zignixx's set from #71 (
d2a4bae+ #493, #483, #189, #89, #205, #206, #469, #459, #454), which includes this PR's draw dropping.no dynamic slotsdropstitle slot past the host heapOne 2^18 run, about 5 min including the intro. The scene is still black, so this doesn't show the title never reads 737,855..934,463, only that
HostHeap::mirrornever warned.@r4tedx on GitHub · 2026-11-24 06:28 UTC · original
A note from the consumer side, since the capped-heap sizing in
e8d3b64is the one part of this PR the tester tree does not take.integration/testerson my fork (head18c2dc4) carries this PR at3c81420and #493, and keeps 2^18 dynamic slots on a capped view heap instead of the 2^16 fallback. The reason is the two title measurements already linked here and on #71, not anything measured by me:prepare; with 262,144 none are, the peak in use is 132,014, andtitle slot past the host heapnever fired in a 7-minute run.no dynamic slotsdrops in 12.5 minutes at 2^16 on an RTX 3080, none at 2^18 on the RTX 5080.Both are one run per configuration, and @tcurtsinger's point stands against them: at 2^18 a capped heap mirrors 737,855 title slots, and a table reference as high as slot 917,140 was seen on a 4090. So the open measurement is the highest title slot actually read in the world on a capped heap, which decides whether a size between the two exists that satisfies both.
In the tree the choice is held by a test,
a_capped_view_heap_keeps_its_dynamic_slots(1,310,720 title slots asked for; on an RTX 5070 the heap comes out as 737,855 title slots, 262,144 dynamic ones and #483's guard slot), and testers are asked to reporttitle slot past the host heapwith its highest index.The test is synthetic; the title was not used in it. AI-assisted.