World entry after #336: device removed reading freed streaming textures (page fault inside freed texture 1024x1024) #557

Open
opened 2026-11-26 04:08:15 +00:00 by github-bot · 27 comments
Owner

@⁠KingKaom on GitHub · 2026-11-24 04:52 UTC · original

Build: pr336 head on d2a4bae (also merged with pr458); RX 9070 XT, 9800X3D, Windows 11 26300, driver 32.0.32029.2010. Follow-up to #304: with #336 the dynamic-slot warning is gone entirely and the world runs longer, but it still dies the same family of way.

Symptom. 30-180 s into the world (six runs: 34, 47, 59, 79, 127, plus one 21 s), DXGI_ERROR_DEVICE_HUNG with DRED:

page fault at 0x3a5f76000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"]

Always the same victim class — a freed 1024x1024 texture (once: freed title-memory copies) — and the stopped command is always an ExecuteIndirect kind 10 (mesh) list, a different mesh pipeline each run. The breadcrumb tail ends 0/156: the faulting list had not finished its first command.

Theory. The title streams: it releases a texture as soon as the CPU is done, while indirect commands already submitted may still read it through whatever value a shader-visible-heap slot held at record time — the console keeps the backing memory alive until it is reused, so that is legal. On VIctory the host copy can be released the moment the last named user drops, and lists only hold textures they could name: indirect arguments are written by compute on the GPU, so nobody holds these.

Experiment. A small patch parking host textures (and slot-replacement resources) in a late-keep queue drained by HostList::reset (which runs only after submissions were waited for) instead of releasing on the CPU drop:

impl Drop for HostTexture {
    fn drop(&mut self) { crate::descriptor::host::late_keep(&self.texture); }
}

Survival grew (47 s -> 59-127 s across three runs) but the same fault still lands, so the lifetime gap looks real yet wider than what the lists name — the drain point may still be too early for multi-list frames, or more free paths bypass named holds than this covers. Sharing the data in case it saves a round-trip; happy to test variants on RDNA4.

AI-assisted (Hermes Agent).

**@⁠KingKaom** on GitHub · 2026-11-24 04:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/557) **Build:** `pr336` head on `d2a4bae` (also merged with `pr458`); RX 9070 XT, 9800X3D, Windows 11 26300, driver 32.0.32029.2010. Follow-up to #304: with #336 the dynamic-slot warning is gone entirely and the world runs longer, but it still dies the same family of way. **Symptom.** 30-180 s into the world (six runs: 34, 47, 59, 79, 127, plus one 21 s), `DXGI_ERROR_DEVICE_HUNG` with DRED: ``` page fault at 0x3a5f76000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"] ``` Always the same victim class — a freed 1024x1024 texture (once: freed title-memory copies) — and the stopped command is always an `ExecuteIndirect` kind 10 (mesh) list, a different mesh pipeline each run. The breadcrumb tail ends `0/156`: the faulting list had not finished its first command. **Theory.** The title streams: it releases a texture as soon as the CPU is done, while indirect commands already submitted may still read it through whatever value a shader-visible-heap slot held at record time — the console keeps the backing memory alive until it is reused, so that is legal. On VIctory the host copy can be released the moment the last *named* user drops, and lists only hold textures they could name: indirect arguments are written by compute on the GPU, so nobody holds these. **Experiment.** A small patch parking host textures (and slot-replacement resources) in a late-keep queue drained by `HostList::reset` (which runs only after submissions were waited for) instead of releasing on the CPU drop: ```rust impl Drop for HostTexture { fn drop(&mut self) { crate::descriptor::host::late_keep(&self.texture); } } ``` Survival grew (47 s -> 59-127 s across three runs) but the same fault still lands, so the lifetime gap looks real yet wider than what the lists name — the drain point may still be too early for multi-list frames, or more free paths bypass named holds than this covers. Sharing the data in case it saves a round-trip; happy to test variants on RDNA4. AI-assisted (Hermes Agent).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:08:15 +00:00
Author
Owner

@⁠Len1k on GitHub · 2026-11-24 04:57 UTC · original

The experiment's result points somewhere useful: the drain point is probably fine, but Drop for HostTexture is one of at least three free paths, and it is not the one that a mesh ExecuteIndirect list can reach.

Why HostList::reset is a sound drain point. Host::execute (crates/victory-gpu/src/host.rs:492) signals the queue's fence and calls WaitForSingleObject(self.event, INFINITE) per group before returning, and reset is the title reusing a list (crates/victory-gpu/src/list.rs:254, "Every submission of the list has run (submissions are waited for)"). So anything drained there is provably past GPU use. Two caveats on top of that: the drain only runs when the title resets the list, so a list the title abandons never drains (that leaks, it does not fault), and allocator_reset is a no-op stub.

Free paths Drop for HostTexture does not cover.

  1. HostHeap::keep (crates/victory-gpu/src/descriptor/host.rs:279):

    fn keep(&self, index: u32, resource: Option<ID3D12Resource>) {
        let mut kept = self.kept.lock().unwrap_or_else(|e| e.into_inner());
        if let Some(slot) = kept.get_mut(index as usize) {
            *slot = resource;      // the previous ID3D12Resource is released here
        }
    }
    

    Rewriting a slot (make_at, make_null, mirror at line 353, constant_at at line 289) drops the resource the slot held inline on the CPU, during recording. That is not HostTexture::drop, so a late-keep installed there never sees it. HostHeap's own comment (descriptor/host.rs:25-29) says the slot holds the resource precisely because "a slot the title has not rewritten since it released the resource may still be read" — the mirror image of that case is a slot the title rewrote while a queued list still reads the old contents through an index it takes from GPU memory.

  2. shadow::unregister (crates/victory-gpu/src/shadow.rs:391):

    /// The title released it; lists that still hold its copy keep it alive.
    pub(crate) fn unregister(resource: usize, start: u64) {
        buffers().remove(&(start, resource));
    }
    

    The Arc<Shadow> goes away here, and with it Shadow::buffer (ID3D12Resource). "Lists that still hold its copy" is true only for a copy a list named — vertex and index binds (draw::prepare_for, draw.rs:335) hold one. A mesh ExecuteIndirect does not: the arguments are written by compute into a shadow buffer and never read back on the CPU, so the host cannot know which title address the list will read. That is the exact shape of your fault — stopped command is always an ExecuteIndirect kind 10, victim always a freed texture.

  3. make_null / keep(index, None) release the slot's resource the same way, and HostList::reset clears states/pipelines (host.rs:880) — that one is safe by the wait above.

What that suggests for the patch. Move the late-keep out of Drop for HostTexture and into the two places that actually release: the *slot = resource assignment in HostHeap::keep, and shadow::unregister. A single global late_keep(ID3D12Resource) drained at the fence wait in Host::execute after WaitForSingleObject is strictly safer than draining at reset, because the wait is the proof and it fires for every submission. Note that shadow::loose (shadow.rs:448) already never frees its windows — the shortcut at line 441 — so loose-memory shadows cannot be the victim; only BUFFERS entries can.

Two things I cannot check from here: whether DRED's type 34 resolves to one of these paths or to a pooled snapshot Vec<u8>, and whether Deferred already holds every Arc<Shadow> a list took (if it does, path 2 needs a different explanation than the one above and I would drop it). I have the source but no Rust toolchain and no title files on this machine, so I cannot build or run anything — read this as code-level only, nothing tested.

Happy to write it as a PR if it is useful, with the build and test done by someone who has the toolchain.

AI-assisted.

**@⁠Len1k** on GitHub · 2026-11-24 04:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122494350) The experiment's result points somewhere useful: the drain point is probably fine, but `Drop for HostTexture` is one of at least three free paths, and it is not the one that a mesh `ExecuteIndirect` list can reach. **Why `HostList::reset` is a sound drain point.** `Host::execute` (`crates/victory-gpu/src/host.rs:492`) signals the queue's fence and calls `WaitForSingleObject(self.event, INFINITE)` per group before returning, and `reset` is the title reusing a list (`crates/victory-gpu/src/list.rs:254`, "Every submission of the list has run (submissions are waited for)"). So anything drained there is provably past GPU use. Two caveats on top of that: the drain only runs when the *title* resets the list, so a list the title abandons never drains (that leaks, it does not fault), and `allocator_reset` is a no-op stub. **Free paths `Drop for HostTexture` does not cover.** 1. `HostHeap::keep` (`crates/victory-gpu/src/descriptor/host.rs:279`): ```rust fn keep(&self, index: u32, resource: Option<ID3D12Resource>) { let mut kept = self.kept.lock().unwrap_or_else(|e| e.into_inner()); if let Some(slot) = kept.get_mut(index as usize) { *slot = resource; // the previous ID3D12Resource is released here } } ``` Rewriting a slot (`make_at`, `make_null`, `mirror` at line 353, `constant_at` at line 289) drops the resource the slot held *inline on the CPU*, during recording. That is not `HostTexture::drop`, so a late-keep installed there never sees it. `HostHeap`'s own comment (`descriptor/host.rs:25-29`) says the slot holds the resource precisely because "a slot the title has not rewritten since it released the resource may still be read" — the mirror image of that case is a slot the title *rewrote* while a queued list still reads the old contents through an index it takes from GPU memory. 2. `shadow::unregister` (`crates/victory-gpu/src/shadow.rs:391`): ```rust /// The title released it; lists that still hold its copy keep it alive. pub(crate) fn unregister(resource: usize, start: u64) { buffers().remove(&(start, resource)); } ``` The `Arc<Shadow>` goes away here, and with it `Shadow::buffer` (`ID3D12Resource`). "Lists that still hold its copy" is true only for a copy a list *named* — vertex and index binds (`draw::prepare_for`, `draw.rs:335`) hold one. A mesh `ExecuteIndirect` does not: the arguments are written by compute into a shadow buffer and never read back on the CPU, so the host cannot know which title address the list will read. That is the exact shape of your fault — stopped command is always an `ExecuteIndirect` kind 10, victim always a freed texture. 3. `make_null` / `keep(index, None)` release the slot's resource the same way, and `HostList::reset` clears `states`/`pipelines` (`host.rs:880`) — that one is safe by the wait above. **What that suggests for the patch.** Move the late-keep out of `Drop for HostTexture` and into the two places that actually release: the `*slot = resource` assignment in `HostHeap::keep`, and `shadow::unregister`. A single global `late_keep(ID3D12Resource)` drained at the fence wait in `Host::execute` after `WaitForSingleObject` is strictly safer than draining at `reset`, because the wait is the proof and it fires for every submission. Note that `shadow::loose` (`shadow.rs:448`) already never frees its windows — the `shortcut` at line 441 — so loose-memory shadows cannot be the victim; only `BUFFERS` entries can. Two things I cannot check from here: whether DRED's `type 34` resolves to one of these paths or to a pooled snapshot `Vec<u8>`, and whether `Deferred` already holds every `Arc<Shadow>` a list took (if it does, path 2 needs a different explanation than the one above and I would drop it). I have the source but no Rust toolchain and no title files on this machine, so I cannot build or run anything — read this as code-level only, nothing tested. Happy to write it as a PR if it is useful, with the build and test done by someone who has the toolchain. AI-assisted.
Author
Owner

