GPU: keep replaced host resources for 6 frames; bigger dynamic descriptor pool, no fallback to stale tables #135

Closed
github-bot wants to merge 3 commits from gh-pr/135/head into gh-pr/135/base
Owner

@⁠mpDom on GitHub · 2026-11-24 00:51 UTC · original
mpDom:pr/gpu-page-fault-fixes → main · +177 −35 · 5 files · 3 commits · closed without merging

Two changes aimed at the host GPU page faults that end the world run (low-address faults such as 0x40da000 / 0x3ba7000).

  1. Defer dropping replaced host resources across 6 presented frames (a title frame spans 8-10 submissions, so the old 2-submission rotation freed textures that later lists of the same frame still read; seen as 'inside freed texture ...').
  2. Dynamic descriptor slots: the 65,536-slot pool ran out under 24-33 lists per frame ('no free dynamic descriptor slots'), and the draw then fell back to the unmirrored static table whose buffer/CBV slots hold 2D null views. Now the pool is 524,288 slots (65,536 when the host caps the heap), a draw or dispatch is dropped rather than run on a stale table or an unbound root view, and missing entries in fresh tables get null views of the kind the shader expects.

Tested: cargo test -p victory-gpu -p xtask (0 failures). Run on RX 6750 XT: the freed-texture crash is gone and the run gets much further into the opening cutscene.

**@⁠mpDom** on GitHub · 2026-11-24 00:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/135) `mpDom:pr/gpu-page-fault-fixes` → `main` · +177 −35 · 5 files · 3 commits · closed without merging Two changes aimed at the host GPU page faults that end the world run (low-address faults such as 0x40da000 / 0x3ba7000). 1. **Defer dropping replaced host resources** across 6 presented frames (a title frame spans 8-10 submissions, so the old 2-submission rotation freed textures that later lists of the same frame still read; seen as 'inside freed texture ...'). 2. **Dynamic descriptor slots**: the 65,536-slot pool ran out under 24-33 lists per frame ('no free dynamic descriptor slots'), and the draw then fell back to the unmirrored static table whose buffer/CBV slots hold 2D null views. Now the pool is 524,288 slots (65,536 when the host caps the heap), a draw or dispatch is dropped rather than run on a stale table or an unbound root view, and missing entries in fresh tables get null views of the kind the shader expects. Tested: cargo test -p victory-gpu -p xtask (0 failures). Run on RX 6750 XT: the freed-texture crash is gone and the run gets much further into the opening cutscene.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:51:40 +00:00
github-bot closed this pull request 2026-11-26 03:51:40 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:53 UTC · original

The test build does not compile, same failure as #134:

error[E0428]: the name `tests` is defined multiple times
   --> crates/victory-gpu/src/host.rs:2020:1
     |
 296 | mod tests {
     | --------- previous definition of the module `tests` here
2020 | mod tests {
     | ^^^^^^^^^ `tests` redefined here

The library builds; cargo test fails on every platform, so the GPU suite (Wine + vkd3d-proton here) cannot run even though the production code compiles. The new tests need to go into the existing mod tests in host.rs after a rebase.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7118545893) The **test build does not compile**, same failure as #134: ``` error[E0428]: the name `tests` is defined multiple times --> crates/victory-gpu/src/host.rs:2020:1 | 296 | mod tests { | --------- previous definition of the module `tests` here 2020 | mod tests { | ^^^^^^^^^ `tests` redefined here ``` The library builds; `cargo test` fails on every platform, so the GPU suite (Wine + vkd3d-proton here) cannot run even though the production code compiles. The new tests need to go into the existing `mod tests` in `host.rs` after a rebase. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠gw1337x on GitHub · 2026-11-24 01:04 UTC · original

Tested on an RX 7800 XT (RDNA3, driver 32.0.32015.7029, Windows 11 26200, 31.6 GB): main at d2a4bae + this PR only, diag build with VICTORY_D3D12_DRED=1.

Before (same PC, main at 9aef3d9 / 35b054e builds): every world run logged no free dynamic descriptor slots 2–17 s before a low-address page fault (0x27ab000 at 91 s, 0x3810000 / 0x3813000 at 58 s). Details are in #59.

With this PR:

  • No no free dynamic descriptor slots warning, and no low-address fault.
  • The opening cutscene runs at 1–2 fps, and the run lasts 155 s instead of 58–91 s. Its subtitles show and the audio plays in full, but there is no picture (no world geometry).
  • Per frame, about 450 ms goes to title memory copies (~350 MB per frame) out of ~800–1200 ms.

It still ends on a page fault, now in freed textures:

host GPU device removed after a submission of 11 lists; page fault at 0x3a0b70000;
inside freed ["texture 2048x2048 f71 flags 0x0 (type 34)", "texture 1024x1024 f98 flags 0x0 (type 34)", "texture 2048x512 f98 flags 0x0 (type 34)"];
the nearest title memory copy below it: 0xb16800000+0x400000 at host 0x3a0500000, offset 0x670000

Breadcrumbs: only list 0 has finished, and it is 2 commands (2/2, a prelude of state transitions). List 1 (0/506) and everything after it had not started. So the access to the freed texture seems to come from list 0 (a transition on a texture already released) or from work still in flight from the previous submission. Six presented frames looks too short for at least these textures at ~1 fps.

**@⁠gw1337x** on GitHub · 2026-11-24 01:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7118718810) Tested on an RX 7800 XT (RDNA3, driver 32.0.32015.7029, Windows 11 26200, 31.6 GB): `main` at `d2a4bae` + this PR only, `diag` build with `VICTORY_D3D12_DRED=1`. **Before** (same PC, `main` at `9aef3d9` / `35b054e` builds): every world run logged `no free dynamic descriptor slots` 2–17 s before a low-address page fault (`0x27ab000` at 91 s, `0x3810000` / `0x3813000` at 58 s). Details are in #59. **With this PR:** - No `no free dynamic descriptor slots` warning, and no low-address fault. - The opening cutscene runs at 1–2 fps, and the run lasts **155 s** instead of 58–91 s. Its subtitles show and the audio plays in full, but there is no picture (no world geometry). - Per frame, about 450 ms goes to title memory copies (~350 MB per frame) out of ~800–1200 ms. **It still ends on a page fault, now in freed textures:** ``` host GPU device removed after a submission of 11 lists; page fault at 0x3a0b70000; inside freed ["texture 2048x2048 f71 flags 0x0 (type 34)", "texture 1024x1024 f98 flags 0x0 (type 34)", "texture 2048x512 f98 flags 0x0 (type 34)"]; the nearest title memory copy below it: 0xb16800000+0x400000 at host 0x3a0500000, offset 0x670000 ``` Breadcrumbs: only list 0 has finished, and it is 2 commands (`2/2`, a prelude of state transitions). List 1 (`0/506`) and everything after it had not started. So the access to the freed texture seems to come from list 0 (a transition on a texture already released) or from work still in flight from the previous submission. Six presented frames looks too short for at least these textures at ~1 fps.
Author
Owner

@⁠ifBars on GitHub · 2026-11-24 01:15 UTC · original

On Windows 10 22H2, RTX 3060 Ti 8 GB, driver 610.88, I tested the three commits through 9dac364 with #124 and our existing SRV table snapshots. The same setup previously lost the device about 17 seconds after the first heavy world frame. This time the run ended at its 36-second world limit. Windows logged no display reset. The title card faded and subsequent native captures were black. World samples were 0.8–1.2 fps, with a cold host pipeline cache.

The NVIDIA-specific detail is that the host still capped the view heap at 1,000,000 descriptors. We still reached the warning for an eight-slot table with a 65,536-slot dynamic reserve. The fresh-table failure now skips the draw. This run shows that exhaustion can occur without an immediate device loss. It does not isolate which change helped or establish stability beyond the test window.

**@⁠ifBars** on GitHub · 2026-11-24 01:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7118921431) On Windows 10 22H2, RTX 3060 Ti 8 GB, driver 610.88, I tested the three commits through 9dac364 with #124 and our existing SRV table snapshots. The same setup previously lost the device about 17 seconds after the first heavy world frame. This time the run ended at its 36-second world limit. Windows logged no display reset. The title card faded and subsequent native captures were black. World samples were 0.8–1.2 fps, with a cold host pipeline cache. The NVIDIA-specific detail is that the host still capped the view heap at 1,000,000 descriptors. We still reached the warning for an eight-slot table with a 65,536-slot dynamic reserve. The fresh-table failure now skips the draw. This run shows that exhaustion can occur without an immediate device loss. It does not isolate which change helped or establish stability beyond the test window.
Author
Owner

