Repository navigation
GPU: drop draws whose fresh tables cannot be made; 2^18 dynamic slots - #336
Conversation
When HostHeap::dynamic ran out, State::tables skipped the fresh table and the stage's user data fell back to the title's table offset. Constant buffer tables are always made fresh and never mirrored, so the shader read whatever host descriptor sat at those slots as a constant buffer; on AMD a texture or null descriptor read as a buffer gives a wild base address and the device is removed (Marvisak#59: faults at 0x7000037xxxxx, 0x8000037xxxxx, 0x33c4000, a different pipeline every run, about 60 s in). bind now reports that a table could not be made, and the draw, mesh dispatch, dispatch or indirect execution is dropped. The dynamic range grows from 2^16 to 2^18 slots, which the world did not exhaust on an RX 9070 XT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 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,
So, as in the description:
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 ( 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. |
|
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. |
|
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. Before ( 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 No game data used. AI-assisted (Claude Code); I played the runs, and the logs were read with the model. |
A host that refuses the title's slots plus 2^18 dynamic ones (NVIDIA's 1,000,000-view cap) now gets 2^16 dynamic slots, as before, instead of losing mirrored title slots to the larger range: at the cap, 2^18 left 737,856 title slots against 934,464, and titles were seen to index slots up to 917,140. The cap itself is unchanged. Hosts that take the larger heap (RX 9070 XT) keep 2^18.
|
Pushed 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. |
… and descriptor safety (Marvisak#493, Marvisak#336)
…t run short A list kept the dynamic slots of its fresh tables until the title reset it, because the title may submit it again. Submissions are waited for, so those slots hold nothing the GPU still reads: on NVIDIA's capped heap (65,536 dynamic slots) frames already drawn held them, the frame being recorded found none free seconds into the world (4 of 4 runs on an RTX 4060 Ti), and its tables were not made. Before #336 such draws read the title's slots past the heap's end and the device hung 30 to 90 s later; since #336 they are dropped, world draws and the compute passes that feed them alike. After a submission each list lends its slots; a heap that runs short takes them back, oldest list first. A list submitted again gets them back first, or, if they were taken, is not run (warned once) until reset. The 5-second slot line also counts the slots taken back, the draws and dispatches dropped for their tables, and the lists not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three conflicts: - descriptor.rs: main (Marvisak#365) publishes the host heap only after replaying pending writes; Marvisak#185 stores it as an Arc. Main's order, wrapped in Arc. - draw.rs: main (Marvisak#336) makes bind() return false when a table cannot be made; Marvisak#185 makes it pub(crate) for its tests. Both. - host.rs: main (Marvisak#87) and Marvisak#185 both fixed the copy statistics' frame denominator (copy_stats_frames vs diagnostic_frames). Main's kept, Marvisak#185's duplicate counter removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heap runs short Stacked on Marvisak#336. A list keeps the dynamic slots its draws took until the title resets it. Every submission is waited for, so once a list has run the GPU no longer reads them, but a capped view heap (NVIDIA: 1,000,000 slots, 65,536 of them dynamic) is full within seconds of the world and every later table is refused: the draw or dispatch is dropped (Marvisak#336 drops it instead of reading the title's slots). When `HostHeap::dynamic` has no room, `State::take_dynamic` now takes back the slots of the oldest list that already ran (`descriptor::lease`), one list at a time, and retries. That list is marked lost; submitting it again without a reset is refused (its draws are dropped, as a table that could not be made already drops one) and it works again once the title resets it. A list is not taken back while it runs: `start` and `reclaim` share one lock. Nothing changes while the heap has room. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
The tester tree (upstream main ffe310e plus its PRs, update 8; see its INTEGRATION.md) ran 11-25 minutes in the world on an RTX 5070 without a device removal. Where both sides carry the same PR (the wave64 stack #223/#233/#320 with #439 and #180, #454, #336, #259, #331 and others), the tester tree's newer head is taken; our own work and the PRs only we merged are kept. Conflicts, file by file: - descriptor/host.rs: the tester layout (`spare`, the guard slot after the dynamic slots, `free_table`, the capped sampler heap). A capped view heap keeps `capped_reserve()` dynamic slots, now 2^18 by default (the tester measurement, and our 91fed158), still `VICTORY_DYNAMIC_SLOTS` in diagnostics builds; uncapped hosts keep our 2^19. Our slot statistics (TAKEN/PEAK/SHORT), the bindless plan cache (`CommittedRegions`, `timed_valid_title_address`, `timed_find`, `title_bounds`) and the revision triple are kept beside the tester's `guard_slot`. - Buffer states: the tester tree's buffer-state tracker (#334: every list moves host copies of title memory between GENERIC_READ and UNORDERED_ACCESS and back to common before it closes) and depth twins (#469) are taken. #40's enhanced/legacy indirect barriers (the indirect prelude, `use_indirect_buffers`, the title buffer handoff mirrored in `host_barrier`) cannot share buffers with that tracker and are dropped; #40's argument checks (`byte_len`, exact spans, overflow-safe clamp shader, aligned counts) stay. `indirect::bound` and #282's `rectangles` go through `buffer_state`, and `indirect::execute` (#334) replaces `done`. #178's DXC fallback compiles both of our passes. Our segments (#387: `close` ends the segment, `close_native` closes a native list) carry the tracker: each native list returns its buffers to common and its twins to their depth targets, and each prelude also holds our texture uploads. - shadow.rs: our write flow (`queue_write`, one `snapshot` after the batch's refreshes, `finish_writes`, the unchanged-page cache) with #261's copy-back that also gives the snapshot the title's bytes; its tests run through our flow. - pipeline/make.rs: #275's per-frame budget and per-pipeline wake pair, with our compute waits (a dispatch waits for its pipeline, up to 20 s). - pipeline/library.rs: the tester version (#347, #275's saver thread); our concurrent-write test kept. shader_cache.rs: our byte-returning cache API with #358's "translated, only not kept". - draw.rs: #493's root SRV tables; where no table can stand in, our drop of a draw whose root view is unset or outside title buffers. Our refusal of a table offset past the capped heap stays. - resource.rs: `HostTexture` has both our `staged` generation and the depth twin. - Shaders: the tester's lower.rs for the wave64 stack, #160's image sampling (it covers our #73 and #136 sample forms) and #453/#587; kept from our side: #136's preference for an image or buffer use of a descriptor read as data and its `s_buffer_` arm, #422's nearest-even narrowing (also for #169's d16 loads and #453's interpolation), #452's spin-wait limit, #391's LDS limit, #302's spilled root arguments (now in `NativeProgram::translation_ir`), #136's PSV0 interpolation beside the tester's row harmonisation. split_tests.rs, lane_read_loop_tests.rs and docs/wave64-on-wave32.md are the tester versions (the same PRs at newer heads). - Tests: #483's heap guard dwords filled in our GPU tests of #200 (v_div_scale) and #437 (scalar loads from a raw view), which read through the guard slot otherwise; #334's debug-layer test passes an offset to our `indirect::bound`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GPU: drop draws whose fresh tables cannot be made; 2^18 dynamic slots
main moved under #193 and this branch. One conflict, in HostHeap::new (descriptor/host.rs): #336 tries the heap with DYNAMIC dynamic slots, then with MIN_DYNAMIC, then capped, and records the range it got in `dynamic`; this branch puts ALIASES raw-view slots after the dynamic ones. Both kept: each attempt asks for the alias slots too, the capped count leaves room for them, the lease bitmap has `extra` entries as on main, and `alias_base` stays `count + extra`. A merge rather than a rebase so #193's commits keep their ids. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
#193 moved: buffer views are clamped to what is left of the host copy, a shader that reads the stride table without a host view heap is not run, and a known stride that is no multiple of four is refused. Conflicts were with main, not with this branch's change: `bind` already returns whether the draw may run (#336), with its doc comment and the dropped counter, and main already renamed the second test module in host.rs. main's side kept in all three; #193's `return false` in the stride-table branch is in. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…heap runs short A list keeps the dynamic slots its draws took until the title resets it. Every submission is waited for, so once a list has run the GPU no longer reads them, but a capped view heap (NVIDIA: 1,000,000 slots, 65,536 of them dynamic) is full within seconds of the world and every later table is refused: the draw or dispatch is dropped (#336 drops it instead of reading the title's slots). When `HostHeap::dynamic` has no room, `State::take_dynamic` now takes back the slots of the oldest list that already ran (`descriptor::lease`), one list at a time, and retries. That list is marked lost; submitting it again without a reset is refused (its draws are dropped, as a table that could not be made already drops one) and it works again once the title resets it. A list is not taken back while it runs: `start` and `reclaim` share one lock. Nothing changes while the heap has room. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
…exhaustion GPU: drop draws whose fresh tables cannot be made; 2^18 dynamic slots
…heap runs short Stacked on Marvisak#336. A list keeps the dynamic slots its draws took until the title resets it. Every submission is waited for, so once a list has run the GPU no longer reads them, but a capped view heap (NVIDIA: 1,000,000 slots, 65,536 of them dynamic) is full within seconds of the world and every later table is refused: the draw or dispatch is dropped (Marvisak#336 drops it instead of reading the title's slots). When `HostHeap::dynamic` has no room, `State::take_dynamic` now takes back the slots of the oldest list that already ran (`descriptor::lease`), one list at a time, and retries. That list is marked lost; submitting it again without a reset is refused (its draws are dropped, as a table that could not be made already drops one) and it works again once the title resets it. A list is not taken back while it runs: `start` and `reclaim` share one lock. Nothing changes while the heap has room. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
…heap runs short A list keeps the dynamic slots its draws took until the title resets it. Every submission is waited for, so once a list has run the GPU no longer reads them, but a capped view heap (NVIDIA: 1,000,000 slots, 65,536 of them dynamic) is full within seconds of the world and every later table is refused: the draw or dispatch is dropped (Marvisak#336 drops it instead of reading the title's slots). When `HostHeap::dynamic` has no room, `State::take_dynamic` now takes back the slots of the oldest list that already ran (`descriptor::lease`), one list at a time, and retries. That list is marked lost; submitting it again without a reset is refused (its draws are dropped, as a table that could not be made already drops one) and it works again once the title resets it. A list is not taken back while it runs: `start` and `reclaim` share one lock. Nothing changes while the heap has room. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Refs #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.