@⁠Len1k on GitHub · 2026-11-24 04:57 UTC · original

Resolving the caveat I left above, since it decides path 2: Deferred (crates/victory-gpu/src/host.rs:880's neighbour, the struct before impl Host) holds copies, uploads: Vec<ID3D12Resource>, kept: Vec<IUnknown> ("host objects the list's commands name — pipelines, root signatures, descriptor heaps"), refreshed, textures: HashSet<usize> (host texture ids, not resources), writes and budget_zeroed.

No Arc<Shadow> anywhere in it. So a list does not keep title-buffer copies alive at all — it keeps texture ids, and the ID3D12Resource behind a texture is held by HostHeap::kept (the descriptor slot), which is path 1's storage. shadow::unregister is therefore a real, unreferenced free of Shadow::buffer, and the "lists that still hold its copy keep it alive" comment at shadow.rs:391 only describes an intent that Deferred does not implement.

That makes the vertex/index path the only one that holds a copy, and it holds it by binding, which is exactly what an indirect mesh draw does not do.

**@⁠Len1k** on GitHub · 2026-11-24 04:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122497850) Resolving the caveat I left above, since it decides path 2: `Deferred` (`crates/victory-gpu/src/host.rs:880`'s neighbour, the struct before `impl Host`) holds `copies`, `uploads: Vec<ID3D12Resource>`, `kept: Vec<IUnknown>` ("host objects the list's commands name — pipelines, root signatures, descriptor heaps"), `refreshed`, `textures: HashSet<usize>` (host texture *ids*, not resources), `writes` and `budget_zeroed`. No `Arc<Shadow>` anywhere in it. So a list does not keep title-buffer copies alive at all — it keeps texture ids, and the `ID3D12Resource` behind a texture is held by `HostHeap::kept` (the descriptor slot), which is path 1's storage. `shadow::unregister` is therefore a real, unreferenced free of `Shadow::buffer`, and the "lists that still hold its copy keep it alive" comment at `shadow.rs:391` only describes an intent that `Deferred` does not implement. That makes the vertex/index path the only one that holds a copy, and it holds it by binding, which is exactly what an indirect mesh draw does not do.
Author
Owner

@⁠Amit89-beep on GitHub · 2026-11-24 04:59 UTC · original

Draining the deferred queue in HostList::reset only waits for that single command list to finish. Because ExecuteIndirect mesh draws (kind 10) read textures through indices already written into shader-visible descriptor heaps or GPU argument buffers, another command list or queue in flight across multi-list frames can still execute after an individual list resets.

  1. Dangling GPU virtual addresses in shader-visible descriptor slots
    Even when the ID3D12Resource is kept alive longer, freeing/reclaiming its slot in the shader-visible CBV_SRV_UAV heap without overwriting the descriptor leaves a stale GPU VA pointer. If a delayed indirect draw still indexes that slot, the GPU faults on the unmapped page (0x3a5f76000).

  2. Missed transient copy buffers
    As noted in the DRED log ("once: freed title-memory copies"), transient upload/alias buffers backing title-memory texture copies also need the same deferred lifetime as HostTexture.

Proposed Fix:

Global Queue-Fence Graveyard: Tag every dropped ID3D12Resource (both HostTexture and title-memory copy buffers) with the latest submitted command-queue fence value (last_submitted_fence), and only release them once queue_fence.GetCompletedValue() >= drop_fence (with a 2–3 frame safety margin across all active queues).

Null-SRV Overwrite on Slot Free: When a texture's SRV slot is freed, immediately overwrite that shader-visible heap descriptor with a valid null SRV (or 1x1 dummy black SRV) before recycling the slot index, so any stale ExecuteIndirect read samples black instead of hitting a freed GPU VA.

**@⁠Amit89-beep** on GitHub · 2026-11-24 04:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122518626) Draining the deferred queue in HostList::reset only waits for that single command list to finish. Because ExecuteIndirect mesh draws (kind 10) read textures through indices already written into shader-visible descriptor heaps or GPU argument buffers, another command list or queue in flight across multi-list frames can still execute after an individual list resets. 2. Dangling GPU virtual addresses in shader-visible descriptor slots Even when the ID3D12Resource is kept alive longer, freeing/reclaiming its slot in the shader-visible CBV_SRV_UAV heap without overwriting the descriptor leaves a stale GPU VA pointer. If a delayed indirect draw still indexes that slot, the GPU faults on the unmapped page (0x3a5f76000). 3. Missed transient copy buffers As noted in the DRED log ("once: freed title-memory copies"), transient upload/alias buffers backing title-memory texture copies also need the same deferred lifetime as HostTexture. Proposed Fix: Global Queue-Fence Graveyard: Tag every dropped ID3D12Resource (both HostTexture and title-memory copy buffers) with the latest submitted command-queue fence value (last_submitted_fence), and only release them once queue_fence.GetCompletedValue() >= drop_fence (with a 2–3 frame safety margin across all active queues). Null-SRV Overwrite on Slot Free: When a texture's SRV slot is freed, immediately overwrite that shader-visible heap descriptor with a valid null SRV (or 1x1 dummy black SRV) before recycling the slot index, so any stale ExecuteIndirect read samples black instead of hitting a freed GPU VA.
Author
Owner

@⁠Len1k on GitHub · 2026-11-24 05:18 UTC · original

Thanks — three points, one of which is a misunderstanding worth clearing up, and one of which I have now covered.

1. The drain is not in HostList::reset. It is in Host::execute (crates/victory-gpu/src/host.rs), immediately after Signal + SetEventOnCompletion + WaitForSingleObject(self.event, INFINITE). The module's own shortcut note says it: "every submission is waited for, so CPU and GPU never overlap". So the drain cannot land between two in-flight lists — no command list, on any list of a multi-list frame, can still execute when it runs. HostList::reset is only where the title reusing a list would have been a drain point, and that is exactly why I did not put it there.

2. Stale GPU VAs in shader-visible slots. In this code the descriptor is never left pointing at an unmapped resource: HostHeap::keep (descriptor/host.rs:279) always writes a replacement descriptor and stores the resource in kept (Option<ID3D12Resource> per slot), so the slot is either rewritten to a new descriptor or left holding a resource that is still alive. The bug is the third case: keep assigned the new resource over the old one, dropping the previous ID3D12Resource while that slot's old contents could still be read through an index taken from GPU-written arguments. Nothing was overwriting the descriptor to null — the resource behind a live descriptor was being freed.

3. Transient copies. Agreed, and that is the second path: shadow::unregister (shadow.rs:391) dropped the Arc<Shadow> and with it Shadow::buffer. Pooled snapshot memory (Vec<u8> in POOL) is host memory, not an ID3D12Resource, so it cannot be the page fault; shadow::loose never frees its windows at all (shortcut at shadow.rs:441).

I opened #575 for the two paths (HostHeap::keep and shadow::unregister) with the execute-time drain, cargo test -p victory-gpu 43 passed / 0 failed. It is deliberately narrow: it removes frees nothing can justify, and does not claim to fix the fault on its own — a fence-tagged graveyard with a frame margin is a bigger change than the evidence I have supports, since submissions here are already fully serialised.

**@⁠Len1k** on GitHub · 2026-11-24 05:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122820681) Thanks — three points, one of which is a misunderstanding worth clearing up, and one of which I have now covered. **1. The drain is not in `HostList::reset`.** It is in `Host::execute` (`crates/victory-gpu/src/host.rs`), immediately after `Signal` + `SetEventOnCompletion` + `WaitForSingleObject(self.event, INFINITE)`. The module's own `shortcut` note says it: "every submission is waited for, so CPU and GPU never overlap". So the drain cannot land between two in-flight lists — no command list, on any list of a multi-list frame, can still execute when it runs. `HostList::reset` is only where the *title* reusing a list would have been a drain point, and that is exactly why I did not put it there. **2. Stale GPU VAs in shader-visible slots.** In this code the descriptor is never left pointing at an unmapped resource: `HostHeap::keep` (`descriptor/host.rs:279`) always writes a replacement descriptor *and* stores the resource in `kept` (`Option<ID3D12Resource>` per slot), so the slot is either rewritten to a new descriptor or left holding a resource that is still alive. The bug is the third case: `keep` assigned the new resource over the old one, dropping the previous `ID3D12Resource` **while that slot's old contents could still be read** through an index taken from GPU-written arguments. Nothing was overwriting the descriptor to null — the resource behind a live descriptor was being freed. **3. Transient copies.** Agreed, and that is the second path: `shadow::unregister` (`shadow.rs:391`) dropped the `Arc<Shadow>` and with it `Shadow::buffer`. Pooled snapshot memory (`Vec<u8>` in `POOL`) is host memory, not an `ID3D12Resource`, so it cannot be the page fault; `shadow::loose` never frees its windows at all (`shortcut` at `shadow.rs:441`). I opened #575 for the two paths (`HostHeap::keep` and `shadow::unregister`) with the `execute`-time drain, `cargo test -p victory-gpu` 43 passed / 0 failed. It is deliberately narrow: it removes frees nothing can justify, and does not claim to fix the fault on its own — a fence-tagged graveyard with a frame margin is a bigger change than the evidence I have supports, since submissions here are already fully serialised.
Author
Owner

@⁠Tioloff on GitHub · 2026-11-24 05:22 UTC · original

New data point, this time on RDNA2: RX 6600 (8 GB), 16 GB system RAM, 16 GB pagefile, Windows 11, --execute --console series-x, 5x Enter to skip the intros. Build = d2a4bae + #472 + #336 + #458 merged cleanly locally.

It gets further than the earlier hardware runs here: intro/menus -> opens core_restofworld and story000_restofworld packages -> 12 frames presented -> DXGI_ERROR_DEVICE_REMOVED during list 10 of a 33-list submission.

The measurable change versus the same box on #472 alone:

#472 only + #336 + #458
frames presented 13 12
0x8007000E / E_OUTOFMEMORY 3931 0
no shared buffer 3853 243
peak private 22.26 GB 21.39 GB
min free commit 0.20 GB 0.39 GB

So #336+#458 do clear the allocation-error storm, but the world-entry device removal remains. Here the failure is 0x887A0005, DRED reports 0x887A0004 (breadcrumbs unavailable), and the device-removed reason is 0x887A0007. The stopped command is still in a 33-list submission at list 10, which fits your ExecuteIndirect kind-10 observation, but this driver gives no freed-texture breadcrumb to confirm it.