@⁠HenriqueSBueno on GitHub · 2026-11-24 01:33 UTC · original

Tested on NVIDIA, where the host caps the view heap. Windows 11, RTX 3080 (driver 616.92), retail title, diagnostics build.

  • Base: main at 9aef3d9 + #89 + #54 + this PR + #40, with indirect execution on, as on main now.
  • Result: the title enters the world. There the dynamic slots run out, and with this PR the tables that don't fit make draws and dispatches drop every frame:
WARN victory_gpu::descriptor::host: host view heap capped at 1000000 ... count=1245184
WARN victory_gpu::descriptor::host: no free dynamic descriptor slots: a table is not made n=8 cap=65536
INFO victory_gpu::host: dropped .../frame without a host pipeline: indirect kind 0|1|2|10: prepare failed ...
  • Scale: about 350 dropped indirect draws/dispatches a frame across kinds 0, 1, 2 and 10 (55 meter lines in ~3 minutes in the world).
  • Cause: a shader reads a root view the title did not set doesn't occur, so the drops come from the dynamic slot exhaustion. On a capped heap, DYNAMIC_CAPPED is 65,536. The tables past the static part are forced into dynamic slots too, and that isn't enough for this title's world.
  • Picture: the world is still black here with or without this PR, so this isn't the only cause of the black screen.
  • Next: I'm looking at giving dynamic slots back on fence completion, or splitting the cap differently. I'll post it as a follow-up PR if it holds up.

AI-assisted (Claude Code)

**@⁠HenriqueSBueno** on GitHub · 2026-11-24 01:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119211082) Tested on NVIDIA, where the host caps the view heap. Windows 11, RTX 3080 (driver 616.92), retail title, diagnostics build. - **Base:** `main` at 9aef3d9 + #89 + #54 + this PR + #40, with indirect execution on, as on `main` now. - **Result:** the title enters the world. There the dynamic slots run out, and with this PR the tables that don't fit make draws and dispatches drop every frame: ``` WARN victory_gpu::descriptor::host: host view heap capped at 1000000 ... count=1245184 WARN victory_gpu::descriptor::host: no free dynamic descriptor slots: a table is not made n=8 cap=65536 INFO victory_gpu::host: dropped .../frame without a host pipeline: indirect kind 0|1|2|10: prepare failed ... ``` - **Scale:** about 350 dropped indirect draws/dispatches a frame across kinds 0, 1, 2 and 10 (55 meter lines in ~3 minutes in the world). - **Cause:** `a shader reads a root view the title did not set` doesn't occur, so the drops come from the dynamic slot exhaustion. On a capped heap, `DYNAMIC_CAPPED` is 65,536. The tables past the static part are forced into dynamic slots too, and that isn't enough for this title's world. - **Picture:** the world is still black here with or without this PR, so this isn't the only cause of the black screen. - **Next:** I'm looking at giving dynamic slots back on fence completion, or splitting the cap differently. I'll post it as a follow-up PR if it holds up. AI-assisted (Claude Code)
Author
Owner

@⁠tightfall on GitHub · 2026-11-24 01:33 UTC · original

Tested on RX 9070 (RDNA 4), Windows 11, Adrenalin 26.11.2: a clear improvement. The world runs 5–6× longer before the device is lost, and the descriptor-slot exhaustion is gone. The remaining removal is still a fault inside freed textures.

Build: PR head 9dac364, merged locally with main at d2a4bae. The head on its own fails cargo test with E0428 (mod tests defined twice in crates/victory-gpu/src/host.rs), which #129 fixed on main, so a rebase might be worth it. Merged: cargo test --workspace 264 passed, 0 failed, 4 ignored. Series X mode, keyboard input.

main eda38aa, release this PR, release this PR, diag + VICTORY_D3D12_DRED=1
World start → device removed ~30 s ~2 min 40 s ~3 min 20 s
no free dynamic descriptor slots 1× 0 0
Draws per frame in the world up to ~1,650 up to ~3,000 up to ~1,100

With the PR, the opening cutscene plays at roughly 0.5–1.5 fps with partial frames (many draws dropped for untranslated shaders). Audio keeps going the whole time.

Remaining removal (PR, diag, DRED):

  • page fault at 0x3b9a19000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f98 …", "texture 1024x1024 f99 …", "texture 1024x1024 f99 …", "texture 2048x2048 f98 …"]
  • submission of 11 lists; one list stopped at command 80 of 95 (op 42, DispatchMesh): mesh 1 [mesh 857b2e13c9cc107f, pixel 63051e97862e7dad]

So on this card a read of freed BC7 textures still happens, just much later. Maybe 6 presented frames isn't enough when a frame takes 1–2 s, or another retirement path still frees too early. I can rerun with other variables if that helps.

For #59: a DRED run on plain main (eda38aa, with VICTORY_D3D12_DEBUG=1) on the same card faulted somewhere else: page fault at 0x80000381d000, outside every title copy and heap, with a list stopped at command 80 of 104 in an ExecuteIndirect (op 5).

AI-assisted (Claude Code): log analysis and this write-up. The runs were done by hand.

**@⁠tightfall** on GitHub · 2026-11-24 01:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119226405) Tested on **RX 9070 (RDNA 4), Windows 11, Adrenalin 26.11.2**: a clear improvement. The world runs 5–6× longer before the device is lost, and the descriptor-slot exhaustion is gone. The remaining removal is still a fault inside freed textures. **Build:** PR head `9dac364`, merged locally with `main` at `d2a4bae`. The head on its own fails `cargo test` with E0428 (`mod tests` defined twice in `crates/victory-gpu/src/host.rs`), which #129 fixed on `main`, so a rebase might be worth it. Merged: `cargo test --workspace` 264 passed, 0 failed, 4 ignored. Series X mode, keyboard input. | | `main` `eda38aa`, release | this PR, release | this PR, `diag` + `VICTORY_D3D12_DRED=1` | |---|---|---|---| | World start → device removed | ~30 s | ~2 min 40 s | ~3 min 20 s | | `no free dynamic descriptor slots` | 1× | 0 | 0 | | Draws per frame in the world | up to ~1,650 | up to ~3,000 | up to ~1,100 | With the PR, the opening cutscene plays at roughly 0.5–1.5 fps with partial frames (many draws dropped for untranslated shaders). Audio keeps going the whole time. **Remaining removal (PR, diag, DRED):** - `page fault at 0x3b9a19000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f98 …", "texture 1024x1024 f99 …", "texture 1024x1024 f99 …", "texture 2048x2048 f98 …"]` - submission of 11 lists; one list stopped at command 80 of 95 (op 42, `DispatchMesh`): `mesh 1 [mesh 857b2e13c9cc107f, pixel 63051e97862e7dad]` So on this card a read of freed BC7 textures still happens, just much later. Maybe 6 presented frames isn't enough when a frame takes 1–2 s, or another retirement path still frees too early. I can rerun with other variables if that helps. For #59: a DRED run on plain `main` (`eda38aa`, with `VICTORY_D3D12_DEBUG=1`) on the same card faulted somewhere else: `page fault at 0x80000381d000`, outside every title copy and heap, with a list stopped at command 80 of 104 in an `ExecuteIndirect` (op 5). AI-assisted (Claude Code): log analysis and this write-up. The runs were done by hand.
Author
Owner

@⁠ka1qux on GitHub · 2026-11-24 01:40 UTC · original

Test report from another machine, in case it helps: Windows 11, Core i5-13600KF, RX 7800 XT, diagnostics build with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=1.

Build: main at d2a4bae with this PR, #205 and #214 merged (they merge cleanly).

Result (one run):

  • The dynamic-slot part works here: no no free dynamic descriptor slots warning, and no low-address page fault. On main I had that warning 4 to 10 s before a low-address fault in five runs out of five.
  • The freed-texture fault is not gone here. The world ran about 55 s and ended with:
page fault at 0x475e26000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f71 flags 0x0 (type 34)"];
the nearest title memory copy below it: 0x726000000+0x400000 at host 0x4755c0000, offset 0x866000

