World entry after #336: device removed reading freed streaming textures (page fault inside freed texture 1024x1024) #557
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#557
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KingKaom on GitHub · 2026-11-24 04:52 UTC · original
Build:
pr336head ond2a4bae(also merged withpr458); 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_HUNGwith DRED:Always the same victim class — a freed 1024x1024 texture (once: freed title-memory copies) — and the stopped command is always an
ExecuteIndirectkind 10 (mesh) list, a different mesh pipeline each run. The breadcrumb tail ends0/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: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).
@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 HostTextureis one of at least three free paths, and it is not the one that a meshExecuteIndirectlist can reach.Why
HostList::resetis a sound drain point.Host::execute(crates/victory-gpu/src/host.rs:492) signals the queue's fence and callsWaitForSingleObject(self.event, INFINITE)per group before returning, andresetis 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), andallocator_resetis a no-op stub.Free paths
Drop for HostTexturedoes not cover.HostHeap::keep(crates/victory-gpu/src/descriptor/host.rs:279):Rewriting a slot (
make_at,make_null,mirrorat line 353,constant_atat line 289) drops the resource the slot held inline on the CPU, during recording. That is notHostTexture::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.shadow::unregister(crates/victory-gpu/src/shadow.rs:391):The
Arc<Shadow>goes away here, and with itShadow::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 meshExecuteIndirectdoes 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 anExecuteIndirectkind 10, victim always a freed texture.make_null/keep(index, None)release the slot's resource the same way, andHostList::resetclearsstates/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 HostTextureand into the two places that actually release: the*slot = resourceassignment inHostHeap::keep, andshadow::unregister. A single globallate_keep(ID3D12Resource)drained at the fence wait inHost::executeafterWaitForSingleObjectis strictly safer than draining atreset, because the wait is the proof and it fires for every submission. Note thatshadow::loose(shadow.rs:448) already never frees its windows — theshortcutat line 441 — so loose-memory shadows cannot be the victim; onlyBUFFERSentries can.Two things I cannot check from here: whether DRED's
type 34resolves to one of these paths or to a pooled snapshotVec<u8>, and whetherDeferredalready holds everyArc<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
Resolving the caveat I left above, since it decides path 2:
Deferred(crates/victory-gpu/src/host.rs:880's neighbour, the struct beforeimpl Host) holdscopies,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),writesandbudget_zeroed.No
Arc<Shadow>anywhere in it. So a list does not keep title-buffer copies alive at all — it keeps texture ids, and theID3D12Resourcebehind a texture is held byHostHeap::kept(the descriptor slot), which is path 1's storage.shadow::unregisteris therefore a real, unreferenced free ofShadow::buffer, and the "lists that still hold its copy keep it alive" comment atshadow.rs:391only describes an intent thatDeferreddoes 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.
@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.
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).
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.
@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 inHost::execute(crates/victory-gpu/src/host.rs), immediately afterSignal+SetEventOnCompletion+WaitForSingleObject(self.event, INFINITE). The module's ownshortcutnote 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::resetis 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 inkept(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:keepassigned the new resource over the old one, dropping the previousID3D12Resourcewhile 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 theArc<Shadow>and with itShadow::buffer. Pooled snapshot memory (Vec<u8>inPOOL) is host memory, not anID3D12Resource, so it cannot be the page fault;shadow::loosenever frees its windows at all (shortcutatshadow.rs:441).I opened #575 for the two paths (
HostHeap::keepandshadow::unregister) with theexecute-time drain,cargo test -p victory-gpu43 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.@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_restofworldandstory000_restofworldpackages -> 12 frames presented ->DXGI_ERROR_DEVICE_REMOVEDduring list 10 of a 33-list submission.The measurable change versus the same box on #472 alone:
0x8007000E/ E_OUTOFMEMORYno shared bufferSo #336+#458 do clear the allocation-error storm, but the world-entry device removal remains. Here the failure is
0x887A0005, DRED reports0x887A0004(breadcrumbs unavailable), and the device-removed reason is0x887A0007. 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=1next if naming the exact command would help.@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):inside freed ["texture 1024x1024 f98 (type 34)"]Signal+WaitForSingleObjectinHost::executeGetCompletedValue()≥ drop-time fence value@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::Releasehands the VA range back to the allocator, and the nextCreatePlacedResource/CommitResourceAllocationcan 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 commandExecuteIndirectkind 10 in an unstarted list) would be the expected next failure if your0x887A0005is the same bug with less chatty DRED;VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1on 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).
@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:The sequence at the end was:
no shared bufferwith0x8007000Efor 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,restofworldpackages opened, nohost GPU failureline 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
0x887A0007device 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.
@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 bufferlines 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: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 f98texture 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.@LAKSHYA-cmd-tech on GitHub · 2026-11-24 05:34 UTC · original
Resolved via PR #609:
@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
1b6d967onto 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"], exit0x887A0005, zeroE_OUTOFMEMORYlines 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)
@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 wasEXECUTE_INDIRECT(op 5) orDISPATCH_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: #334AI-assisted test report.
@KingKaom on GitHub · 2026-11-24 08:07 UTC · original
Merged-main confirmation (head
7374bfb, which includes #336; diagnostics build + DRED, RDNA4 board): zerono free dynamic descriptor slotswarnings 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 insidefreed [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.)
@h0useadv on GitHub · 2026-11-24 08:25 UTC · original
Another RX 9070 XT data point, on current
mainand 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 anExecuteIndirect.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 wasVICTORY_KEYSEnter 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.no free dynamicwarningsmaindd54de2dd54de2+ #609 (merged clean)For comparison, release
d2a4bae(before #336 was merged) on this card died 35 s into the world, 1 s afterno free dynamic descriptor slots: a table is not made n=101. So #336 helps here as it did for others.Run A (
main):Run B (
main+ #609):What this adds, as far as I can tell:
release_late, or to a descriptor still pointing at the texture after the late release has drained. I haven't checked which.ExecuteIndirectkind 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.Both full
crashes.logentries 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: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())whenVICTORY_LEAK_TEXTURESis set. Every host texture then stays alive for the whole process.maindd54de2texture 1024x1024 f98dd54de2+ #6091024x1024f99 / f98 / f83dd54de2+ #609, GBV requested but no SDK layers on this machine (so a plain run)1024x1024f95 / f98dd54de2+ leakRun 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 dispatch04be1ad677ff1627was 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):
mirror,make_at) clones it intoHostHeap::kept, and the slot holds it until it's remade. Lists hold their textures throughStates. So a stale descriptor would have to live somewherekeptdoesn't track. A check that would settle it: onResourcedrop, record the host texture's raw pointer, scan allHostHeap::keptvectors, and log whether any slot other thankeptstill points at it. Or run with GBV on a machine with the Graphics Tools optional feature (this one doesn't have it).Full
crashes.logentries for A to D are available on request. They're VIctory's own output, with no game data.AI-assisted (Claude Code).
@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:
main8e79c80, 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-side0xC0000005write to0x0inside the compiled image module (process exit0xC0000005, 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.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.page fault at 0x475f0d000; inside freed ["texture 1024x1024 f98 ..."], submission of 11 lists,DXGI_ERROR_DEVICE_HUNG, ~30 s after world entry. So8e79c80is 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 onResourcedrop 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:36 UTC · original
Ran the kept-scan experiment (on
Resourcedrop: record the host texture's raw pointer, scan every host heap'skeptvector) — RX 9070 XT / 32 GB,main8e79c80, diagnostics build,VICTORY_D3D12_DEBUG+DRED+ scan knob.Numbers from a faulting run (world entered at 0.5 fps frames, then the usual death):
texture 2048x2048 f83released at09:33:06.77,arc=1(no list named its host copy) and no kept slot named it; the fault at09:33:09.94— 3.2 s later, submission of 29 lists,DXGI_ERROR_DEVICE_HUNG— landed inside its VA range.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
keptdoes 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).
@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 anIUnknownattached withSetPrivateDataInterface. D3D12 releases it when the resource is actually destroyed, and itsDroplogs 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:
The other one went through
HostList::reset. So when the title releases these textures, noHostHeap::keptslot and no list'sStatesholds 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 (
maindd54de2+ the patch) faulted on two other sizes: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
+0x2215c35that #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 areVICTORY_D3D12_WARP=1.AI-assisted (Claude Code). Logs are VIctory's own output, with no game data.
@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,
maindd54de2+ the patch, real GPU, DRED.What this shows:
Release, with no other holder. The last reference wasResource.host. NoHostHeap::keptslot and no list'sStatesheld a clone at that moment, or D3D12 wouldn't have destroyed it. It's the same path as 881/882 in the earlier run.now=None: the tracker reads the submission counter withtry_lockonHost::submitted, whichHost::executeholds from preparation through copy-back. So the title released this texture while another thread was insideexecute(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
keptmade. So the host-side reference to the texture lives somewhere without a hold. Candidates I haven't been able to rule out by reading:keptentry was replaced while its descriptor still describes this texture;CopyDescriptorsSimple, heap creation) carrying it into another heap;placed_texture, whosetexture_atresource isn't the title'sResource.A check that would settle it: in
Drop for Resource, before theArcdrops, scan every liveHostHeapfor 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:24 UTC · original
I ran the check I suggested above. It narrows things: the faulting texture had no view registered for its
Resourceat all.What I added (diagnostics, local): in
Drop for Resource, beforeforget, for every tracked texture (1024 or more),descriptor::slots_namingtakes the live view entries inVIEWS.by_resourcefor this resource. It then scans every shader-visibleHostHeap'smadefor slots whose key is one of those entries, and reports whetherkeptholds the sameID3D12Resource.Run (RX 9070 XT, real GPU,
maindd54de2+ patch, DRED):Across the run's 618 tracked releases:
views=0, no slotsviews=1, slots found, allheld=true same=trueIn the 12 cases where
madeslots name the texture,keptdoes 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 theResourceobject. 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 inby_resource,forgetcan't make them stale, and theirmadekey doesn't change when the memory behind the address changes owner. The title streams these textures through pool pages andCopyPageMappingsBatchX, so the same address can name different textures over time.I haven't checked:
keptholding it. When made,make→View::Shaderclones the texture intokept, which would have kept #1446 alive.So either placed slots are made through a path that doesn't keep, or
texture_atresolves 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 serialtexture_atreturns 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: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/CreateUnorderedAccessViewindescriptor/host.rsmake, plusHost::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 withviews=0and 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):
maindd54de20xfe2400000+0x4000000x4030000xc3f800000+0x4000000x4010000xce5400000+0x4000000x4520000xcbd000000+0x4000000x41d0000xb16000000+0x4000000xd110000x719800000+0x4000000x41a0000xceac00000+0x4000000x1cba000(nothing allocated there; no "inside freed")Every copy is
0x400000long, and every fault is past its end: five of seven within0x52000of 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.
@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, main8e79c80base, 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).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 landing0x6b000past 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.
@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).
@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 onffe310e,crates/victory-gpu/src/shadow.rsonly, +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:
The existing
offset 0x…text is unchanged, so log searches still work. There's a unit test; clippy andxtask policyare clean. I'll open it as a PR once that's possible again.AI-assisted (Claude Code).
@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.inside freedmemory (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).0x52000of the end, 29 within 1 MB, and 15 are 4 MB or more past it (up to0x1589000). Median0xae000.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.
@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)
@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: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:crate::host::retire/release_retired);inside freedreport 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