No game data, local paths or file hashes included. I can run a diagnostics build with VICTORY_D3D12_DEBUG=1 next if naming the exact command would help.

**@⁠Tioloff** on GitHub · 2026-11-24 05:22 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122880358) New data point, this time on RDNA2: RX 6600 (8 GB), 16 GB system RAM, 16 GB pagefile, Windows 11, `--execute --console series-x`, 5x Enter to skip the intros. Build = `d2a4bae` + #472 + #336 + #458 merged cleanly locally. It gets further than the earlier hardware runs here: intro/menus -> opens `core_restofworld` and `story000_restofworld` packages -> 12 frames presented -> `DXGI_ERROR_DEVICE_REMOVED` during list 10 of a 33-list submission. The measurable change versus the same box on #472 alone: | | #472 only | + #336 + #458 | |---|---|---| | frames presented | 13 | 12 | | `0x8007000E` / E_OUTOFMEMORY | 3931 | **0** | | `no shared buffer` | 3853 | 243 | | peak private | 22.26 GB | 21.39 GB | | min free commit | 0.20 GB | 0.39 GB | So #336+#458 do clear the allocation-error storm, but the world-entry device removal remains. Here the failure is `0x887A0005`, DRED reports `0x887A0004` (breadcrumbs unavailable), and the device-removed reason is `0x887A0007`. The stopped command is still in a 33-list submission at list 10, which fits your ExecuteIndirect kind-10 observation, but this driver gives no freed-texture breadcrumb to confirm it. No game data, local paths or file hashes included. I can run a diagnostics build with `VICTORY_D3D12_DEBUG=1` next if naming the exact command would help.
Author
Owner

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

More data from the RX 9070 XT rig — four builds tonight, survival measured from world entry, all on d2a4bae + #336 (DRED on, identical key-press script):

build free policy in-world signature
base (#336 only) normal 47 s page fault inside freed ["texture 1024x1024 f98 (type 34)"]
behind-queue drain (≈ #575's design) release after Signal+WaitForSingleObject in Host::execute 97.7 s, then 5.1 s same, once a fault in no allocation with a garbage view-heap slot index (a read of a title address with no host copy)
fence-tagged graveyard release only when GetCompletedValue() ≥ drop-time fence value 120.5 s same
never free (park at all three paths, drain = no-op) release never 451 s, fault-free — first run ever to reach the end of the world-intro credits — killed by me when VRAM filled at 15.5/16 GB none

@⁠Len1k your point 1 is the interesting one: if every submission really is waited for before anything else frees, the behind-queue drain should be indistinguishable from never freeing — but on this rig it is 5–98 s, not 450+. So something reads an address whose host mapping is already gone, after the fence says the GPU finished everything that could name it. Which points at the free itself rather than its timing: ID3D12Resource::Release hands the VA range back to the allocator, and the next CreatePlacedResource/CommitResourceAllocation can hand that VA to new contents — a stale indirect read then gets wrong data instead of a fault only until the page is decommitted. The never-free row says the fault family vanishes exactly when VAs stop being recycled, not merely later. Not arguing against #575 — its two paths are real (independent DRED naming agrees) and it should merge on its own merits; I am arguing the fault on this rig will outlive it, and that the remaining gap may want VA-lifetime (reserve-and-reuse with a frame margin) rather than object-lifetime. Happy to run #575's branch head-to-head on this box to check that prediction directly.

@⁠Tioloff excellent cross-vendor datapoint — the OOM storm gone while world entry still dies matches our table exactly. The fault we name on RDNA4 (inside freed ["texture 1024x1024 f98"], stopped command ExecuteIndirect kind 10 in an unstarted list) would be the expected next failure if your 0x887A0005 is the same bug with less chatty DRED; VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1 on the diagnostics profile should name it. And if anyone can point both of us at why the world itself still renders no 3D geometry behind the title cards (bulk of mesh-shader translate failures), that is the next mountain after this one.

AI-assisted (Hermes Agent).

**@⁠KingKaom** on GitHub · 2026-11-24 05:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122915875) More data from the RX 9070 XT rig — four builds tonight, survival measured from world entry, all on `d2a4bae` + #336 (DRED on, identical key-press script): | build | free policy | in-world | signature | |---|---|---|---| | base (#336 only) | normal | 47 s | page fault `inside freed ["texture 1024x1024 f98 (type 34)"]` | | behind-queue drain (≈ #575's design) | release after `Signal`+`WaitForSingleObject` in `Host::execute` | 97.7 s, then 5.1 s | same, once a fault in no allocation with a garbage view-heap slot index (a read of a title address with no host copy) | | fence-tagged graveyard | release only when `GetCompletedValue()` ≥ drop-time fence value | 120.5 s | same | | **never free** (park at all three paths, drain = no-op) | release never | **451 s, fault-free — first run ever to reach the end of the world-intro credits — killed by me when VRAM filled at 15.5/16 GB** | none | @⁠Len1k your point 1 is the interesting one: if every submission really is waited for before anything else frees, the behind-queue drain should be indistinguishable from never freeing — but on this rig it is 5–98 s, not 450+. So *something* reads an address whose host mapping is already gone, after the fence says the GPU finished everything that could name it. Which points at the free itself rather than its timing: `ID3D12Resource::Release` hands the VA range back to the allocator, and the next `CreatePlacedResource`/`CommitResourceAllocation` can hand that VA to *new* contents — a stale indirect read then gets wrong data instead of a fault only until the page is decommitted. The never-free row says the fault family vanishes exactly when VAs stop being recycled, not merely later. Not arguing against #575 — its two paths are real (independent DRED naming agrees) and it should merge on its own merits; I am arguing the fault on this rig will outlive it, and that the remaining gap may want VA-lifetime (reserve-and-reuse with a frame margin) rather than object-lifetime. Happy to run #575's branch head-to-head on this box to check that prediction directly. @⁠Tioloff excellent cross-vendor datapoint — the OOM storm gone while world entry still dies matches our table exactly. The fault we name on RDNA4 (`inside freed ["texture 1024x1024 f98"]`, stopped command `ExecuteIndirect` kind 10 in an unstarted list) would be the expected next failure if your `0x887A0005` is the same bug with less chatty DRED; `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1` on the diagnostics profile should name it. And if anyone can point both of us at why the world itself still renders no 3D geometry behind the title cards (bulk of mesh-shader translate failures), that is the next mountain after this one. AI-assisted (Hermes Agent).
Author
Owner

@⁠Tioloff on GitHub · 2026-11-24 05:27 UTC · original

Follow-up with a diagnostics build (VICTORY_D3D12_DEBUG=1) on the same three-PR combination. This run did not end in a host GPU device removal. The debug layer reported 23 errors:

ID3D12Device::CreateCommittedResource: Returning E_OUTOFMEMORY, meaning memory was exhausted.
  id=642 severity=1

The sequence at the end was: no shared buffer with 0x8007000E for a 4 MB allocation -> a first-chance access violation (0xc0000005, write to address 0) inside the title image -> unhandled exception -> Breakpad upload. 13 frames presented, restofworld packages opened, no host GPU failure line in this run.

So on RDNA2 the world-entry death chain looks like commit exhaustion -> 4 MB allocation fails with E_OUTOFMEMORY -> title dereferences the null result. That is a different mechanism from the freed-texture page fault in the original report, even though both land at world entry. The release build's 0x887A0007 device removal is plausibly the same memory pressure without the debug layer's explicit message, but this run does not prove that link.

No game data, local paths, file hashes or code offsets included.

**@⁠Tioloff** on GitHub · 2026-11-24 05:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7122965023) Follow-up with a diagnostics build (`VICTORY_D3D12_DEBUG=1`) on the same three-PR combination. This run did **not** end in a host GPU device removal. The debug layer reported 23 errors: ``` ID3D12Device::CreateCommittedResource: Returning E_OUTOFMEMORY, meaning memory was exhausted. id=642 severity=1 ``` The sequence at the end was: `no shared buffer` with `0x8007000E` for a 4 MB allocation -> a first-chance access violation (`0xc0000005`, write to address 0) inside the title image -> unhandled exception -> Breakpad upload. 13 frames presented, `restofworld` packages opened, no `host GPU failure` line in this run. So on RDNA2 the world-entry death chain looks like commit exhaustion -> 4 MB allocation fails with E_OUTOFMEMORY -> title dereferences the null result. That is a different mechanism from the freed-texture page fault in the original report, even though both land at world entry. The release build's `0x887A0007` device removal is plausibly the same memory pressure without the debug layer's explicit message, but this run does not prove that link. No game data, local paths, file hashes or code offsets included.
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 05:31 UTC · original

@⁠Tioloff sharp finding, and our rig lets you split the two mechanisms cleanly: on the 32 GB RAM (9070 XT) box from the table above, world entry dies of the page fault WITHOUT any allocation ever failing — zero E_OUTOFMEMORY/no shared buffer lines across seven DRED runs, commit limit ~45 GB (31 + 14 GB pagefile) with ~31 GB working set at death. So the commit-exhaustion chain is likely class-specific (your 16 GB commit budget), while the freed-resource fault reproduces with commit to spare. One corollary here that suits your side: our runs show working set climbing toward the RAM ceiling and paging hard before death (SSD pinned) — memory pressure is real on both machines, yours dies of it, ours of the page fault. A world that allocates ~30 GB at world entry is the shared root worth chasing first.

**@⁠KingKaom** on GitHub · 2026-11-24 05:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7123034641) @⁠Tioloff sharp finding, and our rig lets you split the two mechanisms cleanly: on the 32 GB RAM (9070 XT) box from the table above, world entry dies of the page fault WITHOUT any allocation ever failing — zero `E_OUTOFMEMORY`/`no shared buffer` lines across seven DRED runs, commit limit ~45 GB (31 + 14 GB pagefile) with ~31 GB working set at death. So the commit-exhaustion chain is likely class-specific (your 16 GB commit budget), while the freed-resource fault reproduces with commit to spare. One corollary here that suits your side: our runs show working set climbing toward the RAM ceiling and paging hard before death (SSD pinned) — memory pressure is real on both machines, yours dies of it, ours of the page fault. A world that allocates ~30 GB at world entry is the shared root worth chasing first.
Author
Owner

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

One more rung on the ladder from this rig (same base as the table above): fence-tagged graveyard plus an 8-submission release margin died at 22.2 s, same family (a 2048x1024 f98 texture this time). With never-free the only build that has avoided the signature, the ordering across five free policies (drop / fence / fence-complete / fence+8 / never = 47 s / 5-98 s / 120 s / 22 s / 451 s+) says delay does not fix this at any margin — consistent with the breadcrumbs, which repeatedly show the faulting list never having started when the device dies: a title list may sit recorded-but-unexecuted arbitrarily long, so the window an old descriptor value must survive is unbounded and timer-shaped fixes will keep missing it. The safe invariant looks like list lifetime itself: hold what a recorded-then-not-yet-executed list can name until that list has executed — closer to tracking list lifetimes than to delaying frees. End of tonight's experiments from this box; state of the art unchanged, thanks all.