Two observations about that second fault, from earlier runs on main. I am not sure of the cause; this is what I measured.

  1. In one run I numbered the host textures and logged their history. The texture the fault fell in had been created 30 s earlier, was never the resource of any descriptor slot, had one holder when the title released it, and was freed at once. The fault came 2 s later. So in that run the freed texture was not something a later list still read; it only occupied that address range.
  2. In four of eight such faults the address was just past the end of a 4 MiB copy of loose title memory (shadow::loose): 24 KB, 96 KB, 116 KB and 116 KB past it. In the other four it was 2.4 to 5.1 MB past the nearest copy, which is about what chance would give with ~900 copies, so those four say nothing either way.

My reading of (2), unconfirmed: a root view has no size, root_view gives it the one window its address is in, and what the shader reads past that window's end lies in another host buffer. The read runs off the copy into whatever is next in host address space, which faults once that neighbour is freed. One experiment in that direction: giving root views one copy per aligned 32 MiB block with an 8 MiB tail ran the world for 4 minutes without this fault (one run, ended by me), but took the process's shared video memory from about 8 GB to 14.5 GB of a 15 GB budget, so it is not something I would propose as it stands.

I have not tested this PR alone, only together with #205 and #214.

**@⁠ka1qux** on GitHub · 2026-11-24 01:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119340599) Test report from another machine, in case it helps: Windows 11, Core i5-13600KF, RX 7800 XT, diagnostics build with `VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_DRED=1`. **Build:** `main` at d2a4bae with this PR, #205 and #214 merged (they merge cleanly). **Result (one run):** - The dynamic-slot part works here: no `no free dynamic descriptor slots` warning, and no low-address page fault. On `main` I had that warning 4 to 10 s before a low-address fault in five runs out of five. - The freed-texture fault is not gone here. The world ran about 55 s and ended with: ``` page fault at 0x475e26000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f71 flags 0x0 (type 34)"]; the nearest title memory copy below it: 0x726000000+0x400000 at host 0x4755c0000, offset 0x866000 ``` **Two observations about that second fault, from earlier runs on `main`.** I am not sure of the cause; this is what I measured. 1. In one run I numbered the host textures and logged their history. The texture the fault fell in had been created 30 s earlier, was never the resource of any descriptor slot, had one holder when the title released it, and was freed at once. The fault came 2 s later. So in that run the freed texture was not something a later list still read; it only occupied that address range. 2. In four of eight such faults the address was just past the end of a 4 MiB copy of loose title memory (`shadow::loose`): 24 KB, 96 KB, 116 KB and 116 KB past it. In the other four it was 2.4 to 5.1 MB past the nearest copy, which is about what chance would give with ~900 copies, so those four say nothing either way. My reading of (2), unconfirmed: a root view has no size, `root_view` gives it the one window its address is in, and what the shader reads past that window's end lies in another host buffer. The read runs off the copy into whatever is next in host address space, which faults once that neighbour is freed. One experiment in that direction: giving root views one copy per aligned 32 MiB block with an 8 MiB tail ran the world for 4 minutes without this fault (one run, ended by me), but took the process's shared video memory from about 8 GB to 14.5 GB of a 15 GB budget, so it is not something I would propose as it stands. I have not tested this PR alone, only together with #205 and #214.
Author
Owner

@⁠ka1qux on GitHub · 2026-11-24 01:53 UTC · original

Follow-up to my comment above, with a correction and one new measurement. Same machine (i5-13600KF, RX 7800 XT), same build (main at d2a4bae + this PR + #205 + #214), plus local diagnostics.

Correction: my root-view reading did not hold up. I tested it directly. On the next freed-texture fault the report went through the 4,000 noted commands around the last one the GPU reached (1,579 of them with root views) and looked for a root view whose host copy ends up to 16 MiB before the faulting address. It found none; the fault was 22 MB past the nearest copy of title memory. So for that fault a root view running off its 4 MiB window is not the cause, and the four small distances I listed may well have been chance. Please do not build on that part of my comment.

What still stands from it: this PR removes the dynamic-slot warning and the low-address fault here, and the freed-texture fault remains (two more runs: about 55 s and 85 s in the world).

New: on the software adapter the world's first frame dies in compute dispatches that index the title's own null descriptors. With VICTORY_D3D12_WARP=1 the run ends at the first world frame with a read of address 0 in host-generated shader code. A marker written with WriteBufferImmediate in MARKER_OUT mode before each noted command (exact on WARP, which runs commands in order) names the dispatch:

  • [compute d3e44e754b3eb6aa], 51x1x1: user data u6=0x0 and u8=0x6, used as heap indices. Slot 0 holds the title's view Shader(0, [42, 2, ...]) (no resource, R32_UINT, TEXTURE1D) and slot 6 Unordered(0, 0, [42, 4, ...]) (no resource, TEXTURE2D).
  • With that pipeline skipped (VICTORY_SKIP_PIPELINES), the next one dies the same way: [compute da1656ad2910e4c7], 35x1x1, u6=0x0, u8=0x0. The dispatches noted right after it (010a50ce68d02c16, 1547305c505a7559, 31430354dd5c259c) also have u8=0x0.

So the title keeps a null view at slot 0 (and 6) and points shaders at it whatever kind they read there. GPU-based validation had reported the same slot earlier for other pipelines ("SRV Dimension Expected: TEXTURE2D, In Descriptor: TEXTURE1D, Descriptor Heap Index: [0]"). The null views this PR and #205 fix are the ones we write; these are views the title wrote, and one descriptor cannot have the right kind for every shader that indexes it.

I do not know whether this matters on a real GPU: on the RX 7800 XT these dispatches run without a fault with this PR. It does stop WARP from getting far enough to catch the freed-texture fault at its exact command, which is what I was after.

**@⁠ka1qux** on GitHub · 2026-11-24 01:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119548219) Follow-up to my comment above, with a correction and one new measurement. Same machine (i5-13600KF, RX 7800 XT), same build (`main` at d2a4bae + this PR + #205 + #214), plus local diagnostics. **Correction: my root-view reading did not hold up.** I tested it directly. On the next freed-texture fault the report went through the 4,000 noted commands around the last one the GPU reached (1,579 of them with root views) and looked for a root view whose host copy ends up to 16 MiB before the faulting address. It found none; the fault was 22 MB past the nearest copy of title memory. So for that fault a root view running off its 4 MiB window is not the cause, and the four small distances I listed may well have been chance. Please do not build on that part of my comment. What still stands from it: this PR removes the dynamic-slot warning and the low-address fault here, and the freed-texture fault remains (two more runs: about 55 s and 85 s in the world). **New: on the software adapter the world's first frame dies in compute dispatches that index the title's own null descriptors.** With `VICTORY_D3D12_WARP=1` the run ends at the first world frame with a read of address 0 in host-generated shader code. A marker written with `WriteBufferImmediate` in `MARKER_OUT` mode before each noted command (exact on WARP, which runs commands in order) names the dispatch: - `[compute d3e44e754b3eb6aa]`, 51x1x1: user data `u6=0x0` and `u8=0x6`, used as heap indices. Slot 0 holds the title's view `Shader(0, [42, 2, ...])` (no resource, R32_UINT, TEXTURE1D) and slot 6 `Unordered(0, 0, [42, 4, ...])` (no resource, TEXTURE2D). - With that pipeline skipped (`VICTORY_SKIP_PIPELINES`), the next one dies the same way: `[compute da1656ad2910e4c7]`, 35x1x1, `u6=0x0`, `u8=0x0`. The dispatches noted right after it (`010a50ce68d02c16`, `1547305c505a7559`, `31430354dd5c259c`) also have `u8=0x0`. So the title keeps a null view at slot 0 (and 6) and points shaders at it whatever kind they read there. GPU-based validation had reported the same slot earlier for other pipelines ("SRV Dimension Expected: TEXTURE2D, In Descriptor: TEXTURE1D, Descriptor Heap Index: [0]"). The null views this PR and #205 fix are the ones we write; these are views the title wrote, and one descriptor cannot have the right kind for every shader that indexes it. I do not know whether this matters on a real GPU: on the RX 7800 XT these dispatches run without a fault with this PR. It does stop WARP from getting far enough to catch the freed-texture fault at its exact command, which is what I was after.
Author
Owner

@⁠tightfall on GitHub · 2026-11-24 01:54 UTC · original

Follow-up to my earlier comment: an experiment on RX 9070 (RDNA 4), Windows 11, Adrenalin 26.11.2, same base (this PR at 9dac364 merged with main at d2a4bae), diagnostics build with DRED.

Change (experiment only, not a fix): KEEP_FRAMES in take_retired set to u64::MAX, so retired host resources are never dropped.

PR as is never drop retired
world time until device removed ~3:25 ~6:45
fault inside freed BC7 textures (1024² / 2048², f98/f99) no freed allocation named
retired resources held at the end – ~4.2 million entries (most are repeated references, VRAM did not run out)

So the remaining freed-texture fault is retirement freeing too early: something still reads those textures more than 4 presented frames after they were retired. The ages in presented frames are probably not enough on their own here.

The second run then ends with a different fault: a page fault 0x6000 past the end of a 4 MB title memory copy (offset 0x406000 into a 0x400000 window), during a submission of 23 lists, with mesh pipelines and ExecuteIndirect in flight. That looks like a read past the copied range, not a lifetime issue.

Next I want to log, in diagnostics builds, why and when each texture is retired and dropped, so the texture DRED names can be traced back to the path that freed it.

No game data in this comment. AI-assisted (Claude); tested only on the GPU above.

**@⁠tightfall** on GitHub · 2026-11-24 01:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119571581) Follow-up to my earlier comment: an experiment on **RX 9070 (RDNA 4), Windows 11, Adrenalin 26.11.2**, same base (this PR at `9dac364` merged with `main` at `d2a4bae`), diagnostics build with DRED. **Change (experiment only, not a fix):** `KEEP_FRAMES` in `take_retired` set to `u64::MAX`, so retired host resources are never dropped. | | PR as is | never drop retired | |---|---|---| | world time until device removed | ~3:25 | ~6:45 | | fault | inside freed BC7 textures (1024² / 2048², f98/f99) | no freed allocation named | | retired resources held at the end | – | ~4.2 million entries (most are repeated references, VRAM did not run out) | So the remaining freed-texture fault is retirement freeing too early: something still reads those textures more than 4 presented frames after they were retired. The ages in presented frames are probably not enough on their own here. The second run then ends with a different fault: a page fault `0x6000` past the end of a 4 MB title memory copy (offset `0x406000` into a `0x400000` window), during a submission of 23 lists, with mesh pipelines and `ExecuteIndirect` in flight. That looks like a read past the copied range, not a lifetime issue. Next I want to log, in diagnostics builds, why and when each texture is retired and dropped, so the texture DRED names can be traced back to the path that freed it. No game data in this comment. AI-assisted (Claude); tested only on the GPU above.
Author
Owner

@⁠ChruutvoLuzi on GitHub · 2026-11-24 02:09 UTC · original

NVIDIA numbers for the DYNAMIC_CAPPED split. RTX 4090, driver 621.01, Windows 11; the host caps the view heap at 1,000,000 and the title asks for 1,245,184. The builds are main at d2a4bae plus other PRs. The larger reserve came from #134, which uses 1 << 19 on the capped heap as well, so the title keeps 475,712 slots there.

Dynamic slots on the capped heap World runs no free dynamic descriptor slots title slot past the host heap
65,536 (as on main) 3 in all 3, 6 to 10 s before the device was removed (n=7, 20, 29) 0
524,288 (#134) 6, the longest about 75 s in the world 0 0

One caveat about the last column. In one of the 65,536-slot runs, the DRED report shows the title's user data pointing tables at view-heap slots up to 917,140: 12 different slots above 475,712, all null (never made, or left null). So the title does use slots past 475,712, even though mirror() never logged one in the 524,288-slot runs. A silent title slot past the host heap may therefore not prove that the title stays below the cap (the latest comments in #71 read it that way). I haven't checked how such a table is bound when it falls past the mirrored part.

AI-assisted (Claude Code).

**@⁠ChruutvoLuzi** on GitHub · 2026-11-24 02:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119807822) NVIDIA numbers for the `DYNAMIC_CAPPED` split. RTX 4090, driver 621.01, Windows 11; the host caps the view heap at 1,000,000 and the title asks for 1,245,184. The builds are `main` at `d2a4bae` plus other PRs. The larger reserve came from #134, which uses `1 << 19` on the capped heap as well, so the title keeps 475,712 slots there. | Dynamic slots on the capped heap | World runs | `no free dynamic descriptor slots` | `title slot past the host heap` | |---|---|---|---| | 65,536 (as on `main`) | 3 | in all 3, 6 to 10 s before the device was removed (n=7, 20, 29) | 0 | | 524,288 (#134) | 6, the longest about 75 s in the world | 0 | 0 | One caveat about the last column. In one of the 65,536-slot runs, the DRED report shows the title's user data pointing tables at view-heap slots up to 917,140: 12 different slots above 475,712, all null (never made, or left null). So the title does use slots past 475,712, even though `mirror()` never logged one in the 524,288-slot runs. A silent `title slot past the host heap` may therefore not prove that the title stays below the cap (the latest comments in #71 read it that way). I haven't checked how such a table is bound when it falls past the mirrored part. AI-assisted (Claude Code).
Author
Owner

@⁠sennecools on GitHub · 2026-11-24 02:11 UTC · original

Tested on RX 9070 XT (RDNA 4), Windows 11 build 26300.9974, Adrenalin 26.11.2 (driver 32.0.32029.2010), offline. The dynamic-slot part works here: the warning and the low-address fault are gone. The run lasts 2.4× longer and now ends on a freed-texture fault, like the other reports above.

Build: PR head 9dac364 merged locally onto main at d2a4bae (clean merge), changes used unmodified. diag profile with --features diagnostics, VICTORY_D3D12_DRED=1, VICTORY_GPU_TIMING=1, input via VICTORY_KEYS (Enter every 10 s from 20 to 120 s). The baseline is main at d2a4bae with the same profile, switches and key script.

main d2a4bae, diag + this PR, diag
Process start → device removed 64 s 154 s
no free dynamic descriptor slots 1× (~1.3 s before removal) 0
Fault low address, no title memory copy below it, not in the view/sampler heap inside a freed 2D texture
Stopped list command 1290 of 3189, op 42 (253 of 255 lists finished) command 99 of 198, op 5 (ExecuteIndirect)
Heavy scene 1000-2000 draws/frame at ~1 fps (release run) up to 6207 draws/frame at ~1 fps

On main the removal was 0x887A0006 (hung), process exit 0x887A0005. The fault address is a low address in the same 0x37xxxxx-0x38xxxxx range as the other low-VA reports in #59. All 12 commands in flight between the stopped list's barriers were mesh dispatches (1-37 groups) of one mesh+pixel pipeline. Its u9/u10 are constant-buffer tables, which are the ones tables() remakes in dynamic slots.

A release run on d2a4bae without switches lost the device the same way: DXGI_ERROR_DEVICE_HUNG ~55 s after the 3D scene started, during submissions of 255-258 lists.

Mechanism, from reading d2a4bae (not instrumented): in crates/victory-gpu/src/draw.rs, tables() remakes every table that holds a constant buffer in dynamic slots. When HostHeap::dynamic(n) (descriptor/host.rs) returns None, tables() skips that table with continue, and bind then passes the table's title-heap offset, so the shader reads whatever the title's slots hold. The warning is behind a Once, so every failure after the first is silent. That matches one warning followed by a fault in constant-buffer-table mesh draws. With this PR the warning (same text, same Once) never appeared, so in this run the pool never ran out: the larger pool (DYNAMIC 2^16 → 2^19) is what removed the fault here, and the new drop path was not exercised.

Remaining fault: the freed-texture class that the RX 7800 XT and RX 9070 reports above also hit. It is consistent with retirement still freeing too early at ~1 fps.

Scope: one run per configuration in game, on one machine (one release and one diag run on main, one diag run with this PR). I did not test #134 separately.

AI-assisted (Claude Code): analysis and write-up; runs done on my machine.