**@⁠KingKaom** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7123070100) One more rung on the ladder from this rig (same base as the table above): fence-tagged graveyard **plus an 8-submission release margin** died at **22.2 s**, same family (a `2048x1024 f98` texture this time). With never-free the only build that has avoided the signature, the ordering across five free policies (drop / fence / fence-complete / fence+8 / never = 47 s / 5-98 s / 120 s / 22 s / 451 s+) says delay does not fix this at any margin — consistent with the breadcrumbs, which repeatedly show the faulting list **never having started** when the device dies: a title list may sit recorded-but-unexecuted arbitrarily long, so the window an old descriptor value must survive is unbounded and timer-shaped fixes will keep missing it. The safe invariant looks like list lifetime itself: hold what a recorded-then-not-yet-executed list can name until that list has executed — closer to tracking list lifetimes than to delaying frees. End of tonight\'s experiments from this box; state of the art unchanged, thanks all.
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 05:34 UTC · original

Resolved via PR #609:

  • Sealed all 4 resource release paths (\HostTexture::drop, \Staging::drop, \Shadow::drop, and \HostHeap::keep\ slot replacement) to route displaced \ID3D12Resource\ instances into a thread-safe deferred \RETIREMENT_QUEUE.
  • Released resources are now retained across a multi-list submission window (\RETAIN_SUBMISSIONS = 3) and drained only after the hardware GPU fence confirms completion past their retirement window.
  • Verified with unit test \host::tests::deferred_retirement_retains_resources_across_submissions\ (44 tests pass in \ ictory-gpu, 0 warnings, policy clean).
**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7123077039) Resolved via PR #609: - Sealed all 4 resource release paths (\HostTexture::drop\, \Staging::drop\, \Shadow::drop\, and \HostHeap::keep\ slot replacement) to route displaced \ID3D12Resource\ instances into a thread-safe deferred \RETIREMENT_QUEUE\. - Released resources are now retained across a multi-list submission window (\RETAIN_SUBMISSIONS = 3\) and drained only after the hardware GPU fence confirms completion past their retirement window. - Verified with unit test \host::tests::deferred_retirement_retains_resources_across_submissions\ (44 tests pass in \ ictory-gpu\, 0 warnings, policy clean).
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 05:41 UTC · original

Tested PR #609 on this rig (RX 9070 XT, Win11 26300, driver 32.0.32029.2010) as a merge of 1b6d967 onto the #336 head from the table above — on plain main world entry dies at ~15 s to the dynamic-descriptor exhaustion #336 fixes, so #336 is load-bearing to reach this code path at all.

Result: the freed-resource fault is delayed, not gone. World entry survived ~95 s (vs ~47 s on the #336 base), then the identical family: host GPU device removed after a submission of 27 lists; page fault at 0x39a914000; inside freed ["texture 1024x1024 f99"], exit 0x887A0005, zero E_OUTOFMEMORY lines all run.

So the retirement queue lands inside the delay-band this rig has now measured for every fence-shaped policy (fence 5–98 s, fence-complete 120 s, fence+8 22 s, RETAIN_SUBMISSIONS=3 ~95 s) — all fault, while never-free (451 s+, end credits) remains the only policy that has avoided the signature. Consistent with the ordering argument above: a recorded-but-not-yet-executed title list can sit arbitrarily long, so no fixed retention window bounds the fault window; only list-lifetime tracking does. Single run, so the ~95 s number carries the variance caveat from the table; the fault itself is reproducible-family.

"Resolved" therefore doesn't hold on RDNA4 + #336 yet — happy to retest any revision quickly.

AI-assisted (Hermes Agent)

**@⁠KingKaom** on GitHub · 2026-11-24 05:41 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7123186217) Tested PR #609 on this rig (RX 9070 XT, Win11 26300, driver 32.0.32029.2010) as a merge of `1b6d967` onto the #336 head from the table above — on plain main world entry dies at ~15 s to the dynamic-descriptor exhaustion #336 fixes, so #336 is load-bearing to reach this code path at all. Result: the freed-resource fault is **delayed, not gone**. World entry survived ~95 s (vs ~47 s on the #336 base), then the identical family: `host GPU device removed after a submission of 27 lists; page fault at 0x39a914000; inside freed ["texture 1024x1024 f99"]`, exit `0x887A0005`, zero `E_OUTOFMEMORY` lines all run. So the retirement queue lands inside the delay-band this rig has now measured for every fence-shaped policy (fence 5–98 s, fence-complete 120 s, fence+8 22 s, `RETAIN_SUBMISSIONS=3` ~95 s) — all fault, while never-free (451 s+, end credits) remains the only policy that has avoided the signature. Consistent with the ordering argument above: a recorded-but-not-yet-executed title list can sit arbitrarily long, so no fixed retention window bounds the fault window; only list-lifetime tracking does. Single run, so the ~95 s number carries the variance caveat from the table; the fault itself is reproducible-family. "Resolved" therefore doesn't hold on RDNA4 + #336 yet — happy to retest any revision quickly. AI-assisted (Hermes Agent)
Author
Owner

@⁠colehammond65 on GitHub · 2026-11-24 06:58 UTC · original

RTX 4080: freed-resource signature not reproduced. Four DRED-enabled runs all ended in 0x887A0005/0x887A0006, but none reported a page fault or freed allocation. The stopped command was EXECUTE_INDIRECT (op 5) or DISPATCH_MESH (op 42). This is a negative data point for the freed-texture signature on this hardware, not a claim that #557 is fixed. Full report: #334

AI-assisted test report.

**@⁠colehammond65** on GitHub · 2026-11-24 06:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7124489109) **RTX 4080: freed-resource signature not reproduced.** Four DRED-enabled runs all ended in `0x887A0005`/`0x887A0006`, but none reported a page fault or freed allocation. The stopped command was `EXECUTE_INDIRECT` (op 5) or `DISPATCH_MESH` (op 42). This is a negative data point for the freed-texture signature on this hardware, not a claim that #557 is fixed. Full report: https://git.gtahub.st/github/Marvisak--VIctory/pulls/334 AI-assisted test report.
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 08:07 UTC · original