**@⁠sennecools** on GitHub · 2026-11-24 02:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119848236) Tested on **RX 9070 XT (RDNA 4), Windows 11 build 26300.9974, Adrenalin 26.11.2 (driver 32.0.32029.2010)**, offline. The dynamic-slot part works here: the warning and the low-address fault are gone. The run lasts 2.4× longer and now ends on a freed-texture fault, like the other reports above. **Build:** PR head `9dac364` merged locally onto `main` at `d2a4bae` (clean merge), changes used unmodified. `diag` profile with `--features diagnostics`, `VICTORY_D3D12_DRED=1`, `VICTORY_GPU_TIMING=1`, input via `VICTORY_KEYS` (Enter every 10 s from 20 to 120 s). The baseline is `main` at `d2a4bae` with the same profile, switches and key script. | | `main` `d2a4bae`, diag | + this PR, diag | |---|---|---| | Process start → device removed | 64 s | 154 s | | `no free dynamic descriptor slots` | 1× (~1.3 s before removal) | 0 | | Fault | low address, no title memory copy below it, not in the view/sampler heap | inside a freed 2D texture | | Stopped list | command 1290 of 3189, op 42 (253 of 255 lists finished) | command 99 of 198, op 5 (`ExecuteIndirect`) | | Heavy scene | 1000-2000 draws/frame at ~1 fps (release run) | up to 6207 draws/frame at ~1 fps | On `main` the removal was `0x887A0006` (hung), process exit `0x887A0005`. The fault address is a low address in the same 0x37xxxxx-0x38xxxxx range as the other low-VA reports in #59. All 12 commands in flight between the stopped list's barriers were mesh dispatches (1-37 groups) of one mesh+pixel pipeline. Its u9/u10 are constant-buffer tables, which are the ones `tables()` remakes in dynamic slots. A release run on `d2a4bae` without switches lost the device the same way: `DXGI_ERROR_DEVICE_HUNG` ~55 s after the 3D scene started, during submissions of 255-258 lists. **Mechanism, from reading `d2a4bae` (not instrumented):** in `crates/victory-gpu/src/draw.rs`, `tables()` remakes every table that holds a constant buffer in dynamic slots. When `HostHeap::dynamic(n)` (`descriptor/host.rs`) returns `None`, `tables()` skips that table with `continue`, and `bind` then passes the table's title-heap offset, so the shader reads whatever the title's slots hold. The warning is behind a `Once`, so every failure after the first is silent. That matches one warning followed by a fault in constant-buffer-table mesh draws. With this PR the warning (same text, same `Once`) never appeared, so in this run the pool never ran out: the larger pool (`DYNAMIC` 2^16 → 2^19) is what removed the fault here, and the new drop path was not exercised. **Remaining fault:** the freed-texture class that the RX 7800 XT and RX 9070 reports above also hit. It is consistent with retirement still freeing too early at ~1 fps. Scope: one run per configuration in game, on one machine (one release and one diag run on `main`, one diag run with this PR). I did not test #134 separately. AI-assisted (Claude Code): analysis and write-up; runs done on my machine.
Author
Owner

@⁠tightfall on GitHub · 2026-11-24 02:15 UTC · original

A correction to my last comment, from a new measurement: same setup (RX 9070, Windows 11, Adrenalin 26.11.2, this PR at 9dac364 merged with main at d2a4bae, diagnostics build with DRED).

What I added (local diagnostics only): every host texture gets a number in its D3D12 name, and each free logs why the texture was retired (title release or descriptor slot) and how many frames before.

Result (one run, world ~1:40): the same fault as before, in the same mesh pipeline (DispatchMesh, mesh 857b2e13c9cc107f, pixel 63051e97862e7dad), inside two freed 1024² BC7 textures. Their history:

texture freed because freed before the fault ever in a descriptor slot
A released by the title, one holder ~47 frames no
B released by the title, one holder ~20 frames no

Over the whole run, 1194 of 1207 frees were title releases and 13 were slot overwrites. None skipped retirement, and every free came exactly 4 frames after its retirement.

So I take back "retirement frees too early". These textures weren't read by anything after they were freed. They only occupied the address range the shader reads, which matches what @⁠ka1qux found. Never freeing anything just turns this into a read of a live texture, which is why that run lasted longer. The real problem looks like a read far outside the copy the shader was given.

That run also had a local change that copies root views outside buffer objects as far as committed memory goes (1–16 MiB instead of the 4 MiB window). It didn't prevent this fault. The draw's root SRV copy is only 4 MiB because committed memory stops there, and the faulting address is about 21 MB past the root SRV's address. Next I'm logging where the faulting address falls in title memory when read through each nearby copy.

No game data in this comment. AI-assisted (Claude); tested only on the GPU above.

**@⁠tightfall** on GitHub · 2026-11-24 02:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7119939639) A correction to my last comment, from a new measurement: same setup (**RX 9070, Windows 11, Adrenalin 26.11.2**, this PR at `9dac364` merged with `main` at `d2a4bae`, diagnostics build with DRED). **What I added (local diagnostics only):** every host texture gets a number in its D3D12 name, and each free logs why the texture was retired (title release or descriptor slot) and how many frames before. **Result (one run, world ~1:40):** the same fault as before, in the same mesh pipeline (`DispatchMesh`, mesh `857b2e13c9cc107f`, pixel `63051e97862e7dad`), inside two freed 1024² BC7 textures. Their history: | texture | freed because | freed before the fault | ever in a descriptor slot | |---|---|---|---| | A | released by the title, one holder | ~47 frames | no | | B | released by the title, one holder | ~20 frames | no | Over the whole run, 1194 of 1207 frees were title releases and 13 were slot overwrites. None skipped retirement, and every free came exactly 4 frames after its retirement. So I take back "retirement frees too early". These textures weren't read by anything after they were freed. They only occupied the address range the shader reads, which matches what @⁠ka1qux found. Never freeing anything just turns this into a read of a live texture, which is why that run lasted longer. The real problem looks like a read far outside the copy the shader was given. That run also had a local change that copies root views outside buffer objects as far as committed memory goes (1–16 MiB instead of the 4 MiB window). It didn't prevent this fault. The draw's root SRV copy is only 4 MiB because committed memory stops there, and the faulting address is about 21 MB past the root SRV's address. Next I'm logging where the faulting address falls in title memory when read through each nearby copy. No game data in this comment. AI-assisted (Claude); tested only on the GPU above.
Author
Owner

@⁠jimokulou2-ops on GitHub · 2026-11-24 02:50 UTC · original

Another RDNA4 run, this time with #294 on top. The freed-texture fault stays. In two runs the address is about 32 MiB past the start of the stopped draw's root SRV copy. That is outside the 16 MiB window @⁠ka1qux searched above. 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, Ryzen 7 9700X, RX 9070 XT (RDNA4, Adrenalin 26.11.2 / 32.0.32029.2010), diag + VICTORY_D3D12_DRED=1, v1.0.2.1, Series X mode. The builds are local merges onto main d2a4bae + #197 (input only).

This PR + #294 (bffaefd): #294 conflicts with this PR in draw.rs, at the root-view binding. I took #294's side there, its zeroed fallback, and kept this PR's dropped draws for failed tables. cargo test --workspace gives 271 passed, 0 failed, 4 ignored. Results:

  • ~194 s in the world (34 five-second intervals) until removal.
  • No no free dynamic descriptor slots. #294's binding zeroed fallback warning never fired.
  • At the end, page fault at 0x490f33000; inside freed ["texture 1024x1024 f99 …", "texture 1024x1024 f98 …", "texture 1024x1024 f98 …"].
  • The stopped list was at command 61 of 240, in a run of DispatchMesh of a mesh-only pipeline, mesh c98d45f9c0757861 (no pixel shader). This is not the 857b2e13c9cc107f from the reports above.

So, on this card and in one run, #294 does not change the outcome: the time in the world is within the 1:40-3:25 range reported for this PR alone.

Where the address falls. For the commands noted between the stopped list's barriers, I computed fault − root view host copy start:

run stopped draw root view host copy fault − copy start
this PR + #294 cmd 61, c98d45f9c0757861, root2 0x48ef335d0, length 0x13ca30 0x1fffa30: the faulting page is exactly the copy's page + 0x2000000
#336 alone (3c81420) cmd 463, 857b2e13c9cc107f, root3 0x3bd525cb0, length 0x5a350 0x1fa2350 (~31.6 MiB)

In both runs the stopped draw's root SRV copy is 0.4-1.3 MB long, and the fault lies about 32 MiB past its start, or 30-31 MiB past its end. Every other root view noted in those windows starts 23 MiB to several GiB above the fault, so these two are the only copies that lie below it at a short distance. @⁠tightfall measured about 21 MB above, so the distance is not always the same. I have not checked the shader's code, so I can't say whether it reads root + 32 MiB or the address only happens to fit. A console buffer read past num_records returns 0, while a D3D12 root SRV has no bounds, so a read like that would fault on the PC only. Logs are available if useful.

Not tested: more runs of either build; #294 alone; the translated code of c98d45f9c0757861 or 857b2e13c9cc107f.

**@⁠jimokulou2-ops** on GitHub · 2026-11-24 02:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7120531754) Another RDNA4 run, this time with #294 on top. The freed-texture fault stays. In two runs the address is about 32 MiB past the start of the stopped draw's root SRV copy. That is outside the 16 MiB window @⁠ka1qux searched above. 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, Ryzen 7 9700X, RX 9070 XT (RDNA4, Adrenalin 26.11.2 / 32.0.32029.2010), `diag` + `VICTORY_D3D12_DRED=1`, v1.0.2.1, Series X mode. The builds are local merges onto `main` `d2a4bae` + #197 (input only). **This PR + #294 (`bffaefd`):** #294 conflicts with this PR in `draw.rs`, at the root-view binding. I took #294's side there, its zeroed fallback, and kept this PR's dropped draws for failed tables. `cargo test --workspace` gives 271 passed, 0 failed, 4 ignored. Results: - ~194 s in the world (34 five-second intervals) until removal. - No `no free dynamic descriptor slots`. #294's `binding zeroed fallback` warning never fired. - At the end, `page fault at 0x490f33000; inside freed ["texture 1024x1024 f99 …", "texture 1024x1024 f98 …", "texture 1024x1024 f98 …"]`. - The stopped list was at command 61 of 240, in a run of `DispatchMesh` of a mesh-only pipeline, `mesh c98d45f9c0757861` (no pixel shader). This is not the `857b2e13c9cc107f` from the reports above. So, on this card and in one run, #294 does not change the outcome: the time in the world is within the 1:40-3:25 range reported for this PR alone. **Where the address falls.** For the commands noted between the stopped list's barriers, I computed `fault − root view host copy start`: | run | stopped draw | root view host copy | fault − copy start | |---|---|---|---| | this PR + #294 | cmd 61, `c98d45f9c0757861`, `root2` | `0x48ef335d0`, length `0x13ca30` | `0x1fffa30`: the faulting page is exactly the copy's page + `0x2000000` | | #336 alone (`3c81420`) | cmd 463, `857b2e13c9cc107f`, `root3` | `0x3bd525cb0`, length `0x5a350` | `0x1fa2350` (~31.6 MiB) | In both runs the stopped draw's root SRV copy is 0.4-1.3 MB long, and the fault lies about 32 MiB past its start, or 30-31 MiB past its end. Every other root view noted in those windows starts 23 MiB to several GiB above the fault, so these two are the only copies that lie below it at a short distance. @⁠tightfall measured about 21 MB above, so the distance is not always the same. I have not checked the shader's code, so I can't say whether it reads root + 32 MiB or the address only happens to fit. A console buffer read past `num_records` returns 0, while a D3D12 root SRV has no bounds, so a read like that would fault on the PC only. Logs are available if useful. **Not tested:** more runs of either build; #294 alone; the translated code of `c98d45f9c0757861` or `857b2e13c9cc107f`.
Author
Owner

@⁠ka1qux on GitHub · 2026-11-24 02:53 UTC · original