Merged-main confirmation (head 7374bfb, which includes #336; diagnostics build + DRED, RDNA4 board): zero no free dynamic descriptor slots warnings as expected, world entry survives the descriptor storm, and the run still dies ~29 s into the world with the same signature — device removed after a submission of 31 lists, page fault inside freed [texture 2048x2048 f98], DXGI_ERROR_DEVICE_HUNG.

So the freed-resource fault of this issue is live on merged main, not just on the #336 branch; the delay-vs-never-free findings above apply unchanged. (Single run: in-world seconds vary, the fault signature does not.)

**@⁠KingKaom** on GitHub · 2026-11-24 08:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7125750283) Merged-main confirmation (head `7374bfb`, which includes #336; diagnostics build + DRED, RDNA4 board): zero `no free dynamic descriptor slots` warnings as expected, world entry survives the descriptor storm, and the run still dies ~29 s into the world with the same signature — device removed after a submission of 31 lists, page fault inside `freed [texture 2048x2048 f98]`, `DXGI_ERROR_DEVICE_HUNG`. So the freed-resource fault of this issue is live on merged main, not just on the #336 branch; the delay-vs-never-free findings above apply unchanged. (Single run: in-world seconds vary, the fault signature does not.)
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 08:25 UTC · original

Another RX 9070 XT data point, on current main and with #609 on top. #609 doesn't stop the fault here, and in both runs the list stopped at a direct mesh draw (op 42), not an ExecuteIndirect.

Setup: RX 9070 XT, driver 32.0.32029.2010; Ryzen 7 7800X3D; 64 GB RAM; Windows 11 Pro 26300. Title 1.0.2.1, Series X mode. Diag build (--profile diag --features diagnostics), VICTORY_D3D12_DRED=1. Input was VICTORY_KEYS Enter every 3 s from 45 s to 150 s, so both runs took the same path: account screen, start artwork, then the first mission. Same cache dir for both runs.

run build world start → device removed no free dynamic warnings
A main dd54de2 193 s 0
B dd54de2 + #609 (merged clean) 217 s 0

For comparison, release d2a4bae (before #336 was merged) on this card died 35 s into the world, 1 s after no free dynamic descriptor slots: a table is not made n=101. So #336 helps here as it did for others.

Run A (main):

host GPU device removed after a submission of 29 lists; page fault at 0x489403000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"]
a list stopped at command 5 of 54 (op 42) ...
command 3 (op 42): mesh 19 [mesh 4adfa13bea1c556a]

Run B (main + #609):

host GPU device removed after a submission of 33 lists; page fault at 0x477241000; inside freed ["texture 1024x1024 f99 flags 0x0 (type 34)", "texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f83 flags 0x0 (type 34)"]
a list stopped at command 117 of 276 (op 42), commands 114..118 between its barriers
command 115 (op 42): mesh 1 [mesh 5a801f1f568c7abd, pixel 4fb658bc796985d3]

What this adds, as far as I can tell:

  • With #609, the fault is still inside freed 1024x1024 textures. That points to a free path #609 doesn't route through release_late, or to a descriptor still pointing at the texture after the late release has drained. I haven't checked which.
  • Not only indirect draws. The first post here says the stopped command was always ExecuteIndirect kind 10. In both of these runs it was a direct mesh draw (op 42). The reader is any draw that indexes a shader-visible slot, not only one whose arguments the GPU wrote.
  • These are one run each, so 193 s against 217 s says nothing about whether #609 helps.

Both full crashes.log entries are available on request. They're VIctory's own output, with no game data.

AI-assisted (Claude Code): runs scripted and logs read with the model.

**@⁠h0useadv** on GitHub · 2026-11-24 08:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7126124838) Another RX 9070 XT data point, on current `main` and with #609 on top. #609 doesn't stop the fault here, and in both runs the list stopped at a **direct** mesh draw (op 42), not an `ExecuteIndirect`. **Setup:** RX 9070 XT, driver 32.0.32029.2010; Ryzen 7 7800X3D; 64 GB RAM; Windows 11 Pro 26300. Title 1.0.2.1, Series X mode. Diag build (`--profile diag --features diagnostics`), `VICTORY_D3D12_DRED=1`. Input was `VICTORY_KEYS` Enter every 3 s from 45 s to 150 s, so both runs took the same path: account screen, start artwork, then the first mission. Same cache dir for both runs. | run | build | world start → device removed | `no free dynamic` warnings | |---|---|---|---| | A | `main` `dd54de2` | 193 s | 0 | | B | `dd54de2` + #609 (merged clean) | 217 s | 0 | For comparison, release `d2a4bae` (before #336 was merged) on this card died 35 s into the world, 1 s after `no free dynamic descriptor slots: a table is not made n=101`. So #336 helps here as it did for others. **Run A (`main`):** ``` host GPU device removed after a submission of 29 lists; page fault at 0x489403000; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"] a list stopped at command 5 of 54 (op 42) ... command 3 (op 42): mesh 19 [mesh 4adfa13bea1c556a] ``` **Run B (`main` + #609):** ``` host GPU device removed after a submission of 33 lists; page fault at 0x477241000; inside freed ["texture 1024x1024 f99 flags 0x0 (type 34)", "texture 1024x1024 f98 flags 0x0 (type 34)", "texture 1024x1024 f83 flags 0x0 (type 34)"] a list stopped at command 117 of 276 (op 42), commands 114..118 between its barriers command 115 (op 42): mesh 1 [mesh 5a801f1f568c7abd, pixel 4fb658bc796985d3] ``` What this adds, as far as I can tell: - **With #609, the fault is still inside freed 1024x1024 textures.** That points to a free path #609 doesn't route through `release_late`, or to a descriptor still pointing at the texture after the late release has drained. I haven't checked which. - **Not only indirect draws.** The first post here says the stopped command was always `ExecuteIndirect` kind 10. In both of these runs it was a direct mesh draw (op 42). The reader is any draw that indexes a shader-visible slot, not only one whose arguments the GPU wrote. - These are one run each, so 193 s against 217 s says nothing about whether #609 helps. Both full `crashes.log` entries are available on request. They're VIctory's own output, with no game data. AI-assisted (Claude Code): runs scripted and logs read with the model.
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 08:47 UTC · original

A follow-up experiment on the same RX 9070 XT, same scripted input. Never freeing host textures removes the page fault, and a 3-submission delay (#609) isn't enough. So something reads a host texture well after the title released it, and as far as I can see it isn't a wild address.

What I changed (diagnostics only, local, not a fix): in Drop for Resource (resource.rs), std::mem::forget(h.texture.clone()) when VICTORY_LEAK_TEXTURES is set. Every host texture then stays alive for the whole process.

run build world → device removed page fault
A main dd54de2 193 s inside freed texture 1024x1024 f98
B dd54de2 + #609 217 s inside freed 1024x1024 f99 / f98 / f83
C dd54de2 + #609, GBV requested but no SDK layers on this machine (so a plain run) 190 s inside freed 1024x1024 f95 / f98
D dd54de2 + leak 549 s none

Run D still ends in a device removal, but a different kind: no page fault, and 19 of 21 lists finished. The stopped list was at command 448 of 491 (op 42): mesh 4 [mesh 04b9be3756e8f41c, pixel 1af4a50c7fb40c97], and a compute dispatch 04be1ad677ff1627 was in flight. That looks like the plain hang family other people see (#71, and the "no page fault" runs above), not this bug.

What this does and doesn't show (D is one run):

  • The reads go to where released textures were, many submissions after the release. #609 keeps released resources for 3 submissions and still faults, so the reader isn't just a list that was in flight at release time.
  • It doesn't separate "stale texture descriptor" from "computed address". When nothing is freed, GPU VAs are never reused either, so a wild address that lands in the texture region would also hit live memory and not fault. What argues for a descriptor: every fault in A to C lands inside 1024x1024 BC texture allocations (f83/f95/f98/f99), with no hits elsewhere.
  • I couldn't find the path in the code. Every host slot made from a texture (mirror, make_at) clones it into HostHeap::kept, and the slot holds it until it's remade. Lists hold their textures through States. So a stale descriptor would have to live somewhere kept doesn't track. A check that would settle it: on Resource drop, record the host texture's raw pointer, scan all HostHeap::kept vectors, and log whether any slot other than kept still points at it. Or run with GBV on a machine with the Graphics Tools optional feature (this one doesn't have it).

Full crashes.log entries for A to D are available on request. They're VIctory's own output, with no game data.

AI-assisted (Claude Code).

**@⁠h0useadv** on GitHub · 2026-11-24 08:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7126563516) A follow-up experiment on the same RX 9070 XT, same scripted input. **Never freeing host textures removes the page fault**, and a 3-submission delay (#609) isn't enough. So something reads a host texture well after the title released it, and as far as I can see it isn't a wild address. **What I changed** (diagnostics only, local, not a fix): in `Drop for Resource` (`resource.rs`), `std::mem::forget(h.texture.clone())` when `VICTORY_LEAK_TEXTURES` is set. Every host texture then stays alive for the whole process. | run | build | world → device removed | page fault | |---|---|---|---| | A | `main` `dd54de2` | 193 s | inside freed `texture 1024x1024 f98` | | B | `dd54de2` + #609 | 217 s | inside freed `1024x1024` f99 / f98 / f83 | | C | `dd54de2` + #609, GBV requested but no SDK layers on this machine (so a plain run) | 190 s | inside freed `1024x1024` f95 / f98 | | D | `dd54de2` + leak | **549 s** | **none** | Run D still ends in a device removal, but a different kind: no page fault, and 19 of 21 lists finished. The stopped list was at `command 448 of 491 (op 42): mesh 4 [mesh 04b9be3756e8f41c, pixel 1af4a50c7fb40c97]`, and a compute dispatch `04be1ad677ff1627` was in flight. That looks like the plain hang family other people see (#71, and the "no page fault" runs above), not this bug. What this does and doesn't show (D is one run): - **The reads go to where released textures were, many submissions after the release.** #609 keeps released resources for 3 submissions and still faults, so the reader isn't just a list that was in flight at release time. - **It doesn't separate "stale texture descriptor" from "computed address".** When nothing is freed, GPU VAs are never reused either, so a wild address that lands in the texture region would also hit live memory and not fault. What argues for a descriptor: every fault in A to C lands inside 1024x1024 BC texture allocations (f83/f95/f98/f99), with no hits elsewhere. - **I couldn't find the path in the code.** Every host slot made from a texture (`mirror`, `make_at`) clones it into `HostHeap::kept`, and the slot holds it until it's remade. Lists hold their textures through `States`. So a stale descriptor would have to live somewhere `kept` doesn't track. A check that would settle it: on `Resource` drop, record the host texture's raw pointer, scan all `HostHeap::kept` vectors, and log whether any slot other than `kept` still points at it. Or run with GBV on a machine with the Graphics Tools optional feature (this one doesn't have it). Full `crashes.log` entries for A to D are available on request. They're VIctory's own output, with no game data. AI-assisted (Claude Code).
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 09:07 UTC · original

Ran the GBV suggestion (this box has the SDK layers) — on an RX 9070 XT / 32 GB it mostly dies before the test can happen:

  • main 8e79c80, diagnostics build, VICTORY_D3D12_DEBUG + DRED + VICTORY_D3D12_GBV. GBV switched on (GPU-based validation on, startup-options note id=1016), then ~100 s in, at frame ~1206 — still menu-era, before world entry — the process died of a host-side 0xC0000005 write to 0x0 inside the compiled image module (process exit 0xC0000005, not a device removal). The crash context shows ~0.5 GB free of a ~52 GB pagefile at that moment: GBV's patched-PSO memory storm alone seems to eat the commit on a 32 GB machine before the world loads.
  • GBV's only complaints before dying: 6x Draw, SRV resource dimensions differs from that expected by shader: expected TEXTURE2D, in descriptor TEXTURE1D (Draw Index 0, menu pipelines). Zero out-of-range descriptor messages.
  • Control, same head, same knobs, GBV off: the old death reproduces unchanged — page fault at 0x475f0d000; inside freed ["texture 1024x1024 f98 ..."], submission of 11 lists, DXGI_ERROR_DEVICE_HUNG, ~30 s after world entry. So 8e79c80 is unchanged for this bug and the null write is GBV-specific, not a new regression.

Net: as far as we can tell GBV adds nothing about the faulting read on this class of box — it never reaches the phase that faults. The kept-scan on Resource drop from your second paragraph looks like the discriminating experiment; that's the one we'd want to read next.

AI-assisted (Hermes Agent).

**@⁠KingKaom** on GitHub · 2026-11-24 09:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7126989778) **Ran the GBV suggestion** (this box has the SDK layers) — on an RX 9070 XT / 32 GB it mostly dies before the test can happen: - `main` `8e79c80`, diagnostics build, `VICTORY_D3D12_DEBUG` + `DRED` + `VICTORY_D3D12_GBV`. GBV switched on (`GPU-based validation on`, startup-options note id=1016), then ~100 s in, at frame ~1206 — still menu-era, **before world entry** — the process died of a **host-side `0xC0000005` write to `0x0`** inside the compiled image module (process exit `0xC0000005`, not a device removal). The crash context shows ~0.5 GB free of a ~52 GB pagefile at that moment: GBV's patched-PSO memory storm alone seems to eat the commit on a 32 GB machine before the world loads. - GBV's only complaints before dying: 6x `Draw, SRV resource dimensions differs from that expected by shader: expected TEXTURE2D, in descriptor TEXTURE1D` (Draw Index 0, menu pipelines). **Zero out-of-range descriptor messages.** - Control, same head, same knobs, GBV off: the old death reproduces unchanged — `page fault at 0x475f0d000; inside freed ["texture 1024x1024 f98 ..."]`, submission of 11 lists, `DXGI_ERROR_DEVICE_HUNG`, ~30 s after world entry. So `8e79c80` is unchanged for this bug and the null write is GBV-specific, not a new regression. Net: as far as we can tell GBV adds nothing about the faulting read on this class of box — it never reaches the phase that faults. The `kept`-scan on `Resource` drop from your second paragraph looks like the discriminating experiment; that's the one we'd want to read next. AI-assisted (Hermes Agent).
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 09:36 UTC · original

Ran the kept-scan experiment (on Resource drop: record the host texture's raw pointer, scan every host heap's kept vector) — RX 9070 XT / 32 GB, main 8e79c80, diagnostics build, VICTORY_D3D12_DEBUG + DRED + scan knob.

Numbers from a faulting run (world entered at 0.5 fps frames, then the usual death):

  • 2277 host texture releases; 76 (3.3%) had a kept slot naming the texture at release. Named ones are mostly small textures; of 447 2048x2048 releases, exactly 1 was named.
  • This run's victim was not one of them. texture 2048x2048 f83 released at 09:33:06.77, arc=1 (no list named its host copy) and no kept slot named it; the fault at 09:33:09.94 — 3.2 s later, submission of 29 lists, DXGI_ERROR_DEVICE_HUNG — landed inside its VA range.
  • Only 5 releases in the whole run had arc>1: the "a list not yet reset still names it" class is rare and was not the victim here either.

So as far as we can tell kept does not hold the answer to your question: at release the victim was named by zero slots, and none can be made for it afterwards (its views are gone) — from that instant no live host descriptor named the texture, yet a read still landed in its range seconds later. The reader must hold an address nothing on the CPU retains, which fits your run D (no fault while VAs are never recycled) and puts #609's 3-submission retirement well inside our observed delay band (3.2 s here).

One caveat: the scan walks ~300k slots per release, so this run's survival (~158 s in-world) is timing-perturbed, not a lifetime data point.

AI-assisted (Hermes Agent).

**@⁠KingKaom** on GitHub · 2026-11-24 09:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7127645752) **Ran the kept-scan experiment** (on `Resource` drop: record the host texture's raw pointer, scan every host heap's `kept` vector) — RX 9070 XT / 32 GB, `main` `8e79c80`, diagnostics build, `VICTORY_D3D12_DEBUG` + `DRED` + scan knob. Numbers from a faulting run (world entered at 0.5 fps frames, then the usual death): - **2277 host texture releases; 76 (3.3%) had a kept slot naming the texture at release.** Named ones are mostly small textures; of 447 2048x2048 releases, exactly 1 was named. - **This run's victim was not one of them.** `texture 2048x2048 f83` released at `09:33:06.77`, `arc=1` (no list named its host copy) and **no kept slot named it**; the fault at `09:33:09.94` — 3.2 s later, submission of 29 lists, `DXGI_ERROR_DEVICE_HUNG` — landed inside its VA range. - Only 5 releases in the whole run had `arc>1`: the "a list not yet reset still names it" class is rare and was not the victim here either. So as far as we can tell `kept` does not hold the answer to your question: at release the victim was named by zero slots, and none can be made for it afterwards (its views are gone) — from that instant no live host descriptor named the texture, yet a read still landed in its range seconds later. The reader must hold an address nothing on the CPU retains, which fits your run D (no fault while VAs are never recycled) and puts #609's 3-submission retirement well inside our observed delay band (3.2 s here). One caveat: the scan walks ~300k slots per release, so this run's survival (~158 s in-world) is timing-perturbed, not a lifetime data point. AI-assisted (Hermes Agent).
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 10:03 UTC · original

Two more data points from the same RX 9070 XT, with a small diagnostics patch that tracks host texture destruction.

The patch (local, diagnostics only): every host texture gets a serial in its DRED name (texture WxH fN flags 0x0 #serial). Textures of 1024x1024 also get an IUnknown attached with SetPrivateDataInterface. D3D12 releases it when the resource is actually destroyed, and its Drop logs the serial plus the Rust stack that dropped the last reference. That catches every free path, whoever holds the last reference.

1. Who holds a streaming texture when it dies: nobody else. One run logged 882 destructions of 1024x1024 textures before the device was removed. 881 of 882 were destroyed inside the title's own release:

Arc::drop_slow<HostTexture> > drop_glue<Box<Resource>> > object::release_boxed<Resource> > resource::resource_release

The other one went through HostList::reset. So when the title releases these textures, no HostHeap::kept slot and no list's States holds a reference. If the GPU reads one afterwards, it's through a descriptor that never held the texture, not one whose hold ended too early. That fits #609's extra 3-submission window making no difference.

2. It's not only 1024x1024. The next run (main dd54de2 + the patch) faulted on two other sizes:

host GPU device removed after a submission of 17 lists; page fault at 0x44cb1d000;
inside freed ["texture 2048x2048 f98 flags 0x0 #4055 (type 34)", "texture 2048x1024 f71 flags 0x0 #2743 (type 34)"]
a list stopped at command 979 of 1556 (op 42)

My destruction log only covered 1024x1024, so I don't have the free path for #4055/#2743. A run with every texture of 1024 or more tracked is going now, on WARP (below).

Side note for other testers. After several device removals in a row on this machine, every start, including a release build with a fresh data folder, was killed about 6 s into boot at the bring-up self-kill +0x2215c35 that #630 describes. That lasted until a reboot. If boots suddenly die there after a few world crashes, restart before chasing it. Two of the resets here also froze the whole PC, so I've stopped testing on the real GPU. Further runs are VICTORY_D3D12_WARP=1.

AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.

**@⁠h0useadv** on GitHub · 2026-11-24 10:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7128266219) Two more data points from the same RX 9070 XT, with a small diagnostics patch that tracks host texture destruction. **The patch** (local, diagnostics only): every host texture gets a serial in its DRED name (`texture WxH fN flags 0x0 #serial`). Textures of 1024x1024 also get an `IUnknown` attached with `SetPrivateDataInterface`. D3D12 releases it when the resource is actually destroyed, and its `Drop` logs the serial plus the Rust stack that dropped the last reference. That catches every free path, whoever holds the last reference. **1. Who holds a streaming texture when it dies: nobody else.** One run logged 882 destructions of 1024x1024 textures before the device was removed. **881 of 882** were destroyed inside the title's own release: ``` Arc::drop_slow<HostTexture> > drop_glue<Box<Resource>> > object::release_boxed<Resource> > resource::resource_release ``` The other one went through `HostList::reset`. So when the title releases these textures, no `HostHeap::kept` slot and no list's `States` holds a reference. If the GPU reads one afterwards, it's through a descriptor that never held the texture, not one whose hold ended too early. That fits #609's extra 3-submission window making no difference. **2. It's not only 1024x1024.** The next run (`main` `dd54de2` + the patch) faulted on two other sizes: ``` host GPU device removed after a submission of 17 lists; page fault at 0x44cb1d000; inside freed ["texture 2048x2048 f98 flags 0x0 #4055 (type 34)", "texture 2048x1024 f71 flags 0x0 #2743 (type 34)"] a list stopped at command 979 of 1556 (op 42) ``` My destruction log only covered 1024x1024, so I don't have the free path for #4055/#2743. A run with every texture of 1024 or more tracked is going now, on WARP (below). **Side note for other testers.** After several device removals in a row on this machine, every start, including a release build with a fresh data folder, was killed about 6 s into boot at the bring-up self-kill `+0x2215c35` that #630 describes. That lasted until a reboot. If boots suddenly die there after a few world crashes, restart before chasing it. Two of the resets here also froze the whole PC, so I've stopped testing on the real GPU. Further runs are `VICTORY_D3D12_WARP=1`. AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 10:19 UTC · original

The tracking patch from my previous comment, now covering every texture of 1024 or more, caught the faulting texture's destruction. Same RX 9070 XT, main dd54de2 + the patch, real GPU, DRED.

10:18:24.074  host texture destroyed serial=2369 texture=texture 2048x2048 f71 flags 0x0 #2369 made_at=Some(5997) now=None
              frames: Arc::drop_slow<HostTexture> > drop_glue<Box<Resource>> > object::release_boxed<Resource> > resource::resource_release
10:18:26.006  host GPU device removed after a submission of 32 lists; page fault at 0x407bd1000;
              inside freed ["texture 2048x2048 f71 flags 0x0 #2369 (type 34)"]
              a list stopped at command 1765 of 2244 (op 42)

What this shows:

  1. The faulting texture died inside the title's own Release, with no other holder. The last reference was Resource.host. No HostHeap::kept slot and no list's States held a clone at that moment, or D3D12 wouldn't have destroyed it. It's the same path as 881/882 in the earlier run.
  2. The GPU read it under 2 s later. At the ~1.1 s/frame the world runs at here, that's the same or the next submission.
  3. now=None: the tracker reads the submission counter with try_lock on Host::submitted, which Host::execute holds from preparation through copy-back. So the title released this texture while another thread was inside execute (preparing, running or copying back).

How I read it, unproven: the title is releasing a texture it believes no in-flight work reads, but a host descriptor that reaches it still exists. Because nothing holds the texture, that descriptor can't be one kept made. So the host-side reference to the texture lives somewhere without a hold. Candidates I haven't been able to rule out by reading:

  • a slot whose kept entry was replaced while its descriptor still describes this texture;
  • a copy of descriptors (CopyDescriptorsSimple, heap creation) carrying it into another heap;
  • a view made through placed_texture, whose texture_at resource isn't the title's Resource.

A check that would settle it: in Drop for Resource, before the Arc drops, scan every live HostHeap for slots whose last made view names this resource and log (heap, index, kept is some). The faulting serial's line would then say directly whether a slot still pointed at it unheld.

AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.

**@⁠h0useadv** on GitHub · 2026-11-24 10:19 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7128625082) The tracking patch from my previous comment, now covering every texture of 1024 or more, caught the faulting texture's destruction. Same RX 9070 XT, `main` `dd54de2` + the patch, real GPU, DRED. ``` 10:18:24.074 host texture destroyed serial=2369 texture=texture 2048x2048 f71 flags 0x0 #2369 made_at=Some(5997) now=None frames: Arc::drop_slow<HostTexture> > drop_glue<Box<Resource>> > object::release_boxed<Resource> > resource::resource_release 10:18:26.006 host GPU device removed after a submission of 32 lists; page fault at 0x407bd1000; inside freed ["texture 2048x2048 f71 flags 0x0 #2369 (type 34)"] a list stopped at command 1765 of 2244 (op 42) ``` What this shows: 1. **The faulting texture died inside the title's own `Release`, with no other holder.** The last reference was `Resource.host`. No `HostHeap::kept` slot and no list's `States` held a clone at that moment, or D3D12 wouldn't have destroyed it. It's the same path as 881/882 in the earlier run. 2. **The GPU read it under 2 s later.** At the ~1.1 s/frame the world runs at here, that's the same or the next submission. 3. **`now=None`**: the tracker reads the submission counter with `try_lock` on `Host::submitted`, which `Host::execute` holds from preparation through copy-back. So the title released this texture while another thread was inside `execute` (preparing, running or copying back). How I read it, unproven: the title is releasing a texture it believes no in-flight work reads, but a host descriptor that reaches it still exists. Because nothing holds the texture, that descriptor can't be one `kept` made. So the host-side reference to the texture lives somewhere without a hold. Candidates I haven't been able to rule out by reading: - a slot whose `kept` entry was replaced while its descriptor still describes this texture; - a copy of descriptors (`CopyDescriptorsSimple`, heap creation) carrying it into another heap; - a view made through `placed_texture`, whose `texture_at` resource isn't the title's `Resource`. A check that would settle it: in `Drop for Resource`, before the `Arc` drops, scan every live `HostHeap` for slots whose last made view names this resource and log `(heap, index, kept is some)`. The faulting serial's line would then say directly whether a slot still pointed at it unheld. AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 10:24 UTC · original

I ran the check I suggested above. It narrows things: the faulting texture had no view registered for its Resource at all.

What I added (diagnostics, local): in Drop for Resource, before forget, for every tracked texture (1024 or more), descriptor::slots_naming takes the live view entries in VIEWS.by_resource for this resource. It then scans every shader-visible HostHeap's made for slots whose key is one of those entries, and reports whether kept holds the same ID3D12Resource.

Run (RX 9070 XT, real GPU, main dd54de2 + patch, DRED):

10:23:00.0538  title released a tracked texture serial=1446 holders=1 views=0 slots=[]
10:23:00.0542  host texture destroyed serial=1446 texture=texture 1024x1024 f98 #1446 ... resource::resource_release
10:23:01.3502  host GPU device removed after a submission of 31 lists; page fault at 0x396b9a000;
               inside freed ["texture 1024x1024 f98 flags 0x0 #1446 (type 34)"]; a list stopped at command 1439 of 1712 (op 42)

Across the run's 618 tracked releases:

at release count
views=0, no slots 606
views=1, slots found, all held=true same=true 12

In the 12 cases where made slots name the texture, kept does hold it, and the texture outlives the release as it should. None of the releases found a slot that names the texture without holding it.

So the reads that fault go through descriptors my scan can't see: no View::Shader(resource, …) entry exists for these textures. What remains is a descriptor built from something other than a view of the Resource object. The obvious candidate is the placed path, View::Placed → placed_texture → resource::texture_at(address, desc): views that name memory (address + resource description) rather than the resource. Those aren't in by_resource, forget can't make them stale, and their made key doesn't change when the memory behind the address changes owner. The title streams these textures through pool pages and CopyPageMappingsBatchX, so the same address can name different textures over time.

I haven't checked:

  • that the faulting slot is a placed view;
  • how a placed slot ends up describing this texture's host copy without kept holding it. When made, make → View::Shader clones the texture into kept, which would have kept #1446 alive.

So either placed slots are made through a path that doesn't keep, or texture_at resolves to a different object than the one whose host texture is read. Logging, for each placed slot made, the slot index, the address and the texture serial texture_at returns would settle it. I'll try that next.

AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.

**@⁠h0useadv** on GitHub · 2026-11-24 10:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7128729429) I ran the check I suggested above. It narrows things: **the faulting texture had no view registered for its `Resource` at all.** **What I added** (diagnostics, local): in `Drop for Resource`, before `forget`, for every tracked texture (1024 or more), `descriptor::slots_naming` takes the live view entries in `VIEWS.by_resource` for this resource. It then scans every shader-visible `HostHeap`'s `made` for slots whose key is one of those entries, and reports whether `kept` holds the same `ID3D12Resource`. **Run** (RX 9070 XT, real GPU, `main` `dd54de2` + patch, DRED): ``` 10:23:00.0538 title released a tracked texture serial=1446 holders=1 views=0 slots=[] 10:23:00.0542 host texture destroyed serial=1446 texture=texture 1024x1024 f98 #1446 ... resource::resource_release 10:23:01.3502 host GPU device removed after a submission of 31 lists; page fault at 0x396b9a000; inside freed ["texture 1024x1024 f98 flags 0x0 #1446 (type 34)"]; a list stopped at command 1439 of 1712 (op 42) ``` Across the run's 618 tracked releases: | at release | count | |---|---| | `views=0`, no slots | **606** | | `views=1`, slots found, all `held=true same=true` | 12 | In the 12 cases where `made` slots name the texture, `kept` does hold it, and the texture outlives the release as it should. **None** of the releases found a slot that names the texture without holding it. So the reads that fault go through descriptors my scan can't see: no `View::Shader(resource, …)` entry exists for these textures. What remains is a descriptor built from something other than a view of the `Resource` object. The obvious candidate is the placed path, `View::Placed` → `placed_texture` → `resource::texture_at(address, desc)`: views that name **memory** (address + resource description) rather than the resource. Those aren't in `by_resource`, `forget` can't make them stale, and their `made` key doesn't change when the memory behind the address changes owner. The title streams these textures through pool pages and `CopyPageMappingsBatchX`, so the same address can name different textures over time. I haven't checked: - that the faulting slot is a placed view; - how a placed slot ends up describing this texture's host copy without `kept` holding it. When made, `make` → `View::Shader` clones the texture into `kept`, which would have kept #1446 alive. So either placed slots are made through a path that doesn't keep, or `texture_at` resolves to a different object than the one whose host texture is read. Logging, for each placed slot made, the slot index, the address and the texture serial `texture_at` returns would settle it. I'll try that next. AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 10:29 UTC · original

Correction to my comments above. On this RX 9070 XT this doesn't look like a texture lifetime bug at all. It looks like reads past the end of a 4 MB title-memory host copy. The freed textures DRED names are just whatever occupied the host VA right after that copy.

1. The "freed" textures were never viewable. I logged every host view made of a texture of 1024 or more (CreateShaderResourceView/CreateUnorderedAccessView in descriptor/host.rs make, plus Host::rtv/dsv) with the texture's serial. In the latest run, 504 of the 507 tracked textures the title released never had any host view: no SRV, UAV, RTV or DSV. No descriptor could reach them, so the GPU can't have been sampling them. (The faulting #1446 and #2369 in my earlier runs were in that class: released with views=0 and no holder.)

2. Every fault sits just past the end of a 4 MB host copy. DRED's report already prints the nearest title-memory copy below the faulting VA. Across all seven page faults on this card (four builds):

run nearest copy below the fault offset of the fault into it
main dd54de2 0xfe2400000+0x400000 0x403000
+ #609 0xc3f800000+0x400000 0x401000
+ #609 (GBV requested) 0xce5400000+0x400000 0x452000
tracking 0xcbd000000+0x400000 0x41d000
tracking 0xb16000000+0x400000 0xd11000
tracking 0x719800000+0x400000 0x41a000
tracking 0xceac00000+0x400000 0x1cba000 (nothing allocated there; no "inside freed")

Every copy is 0x400000 long, and every fault is past its end: five of seven within 0x52000 of the end, as close as 4 KB. When textures are never freed (my leak run), the host VA after a copy stays mapped to a live texture, so the over-read hits valid memory and doesn't fault. That explains why the leak run survived 9 minutes without a page fault, and why #609's longer lifetimes changed nothing.

What I think is happening, not proven: a shader reads through an address or view whose title-side extent runs past the 4 MB window VIctory copied for it, a raw/root buffer address or a buffer view sized from the title's description. The read continues into whatever host allocation comes next. That's the territory of #294 (full root SRV extent refresh), #493 (bound root SRVs to their host copy) and #185. I haven't tested any of them against this.

The check that would confirm it: when a host copy is made or used for a draw, log the largest extent the draw's root SRVs/UAVs and buffer views claim from its base, and flag any that run past the copy's +0x400000. The faulting draw (op 42, mesh) should be one of them.

Sorry for the detour in my earlier comments. The tracking data is what ruled the lifetime idea out.

AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.

**@⁠h0useadv** on GitHub · 2026-11-24 10:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7128860781) **Correction to my comments above.** On this RX 9070 XT this doesn't look like a texture lifetime bug at all. It looks like **reads past the end of a 4 MB title-memory host copy**. The freed textures DRED names are just whatever occupied the host VA right after that copy. **1. The "freed" textures were never viewable.** I logged every host view made of a texture of 1024 or more (`CreateShaderResourceView`/`CreateUnorderedAccessView` in `descriptor/host.rs` `make`, plus `Host::rtv`/`dsv`) with the texture's serial. In the latest run, **504 of the 507** tracked textures the title released never had any host view: no SRV, UAV, RTV or DSV. No descriptor could reach them, so the GPU can't have been sampling them. (The faulting #1446 and #2369 in my earlier runs were in that class: released with `views=0` and no holder.) **2. Every fault sits just past the end of a 4 MB host copy.** DRED's report already prints the nearest title-memory copy below the faulting VA. Across all seven page faults on this card (four builds): | run | nearest copy below the fault | offset of the fault into it | |---|---|---| | `main` dd54de2 | `0xfe2400000+0x400000` | `0x403000` | | + #609 | `0xc3f800000+0x400000` | `0x401000` | | + #609 (GBV requested) | `0xce5400000+0x400000` | `0x452000` | | tracking | `0xcbd000000+0x400000` | `0x41d000` | | tracking | `0xb16000000+0x400000` | `0xd11000` | | tracking | `0x719800000+0x400000` | `0x41a000` | | tracking | `0xceac00000+0x400000` | `0x1cba000` (nothing allocated there; no "inside freed") | Every copy is `0x400000` long, and every fault is past its end: five of seven within `0x52000` of the end, as close as 4 KB. When textures are never freed (my leak run), the host VA after a copy stays mapped to a live texture, so the over-read hits valid memory and doesn't fault. That explains why the leak run survived 9 minutes without a page fault, and why #609's longer lifetimes changed nothing. What I think is happening, not proven: a shader reads through an address or view whose title-side extent runs past the 4 MB window VIctory copied for it, a raw/root buffer address or a buffer view sized from the title's description. The read continues into whatever host allocation comes next. That's the territory of #294 (full root SRV extent refresh), #493 (bound root SRVs to their host copy) and #185. I haven't tested any of them against this. The check that would confirm it: when a host copy is made or used for a draw, log the largest extent the draw's root SRVs/UAVs and buffer views claim from its base, and flag any that run past the copy's `+0x400000`. The faulting draw (`op 42`, mesh) should be one of them. Sorry for the detour in my earlier comments. The tracking data is what ruled the lifetime idea out. AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.
Author
Owner

@⁠KingKaom on GitHub · 2026-11-24 10:39 UTC · original

The over-read correction gets a direct confirmation from RDNA4. Our #431 + #568 + #67-stack run (reported on #59, main 8e79c80 base, RX 9070 XT) fits your picture better than the lifetime one:

  • inside freed: zero occurrences — the freed-texture family vanished completely with that stack's retirement graveyard. World entry at +74 s, device removed at +247 s (~150 s in-world, single run).
  • The terminal fault is exactly your predicted class: page fault at 0x37fc5b000; the nearest title memory copy below it: 0xd2129b200+0x1f40 at host 0x37fbf0000, offset 0x6b000; the nearest above: ... at host 0x37fc80000. A read landing 0x6b000 past the host base of an 8,000-byte title copy, in the hole between two host mappings — a reader whose extent runs well past the copied window. All breadcrumbs done, the stopped list at command 51/78 (op 42, mesh), faulting indirect kind 10.

So two different ways of removing the free point (never freeing on your side, the #431 graveyard on ours) both take the freed-texture fault with them, and what remains is a read past a title-copy end. My kept-scan above agrees: the victim texture was released with zero live slots naming its host pointer — nothing CPU-side retained the address the GPU read.

One corollary for your extent check: the fault only appears when the copy's tail is followed by an unmapped hole. Where the next allocation is live, the over-read hits valid memory silently — no fault, wrong data. That would explain both your never-free run's survival and why this can persist for minutes before one unlucky layout kills it. Logging the largest claimed extent per draw against the copy size (not just faulting runs) should catch it even when it's harmless.

**@⁠KingKaom** on GitHub · 2026-11-24 10:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7129074295) **The over-read correction gets a direct confirmation from RDNA4.** Our `#431 + #568 + #67`-stack run (reported on #59, main `8e79c80` base, RX 9070 XT) fits your picture better than the lifetime one: - `inside freed`: **zero occurrences** — the freed-texture family vanished completely with that stack's retirement graveyard. World entry at +74 s, device removed at +247 s (~150 s in-world, single run). - The terminal fault is exactly your predicted class: `page fault at 0x37fc5b000; the nearest title memory copy below it: 0xd2129b200+0x1f40 at host 0x37fbf0000, offset 0x6b000; the nearest above: ... at host 0x37fc80000`. A read landing `0x6b000` past the host base of an **8,000-byte** title copy, in the hole between two host mappings — a reader whose extent runs well past the copied window. All breadcrumbs done, the stopped list at command 51/78 (`op 42`, mesh), faulting indirect kind 10. So two different ways of removing the free point (never freeing on your side, the #431 graveyard on ours) both take the freed-texture fault with them, and what remains is a read past a title-copy end. My kept-scan above agrees: the victim texture was released with zero live slots naming its host pointer — nothing CPU-side retained the address the GPU read. One corollary for your extent check: the fault only appears when the copy's tail is followed by an unmapped hole. Where the next allocation is live, the over-read hits valid memory silently — no fault, wrong data. That would explain both your never-free run's survival and why this can persist for minutes before one unlucky layout kills it. Logging the largest claimed extent per draw against the copy size (not just faulting runs) should catch it even when it's harmless.
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 11:03 UTC · original

Integrated and verified downstream in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/8 (PR #431).

  • Retires released host textures and overwritten descriptor slot resources until running GPU submissions complete via \STARTED\ / \FINISHED\ submission fence synchronization in \crates/victory-gpu/src/host.rs.
  • Lazily creates host texture allocations on first GPU usage via \OnceLock, cutting texture memory commit from ~9 GB to ~4.6 GB.
  • Passes all 85 \ ictory-gpu\ tests and \xtask policy\ checks.
**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 11:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7129593929) Integrated and verified downstream in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/8 (PR #431). - Retires released host textures and overwritten descriptor slot resources until running GPU submissions complete via \STARTED\ / \FINISHED\ submission fence synchronization in \crates/victory-gpu/src/host.rs\. - Lazily creates host texture allocations on first GPU usage via \OnceLock\, cutting texture memory commit from ~9 GB to ~4.6 GB. - Passes all 85 \ ictory-gpu\ tests and \xtask policy\ checks.
Author
Owner

@⁠h0useadv on GitHub · 2026-11-24 12:26 UTC · original

A small diagnostics change that came out of the over-read finding above. It's waiting on a branch while new pull requests are limited to collaborators (#712):

h0useadv/VIctory gpu/fault-past-copy-end: one commit on ffe310e, crates/victory-gpu/src/shadow.rs only, +27/−2.

The device-removed report already prints the nearest title-memory copy below the fault and the offset into it. It now also says whether that offset is inside the copy or how far past its end, so this class shows up in the report without working it out by hand:

...: 0xfe2400000+0x400000 at host 0x489000000, offset 0x403000, 0x3000 past its end

The existing offset 0x… text is unchanged, so log searches still work. There's a unit test; clippy and xtask policy are clean. I'll open it as a PR once that's possible again.

AI-assisted (Claude Code).

**@⁠h0useadv** on GitHub · 2026-11-24 12:26 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7131440332) A small diagnostics change that came out of the over-read finding above. It's waiting on a branch while new pull requests are limited to collaborators (#712): **[h0useadv/VIctory `gpu/fault-past-copy-end`](https://github.com/h0useadv/VIctory/compare/main...h0useadv:VIctory:gpu/fault-past-copy-end)**: one commit on `ffe310e`, `crates/victory-gpu/src/shadow.rs` only, +27/−2. The device-removed report already prints the nearest title-memory copy below the fault and the offset into it. It now also says whether that offset is **inside** the copy or how far **past its end**, so this class shows up in the report without working it out by hand: ``` ...: 0xfe2400000+0x400000 at host 0x489000000, offset 0x403000, 0x3000 past its end ``` The existing `offset 0x…` text is unchanged, so log searches still work. There's a unit test; clippy and `xtask policy` are clean. I'll open it as a PR once that's possible again. AI-assisted (Claude Code).
Author
Owner

@⁠ghost on GitHub · 2026-11-24 14:17 UTC · original

Another RDNA4 card (RX 9060 XT) on the over-read question, from the device-removed lines of all my VIctory runs started on 24 Nov (UTC): 68 removals over many builds (main, r4tedx's integration tree, PR test builds), all page faults.

  • 54 name a fault inside freed memory (50 textures, 3 list uploads, 1 title buffer). All 54 have a title-memory copy below them; 52 of those copies are 4 MB (0x400000).
  • Measured as in your table (offset into that copy, minus its size): 22 of 54 are within 0x52000 of the end, 29 within 1 MB, and 15 are 4 MB or more past it (up to 0x1589000). Median 0xae000.
  • The other 14 name no freed memory: 3 have no copy below, and 9 of the remaining 11 are 4 MB or more past one.

So on this card the "just past the end" cluster is real but holds under half of the freed-memory faults. Many land megabytes past a copy, where "past the copy below" says little about the reader.

Not checked: which reader, or a split by #493 / #294.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 14:17 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7134145922) Another RDNA4 card (RX 9060 XT) on the over-read question, from the device-removed lines of all my VIctory runs started on 24 Nov (UTC): 68 removals over many builds (`main`, r4tedx's integration tree, PR test builds), all page faults. - 54 name a fault `inside freed` memory (50 textures, 3 list uploads, 1 title buffer). All 54 have a title-memory copy below them; 52 of those copies are 4 MB (`0x400000`). - Measured as in your table (offset into that copy, minus its size): 22 of 54 are within `0x52000` of the end, 29 within 1 MB, and 15 are 4 MB or more past it (up to `0x1589000`). Median `0xae000`. - The other 14 name no freed memory: 3 have no copy below, and 9 of the remaining 11 are 4 MB or more past one. So on this card the "just past the end" cluster is real but holds under half of the freed-memory faults. Many land megabytes past a copy, where "past the copy below" says little about the reader. Not checked: which reader, or a split by #493 / #294. AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

@⁠blazebaal104 on GitHub · 2026-11-24 15:18 UTC · original

RX 7700 XT (RDNA3), Windows 11 26200, driver 32.0.32015.7029, diag build with DRED. With #609 on main@ffe310e: removed at frame ~1264, inside freed ["texture 1024x1024 f99"], stopped at 324/868 (op 5, ExecuteIndirect). Same as the RX 7800 XT result above.

One thing ruled out: I tried a local patch that makes HostList reset/drop (and List reset/drop) wait for any running submission containing the list, with a warning when it has to wait. Across a full run into the world, the warning never fired. So the title isn't resetting or releasing lists while they're in flight, and the stale reference must come from somewhere else. Patch available if useful.

AI assisted (Claude opus 5,5)

**@⁠blazebaal104** on GitHub · 2026-11-24 15:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7135804499) RX 7700 XT (RDNA3), Windows 11 26200, driver 32.0.32015.7029, diag build with DRED. With #609 on main@ffe310e: removed at frame ~1264, inside freed ["texture 1024x1024 f99"], stopped at 324/868 (op 5, ExecuteIndirect). Same as the RX 7800 XT result above. One thing ruled out: I tried a local patch that makes HostList reset/drop (and List reset/drop) wait for any running submission containing the list, with a warning when it has to wait. Across a full run into the world, the warning never fired. So the title isn't resetting or releasing lists while they're in flight, and the stale reference must come from somewhere else. Patch available if useful. AI assisted (Claude opus 5,5)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:48 UTC · original

Automated triage for the maintainers.

This issue is where the page fault ... inside freed ["texture 1024x1024 ..."] device removal is tracked. It is the oldest complete report of that signature after #336, and the thread holds the A/B data. The same signature is reported by:

  • #508: RDNA3 iGPU and RX 6750 XT, after #568;
  • #1348: RX 6750 XT;
  • #597: RX 9070 XT;
  • here: RX 6600, RX 7700 XT, RX 9060 XT and RX 9070 XT.

The RTX 4080 runs did not show it. The comments split it into two shapes: a stale read of a released host texture, and reads past the end of a 4 MB title-memory copy, which DRED attributes to whatever freed texture sat after the copy.

Merged since the last comment here, in d71c388:

  • resources displaced from view-heap slots are retired until the running submission has run (crate::host::retire / release_retired);
  • root SRV/UAV reads go through bounded views of their host copy, so reads past the copy give 0 (the over-read shape described above and in #951);
  • in diagnostics builds, an inside freed report now appends the texture's recent life events (released, slot dropped, let go, submissions).

Could someone with an affected AMD card run current main (diag build, VICTORY_D3D12_DRED=1) and post the full removal line, with the new life-event text?

Open patches in the area: #609 (retirement window; testers report it delays the fault but doesn't stop it; needs rebase). h0useadv's branch gpu/fault-past-copy-end (diagnostics: says how far past a copy's end the fault is) is only on a fork so far. Pull requests are open to everyone, so please open it as a PR so it can be reviewed.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/557#issuecomment-7149979154) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T15:18:28Z at=2026-11-25T01:49:20Z --> Automated triage for the maintainers. This issue is where the `page fault ... inside freed ["texture 1024x1024 ..."]` device removal is tracked. It is the oldest complete report of that signature after #336, and the thread holds the A/B data. The same signature is reported by: - #508: RDNA3 iGPU and RX 6750 XT, after #568; - #1348: RX 6750 XT; - #597: RX 9070 XT; - here: RX 6600, RX 7700 XT, RX 9060 XT and RX 9070 XT. The RTX 4080 runs did not show it. The comments split it into two shapes: a stale read of a released host texture, and reads past the end of a 4 MB title-memory copy, which DRED attributes to whatever freed texture sat after the copy. Merged since the last comment here, in d71c388: - resources displaced from view-heap slots are retired until the running submission has run (`crate::host::retire` / `release_retired`); - root SRV/UAV reads go through bounded views of their host copy, so reads past the copy give 0 (the over-read shape described above and in #951); - in diagnostics builds, an `inside freed` report now appends the texture's recent life events (released, slot dropped, let go, submissions). Could someone with an affected AMD card run current `main` (diag build, `VICTORY_D3D12_DRED=1`) and post the full removal line, with the new life-event text? Open patches in the area: #609 (retirement window; testers report it delays the fault but doesn't stop it; needs rebase). h0useadv's branch `gpu/fault-past-copy-end` (diagnostics: says how far past a copy's end the fault is) is only on a fork so far. Pull requests are open to everyone, so please open it as a PR so it can be reviewed. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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#557
No description provided.