Follow-up with measurements, same setup as before (RX 7800 XT, main at d2a4bae + this PR + #205 + #214, diagnostics build with DRED). This agrees with @⁠tightfall's correction, and I withdrew the root-view explanation too early in my last comment.

Short reads past a copy's end (measured). In three runs the fault was just past the end of a 4 MiB copy of title memory outside buffer objects, inside freed textures that were never in a descriptor slot:

time in the world fault past the copy's end root view closest to that end
~60 s 0x17000 starts 0x236b0 before it
115 s 0x17000 starts 0x236b0 before it
149 s 0x1000 starts 0x4950 before it

The first two are the same case: four root views at the same offsets in the window (0, 0x2441c0, 0x3244f0, 0x3dc950), and DRED stopping at the same command index of a list (256, a Dispatch) in both. For the third I queried the title's side: its memory is committed for another 0x290000 bytes past the copy's end, so the data was there and only the host copy stops at the window.

Placing the copies in shared heaps (local experiment). With every loose copy placed one after another in 512 MiB heaps, so that what follows a copy on the GPU is always mapped, none of three runs hit that fault. They did not become stable:

run time in the world how it ended
played by hand 12 min closed by hand, no fault
scripted input 232 s fault inside a freed texture and a freed upload staging buffer, about 28 MiB above the nearest copy below; the title has nothing committed at the matching address
scripted input 223 s fault at a low address that is in no live or freed allocation, during a single compute-only list (first unfinished dispatch: compute 5b6eed17c131f881); no no free dynamic descriptor slots warning

So this removes one class and exposes others. It is not a fix. A fixed tail is not enough either: with 4 MiB added to root views' copies, one run lasted 163 s and faulted 11.6 MiB past the end of the extended copy.

In the 232 s run a mesh draw's root SRV starts 0x1858000 (25.5 MiB) below the fault. With the copies packed in heaps I can't tie the fault to that view, but the distance is in the range @⁠jimokulou2-ops (about 32 MiB) and @⁠tightfall (about 21 MB) report, so the long reads look like a second class that contiguous copies would not cover.

Process memory was the same with and without the heaps, about 25 GB private in the world.

Not tested: more than these runs; any other GPU; the translated code of the shaders involved. I can share the diagnostics patch if it is useful.

No game data in this comment. AI-assisted (Claude Code).

**@⁠ka1qux** on GitHub · 2026-11-24 02:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7120577434) Follow-up with measurements, same setup as before (RX 7800 XT, `main` at `d2a4bae` + this PR + #205 + #214, diagnostics build with DRED). This agrees with @⁠tightfall's correction, and I withdrew the root-view explanation too early in my last comment. **Short reads past a copy's end (measured).** In three runs the fault was just past the end of a 4 MiB copy of title memory outside buffer objects, inside freed textures that were never in a descriptor slot: | time in the world | fault past the copy's end | root view closest to that end | |---|---|---| | ~60 s | `0x17000` | starts `0x236b0` before it | | 115 s | `0x17000` | starts `0x236b0` before it | | 149 s | `0x1000` | starts `0x4950` before it | The first two are the same case: four root views at the same offsets in the window (`0`, `0x2441c0`, `0x3244f0`, `0x3dc950`), and DRED stopping at the same command index of a list (256, a `Dispatch`) in both. For the third I queried the title's side: its memory is committed for another `0x290000` bytes past the copy's end, so the data was there and only the host copy stops at the window. **Placing the copies in shared heaps (local experiment).** With every loose copy placed one after another in 512 MiB heaps, so that what follows a copy on the GPU is always mapped, none of three runs hit that fault. They did not become stable: | run | time in the world | how it ended | |---|---|---| | played by hand | 12 min | closed by hand, no fault | | scripted input | 232 s | fault inside a freed texture and a freed upload staging buffer, about 28 MiB above the nearest copy below; the title has nothing committed at the matching address | | scripted input | 223 s | fault at a low address that is in no live or freed allocation, during a single compute-only list (first unfinished dispatch: compute `5b6eed17c131f881`); no `no free dynamic descriptor slots` warning | So this removes one class and exposes others. It is not a fix. A fixed tail is not enough either: with 4 MiB added to root views' copies, one run lasted 163 s and faulted 11.6 MiB past the end of the extended copy. In the 232 s run a mesh draw's root SRV starts `0x1858000` (25.5 MiB) below the fault. With the copies packed in heaps I can't tie the fault to that view, but the distance is in the range @⁠jimokulou2-ops (about 32 MiB) and @⁠tightfall (about 21 MB) report, so the long reads look like a second class that contiguous copies would not cover. Process memory was the same with and without the heaps, about 25 GB private in the world. **Not tested:** more than these runs; any other GPU; the translated code of the shaders involved. I can share the diagnostics patch if it is useful. No game data in this comment. AI-assisted (Claude Code).
Author
Owner

@⁠ka1qux on GitHub · 2026-11-24 03:25 UTC · original

Follow-up: reading the shaders explains both the short and the long reads past a root view's copy, and predicted a result that held. Same setup as before (RX 7800 XT, main at d2a4bae + this PR + #205 + #214, diagnostics build with DRED, scripted input).

How the mesh shaders address their root SRV. I read the native code of the mesh shaders named in the fault reports here (857b2e13c9cc107f, c98d45f9c0757861, 89036e16fa081505); the emitted DXIL does the same arithmetic, so this is not a translation bug.

  • The root SRV is a byte buffer holding one mesh's data. The shader builds its buffer descriptor itself, with the record count set to 0xFFFFFFFF: on the console the read has no bound.
  • A header at the start holds one word per vertex stream. Each word packs a format (4 bits), a stride (up to 60 bytes) and a 25-bit offset, so a stream can start up to 32 MiB past the root address. The read is at offset + stride × index, with a 16-bit index: about 36 MiB of reach at most.
  • Some of those loads run whatever the stream's format is, and the result is dropped afterwards.

441 of the 479 mesh shaders the title created in one run use this layout, which fits the faulting pipeline being different on every run.

Every distance reported in this thread fits under that cap: mine at 23 KB and 239 KB (a stream crossing the end of a 4 MiB window) and at 16 and 25.5 MiB, @⁠tightfall's 21 MB, @⁠jimokulou2-ops's 31.6 MiB and the page at exactly +0x2000000, which is the offset field with every bit set.

The prediction. In my last comment, placing the loose copies in 512 MiB heaps removed the faults next to a copy, but one run still faulted 28 MiB past the last copy of a heap. I had left 16 MiB unused at the end of each heap, less than the 36 MiB reach. With 48 MiB:

unused margin per heap time in the world how it ended
16 MiB 232 s fault inside a freed texture, 28 MiB past the last copy
16 MiB 223 s fault at a low address, compute-only list
48 MiB 459 s stopped by hand, no fault
48 MiB over 510 s still running when I wrote this, no fault

Without the heaps, the same script faults in 115 s and 149 s.

What this is and is not. It is evidence for the cause, not a fix to merge: the reads past the copy now return other copies' bytes or zeros instead of the title's data, and it costs memory (about 28 GB private against 25 GB). What it suggests for a real fix is that a root SRV's copy has to stay mapped for about 36 MiB past its address, and hold the title's data wherever the title has memory committed there. Where the title has nothing committed, the value does not seem to matter, only that the read does not fault.

A separate failure, for whoever tests long runs. Once the title wrote its first autosave (after about 7 minutes in the world), every later run continued from it and lost the device about 15 s into the world with DXGI_ERROR_DEVICE_HUNG, no page fault: submissions grew from 0.3 s to 3 s, stopping at a draw of mesh 04b9be3756e8f41c. That happened with and without the heaps, three runs in a row, and stopped when I moved the save aside.

Not tested: any other GPU; more than the runs listed; whether the streams read past the committed memory are really absent ones.

No game data in this comment. AI-assisted (Claude Code).

**@⁠ka1qux** on GitHub · 2026-11-24 03:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7121080420) Follow-up: reading the shaders explains both the short and the long reads past a root view's copy, and predicted a result that held. Same setup as before (RX 7800 XT, `main` at `d2a4bae` + this PR + #205 + #214, diagnostics build with DRED, scripted input). **How the mesh shaders address their root SRV.** I read the native code of the mesh shaders named in the fault reports here (`857b2e13c9cc107f`, `c98d45f9c0757861`, `89036e16fa081505`); the emitted DXIL does the same arithmetic, so this is not a translation bug. - The root SRV is a byte buffer holding one mesh's data. The shader builds its buffer descriptor itself, with the record count set to `0xFFFFFFFF`: on the console the read has no bound. - A header at the start holds one word per vertex stream. Each word packs a format (4 bits), a stride (up to 60 bytes) and a 25-bit offset, so a stream can start up to 32 MiB past the root address. The read is at `offset + stride × index`, with a 16-bit index: about 36 MiB of reach at most. - Some of those loads run whatever the stream's format is, and the result is dropped afterwards. 441 of the 479 mesh shaders the title created in one run use this layout, which fits the faulting pipeline being different on every run. Every distance reported in this thread fits under that cap: mine at 23 KB and 239 KB (a stream crossing the end of a 4 MiB window) and at 16 and 25.5 MiB, @⁠tightfall's 21 MB, @⁠jimokulou2-ops's 31.6 MiB and the page at exactly `+0x2000000`, which is the offset field with every bit set. **The prediction.** In my last comment, placing the loose copies in 512 MiB heaps removed the faults next to a copy, but one run still faulted 28 MiB past the last copy of a heap. I had left 16 MiB unused at the end of each heap, less than the 36 MiB reach. With 48 MiB: | unused margin per heap | time in the world | how it ended | |---|---|---| | 16 MiB | 232 s | fault inside a freed texture, 28 MiB past the last copy | | 16 MiB | 223 s | fault at a low address, compute-only list | | 48 MiB | 459 s | stopped by hand, no fault | | 48 MiB | over 510 s | still running when I wrote this, no fault | Without the heaps, the same script faults in 115 s and 149 s. **What this is and is not.** It is evidence for the cause, not a fix to merge: the reads past the copy now return other copies' bytes or zeros instead of the title's data, and it costs memory (about 28 GB private against 25 GB). What it suggests for a real fix is that a root SRV's copy has to stay mapped for about 36 MiB past its address, and hold the title's data wherever the title has memory committed there. Where the title has nothing committed, the value does not seem to matter, only that the read does not fault. **A separate failure, for whoever tests long runs.** Once the title wrote its first autosave (after about 7 minutes in the world), every later run continued from it and lost the device about 15 s into the world with `DXGI_ERROR_DEVICE_HUNG`, no page fault: submissions grew from 0.3 s to 3 s, stopping at a draw of mesh `04b9be3756e8f41c`. That happened with and without the heaps, three runs in a row, and stopped when I moved the save aside. **Not tested:** any other GPU; more than the runs listed; whether the streams read past the committed memory are really absent ones. No game data in this comment. AI-assisted (Claude Code).
Author
Owner

@⁠itsonlysimbo on GitHub · 2026-11-24 03:54 UTC · original

NVIDIA data point for the capped-heap path: DYNAMIC_CAPPED = 1 << 16 still runs out in the world, and 1 << 18 did not run out in any of my runs.

Setup: RTX 4070 (driver 32.0.16.2101), Windows 11. main at d2a4bae + this PR + #251, diagnostics build, DRED on. The host refuses a view heap over 1,000,000 descriptors on this card ("host view heap capped at 1000000" at start), so this PR takes the capped branch.

With DYNAMIC_CAPPED = 1 << 16: "no free dynamic descriptor slots: a table is not made" about 50 s after start, in the first world frames. The drop from this PR held (the draws were dropped, no fallback to the stale table), but the pool stayed exhausted.

With DYNAMIC_CAPPED = 1 << 18 (737,856 title slots left below the cap): the warning never appeared, in 9 world runs of 79–160 s each (also with #402, #393, #329 and #307 on top in some of them). No "title slot past the host heap" warning appeared either.

Before this PR (plain d2a4bae), the same exhaustion was followed by device removal 1–68 s later in every run, the same pattern #336 describes.

The device removals that remain after this change are a separate problem: no page fault, a different mesh or compute pipeline almost every run, and still there with the pool fixed. I'll post those separately if they turn out to be useful.

Written by Claude Code (Claude Opus 5.5), which ran the builds and read the logs.

**@⁠itsonlysimbo** on GitHub · 2026-11-24 03:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7121528355) NVIDIA data point for the capped-heap path: `DYNAMIC_CAPPED = 1 << 16` still runs out in the world, and `1 << 18` did not run out in any of my runs. **Setup:** RTX 4070 (driver 32.0.16.2101), Windows 11. `main` at `d2a4bae` + this PR + #251, diagnostics build, DRED on. The host refuses a view heap over 1,000,000 descriptors on this card ("host view heap capped at 1000000" at start), so this PR takes the capped branch. **With `DYNAMIC_CAPPED = 1 << 16`:** "no free dynamic descriptor slots: a table is not made" about 50 s after start, in the first world frames. The drop from this PR held (the draws were dropped, no fallback to the stale table), but the pool stayed exhausted. **With `DYNAMIC_CAPPED = 1 << 18`** (737,856 title slots left below the cap): the warning never appeared, in 9 world runs of 79–160 s each (also with #402, #393, #329 and #307 on top in some of them). No "title slot past the host heap" warning appeared either. **Before this PR** (plain `d2a4bae`), the same exhaustion was followed by device removal 1–68 s later in every run, the same pattern #336 describes. The device removals that remain after this change are a separate problem: no page fault, a different mesh or compute pipeline almost every run, and still there with the pool fixed. I'll post those separately if they turn out to be useful. Written by Claude Code (Claude Opus 5.5), which ran the builds and read the logs.
Author
Owner

@⁠blazerTweaks on GitHub · 2026-11-24 04:01 UTC · original

Tested on NVIDIA, where the heap is capped: RTX 3060 Ti (Ampere, driver 32.0.16.1714), Windows 10 19045. The base is d2a4bae + the Agility exports (#175), and the other run is the same + this PR (9dac364) merged cleanly. Diag build, VICTORY_D3D12_DRED=1. One run each.

without #135 with #135
time in the world before device removal 36 s 3 min 07 s
no free dynamic descriptor slots once, then removal 40 s later once, 12 s into the world (n=258 cap=65536); no removal at that point
DRED stop indirect kind 10 [mesh 09c742c58e9acb62, pixel 9ee9a1b0ecdf7b74]; its table root u9 is view 1,168,095, past the 1,000,000 cap mesh 159 [mesh 4adfa13bea1c556a] at command 3 of 70 (op 42); its tables are at views 329,720 and 911,918, below the cap
page fault none none
last submission 4,832 ms, 32 lists 5,331 ms, 26 lists

My reading:

  • On NVIDIA the pool stays at DYNAMIC_CAPPED (65,536) and still runs out. But dropping the draw instead of running it on a stale or missing table removes the hang I posted on #71, where a table past the cap was read.
  • The removal that's left looks unrelated to descriptors. It's a multi-second submission whose stop is 4adfa13bea1c556a, one of the mesh programs #71 lists as having no back-edges.
  • In the world it ran at 2–5 s per frame, with 500–2,000 draws per frame dropped "without a host pipeline".

No regressions seen before the world: menus, intro, start screen and loading behave as without the PR.

AI-assisted (Claude Code); the runs are mine.

**@⁠blazerTweaks** on GitHub · 2026-11-24 04:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7121640899) Tested on NVIDIA, where the heap is capped: RTX 3060 Ti (Ampere, driver 32.0.16.1714), Windows 10 19045. The base is `d2a4bae` + the Agility exports (#175), and the other run is the same + this PR (`9dac364`) merged cleanly. Diag build, `VICTORY_D3D12_DRED=1`. One run each. | | without #135 | with #135 | |---|---|---| | time in the world before device removal | **36 s** | **3 min 07 s** | | `no free dynamic descriptor slots` | once, then removal 40 s later | once, 12 s into the world (`n=258 cap=65536`); no removal at that point | | DRED stop | `indirect kind 10 [mesh 09c742c58e9acb62, pixel 9ee9a1b0ecdf7b74]`; its table root `u9` is view 1,168,095, past the 1,000,000 cap | `mesh 159 [mesh 4adfa13bea1c556a]` at command 3 of 70 (op 42); its tables are at views 329,720 and 911,918, below the cap | | page fault | none | none | | last submission | 4,832 ms, 32 lists | 5,331 ms, 26 lists | My reading: - On NVIDIA the pool stays at `DYNAMIC_CAPPED` (65,536) and still runs out. But dropping the draw instead of running it on a stale or missing table removes the hang I posted on #71, where a table past the cap was read. - The removal that's left looks unrelated to descriptors. It's a multi-second submission whose stop is `4adfa13bea1c556a`, one of the mesh programs #71 lists as having no back-edges. - In the world it ran at 2–5 s per frame, with 500–2,000 draws per frame dropped "without a host pipeline". No regressions seen before the world: menus, intro, start screen and loading behave as without the PR. AI-assisted (Claude Code); the runs are mine.
Author
Owner

@⁠blazerTweaks on GitHub · 2026-11-24 04:22 UTC · original

Follow-up on the same RTX 3060 Ti (Windows 10 19045). This time a release build (d2a4bae + #175 + this PR, --features agility, no DRED/diagnostics):

  • 7 min 42 s in the world with no device removal. I closed the window myself (the log has window closed and no host GPU failure). The diag run above was removed after 3 min 07 s, and without this PR it's 36 s.
  • no free dynamic descriptor slots ... n=97 cap=65536 still fires once, 4 s into the world, and no hang follows.
  • The opening credits render correctly over the world. The 3D scene behind them stays black: about 450–600 draws per frame run on the host and the rest are dropped "without a host pipeline".
  • Frames take 4–12 s. Late in the run most of that is preparing: copies (up to 6.5 s and about 77 MB per frame), with 1.5–3 s on the GPU.

So on this card, with this PR, the remaining limits are untranslated programs and copy cost, not device loss.

AI-assisted (Claude Code); the run is mine.

**@⁠blazerTweaks** on GitHub · 2026-11-24 04:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7121953095) Follow-up on the same RTX 3060 Ti (Windows 10 19045). This time a **release** build (`d2a4bae` + #175 + this PR, `--features agility`, no DRED/diagnostics): - **7 min 42 s in the world with no device removal.** I closed the window myself (the log has `window closed` and no host GPU failure). The diag run above was removed after 3 min 07 s, and without this PR it's 36 s. - `no free dynamic descriptor slots ... n=97 cap=65536` still fires once, 4 s into the world, and no hang follows. - The opening credits render correctly over the world. The 3D scene behind them stays black: about 450–600 draws per frame run on the host and the rest are dropped "without a host pipeline". - Frames take 4–12 s. Late in the run most of that is `preparing: copies` (up to 6.5 s and about 77 MB per frame), with 1.5–3 s on the GPU. So on this card, with this PR, the remaining limits are untranslated programs and copy cost, not device loss. AI-assisted (Claude Code); the run is mine.
Author
Owner

@⁠itsRevela on GitHub · 2026-11-24 05:34 UTC · original

Measured with the title, in the opening cutscene:

  • Setup: RTX 3070 Ti (driver 32.0.16.1088) through Windows Sandbox's vGPU, Windows 11 26200.
  • Build: diag build of d2a4bae + #302 #489 #307 #346, with and without this PR.
  • Method: a warm shader cache on both sides, and 3 frames picked by draw count (#500).

In the cutscene, the pool runs out: no free dynamic descriptor slots: a table is not made n=133 cap=65536. On this NVIDIA setup the shader-visible view heap is also capped: host view heap capped at 1000000 ... count=1245184.

Without this PR the same warning appears and the draw goes ahead. With it, the draw is dropped:

without #135 with #135
indirect kind 10: prepare failed (compute false, mesh true) none ~430 dropped per frame
scene depth buffer differing from its clear value 4.9-5.5% 0.8-2.8%

So in the cutscene, dropping instead of falling back loses about 430 indirect mesh dispatches a frame that drew before, and with them most of the little depth the scene had. The fallback tables were stale, so they weren't right either, but they drew something. Two things that might help:

  • a pool sized from what's left in the shader-visible heap, which here is the 1,000,000 cap less the static part;
  • recycling slots per frame before giving up.

Counts only. AI-assisted (Claude Code).

**@⁠itsRevela** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/135#issuecomment-7123079477) Measured with the title, in the opening cutscene: - **Setup:** RTX 3070 Ti (driver 32.0.16.1088) through Windows Sandbox's vGPU, Windows 11 26200. - **Build:** `diag` build of `d2a4bae` + #302 #489 #307 #346, with and without this PR. - **Method:** a warm shader cache on both sides, and 3 frames picked by draw count (#500). In the cutscene, the pool runs out: `no free dynamic descriptor slots: a table is not made n=133 cap=65536`. On this NVIDIA setup the shader-visible view heap is also capped: `host view heap capped at 1000000 ... count=1245184`. Without this PR the same warning appears and the draw goes ahead. With it, the draw is dropped: | | without #135 | with #135 | |---|---|---| | `indirect kind 10: prepare failed (compute false, mesh true)` | none | ~430 dropped per frame | | scene depth buffer differing from its clear value | 4.9-5.5% | 0.8-2.8% | So in the cutscene, dropping instead of falling back loses about 430 indirect mesh dispatches a frame that drew before, and with them most of the little depth the scene had. The fallback tables were stale, so they weren't right either, but they drew something. Two things that might help: - a pool sized from what's left in the shader-visible heap, which here is the 1,000,000 cap less the static part; - recycling slots per frame before giving up. Counts only. AI-assisted (Claude Code).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!135
No description provided.