You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
startup-runtime: guest-released committed textures are never freed, so local video memory exceeds the DXGI budget until the device is removed #2379
With X2W_D3D12_BUDGET=1, a start-up run shows guest-released committed textures accumulating in the retained column until DXGI local usage is more than twice the local budget. Shortly after, the device is removed. release() in src/startup_stubs/d3d12_xs_device.cpp keeps every wrapper and its desktop object for the life of the process ("The wrappers and their desktop objects stay alive for the process (experiment scope)."), so the local allocation of a released texture is never returned.
Environment
Windows 11 Pro 26200, i5-13600K, NVIDIA GeForce RTX 3080 10 GB (driver 32.0.16.2124), 32 GB RAM plus a 32 GB page file. Debug layer off.
Buffers retained at the last heartbeat: 0.60 GB / 8,420 objects.
At 372 s: x2w-d3d12 DEVICE REMOVED, reason 0x887a0007, first noticed after Device view 18. Two earlier runs with the same -MemoryGiB 40 reported DEVICE REMOVED, reason 0x887a0005, first noticed after CommandQueue execute 35 at 419 s and 348 s, followed by Present failed 0x887a0005 and every thread waiting until the timeout. Runs with -MemoryGiB 28 stopped earlier on E_OUTOFMEMORY from CreatePlacedResource and never reported a device removal.
Expected
A resource whose last guest reference is released has its desktop allocation freed once the GPU work that can still reference it has completed, so local usage stays near the live column.
Not established
That the overcommit causes the device removal: this is a correlation from the budget heartbeat, not a traced cause. The live column alone (7.0 GB of textures) would fit the budget.
I am prototyping a deferred release (after the queues pass a fence recorded at the final guest release) locally and will report measurements here before opening a PR.
Please continue the prototype here. For the first source-built slice, choose one committed texture class whose uses can be accounted for. Record its use before the guest drops its last reference, then submit while the queue is held at a fence. A second recording should also be able to hold the same object. The fixture should prove that both recordings still see the expected pixels, that release happens only after the last relevant fence, and that discarded recordings drop their references without inventing a submission. An early-release mutant should fail. Keep the existing descriptor and address-lookup lifetime for paths without this proof.
Please keep local-budget and process-commit samples separate. Compare at the same load progress and record the first device failure and debug-layer status when available. The budget report gives a retention signal; the removal cause is still open.
Local prototype result (branch not pushed yet). Same host and command as above, build f555b535 plus the prototype, X2W_D3D12_BUDGET=1.
The prototype, behind an opt-in X2W_D3D12_RELEASE_RETIRED=1, releases a resource's desktop object after its final guest release, once every shim-created queue has passed a fence signalled at that release. It covers committed resources from slots 27 and 127, and slot 133 textures and non-aliased buffers. Aliased placements, heaps and tiled address SRVs stay retained. The wrapper storage is kept. The resource is removed from the address index and the per-pointer caches before the desktop release.
Run
max local / budget
texture retained at the end
device removed
without the switch
21.5 GB / 9.1 GB
13.4 GB / 6,226
yes, 372 s
first version (no title_memory resources)
21.6 GB / 8.7 GB
14.8 GB / 6,721
yes
with slot 133 included
10.3 GB / 8.7 GB
0 / 0
no, 600 s time limit reached
In the last run, 43,000 resources were freed (35.7 GB in total over the run), the process commit peak dropped from about 32 GB to 22.8 GB, and 15,500 frames were presented.
Source-built check (startup_resource_retire_{warp,hardware}, plus _off_ variants without the switch) on WARP and the RTX 3080: a release while the queue is held by an unsignalled fence wait is not freed until the gate is signalled, retained returns to the baseline afterwards, and a new slot 133 texture at the same title address finds only the new wrapper. Two mutations fail it: freeing without the fence condition, and skipping the address index removal. ctest --preset release --no-tests=error -R 'd3d12|budget|startup_draw|offscreen|startup_stubs|startup_resource_retire|capture|memory_srv|placed': 84 passed, 0 failed, 1 skipped (d3d12_xs_shim_heap_indexing, 77, also skipped without the change).
Not established: multi-queue and multi-thread release races beyond the fixture, and a title that uses a resource after its final release (Map, GetDesc and GetGPUVirtualAddress would then dereference a null desktop object).
The matched opt-in run and same-address reuse check are useful. Please publish the source-built fixture and the narrowest texture slice when ready. A fence signalled at final guest Release covers work already queued on that queue. A command list may already reference the texture while still waiting to be submitted. The next discriminator is to record two lists, release the last guest reference while both are closed but unsubmitted, let the Release-time fences complete, and then submit the lists separately. Both must read back correctly. Hold the second submission at its own fence and verify retirement waits for it. Add Reset or destruction of an unsubmitted list as the discard case. This would pin the recording and submission lifetime before expanding to more resource classes. The run is useful progress evidence on this host. The precise device-removal cause remains open.
Input that clears first-run setup and the acceptance page.
x2w-budget heartbeat
local usage / budget
texture live (GiB/objects)
texture retained
buffer retained
1
0.5 / 16.2 GB
0.25 / 32
0 / 0
0 / 0
47 (before confirmation)
5.3 / 16.2 GB
4.17 / 1,238
0.08 / 13
0.00 / 2
71 (post-confirmation load)
12.7 / 16.2 GB
6.51 / 2,596
4.62 / 2,324
0.22 / 3,421
95 (last)
18.9 / 16.2 GB
6.70 / 2,427
10.32 / 5,115
0.71 / 11,190
Placed, upload, readback and heap stay flat, and unmeasured is 0.
Commit grows with the retained columns. The process commit from the storage heartbeat is about 11.6 GB until confirmation, then 18.7, 24.3 and 29.7 GB at 320, 380 and 440 s, until the 32 GiB job cap.
The run ends at the cap, not in a device removal.
The stand-in logs an XMemMapPhysicalPagesScatter map-view failure with error 1455.
Queue slot 31's pool request fails with 0x800705af.
The title then takes a second-chance null-object read in the main executable at about 495 s.
In three runs on this build and on a branch based on it, the stop came at 492–507 s, after the opening credits had rendered.
Raising the cap only moves the end. With -MemoryGiB 48 the same input reaches the 600 s limit, and commit is still rising: 25.7 GB at 410 s, 32.0 at 470 s and 38.1 at 560 s.
An earlier build peaked much lower. At c374c7bf this morning, the same post-confirmation phase peaked at 20 GB by 560 s and was levelling off. I haven't bisected which change since then increased the texture churn.
When the X2W_D3D12_RELEASE_RETIRED fixture and slice are published, I can rerun this matched input on the RX 9070 XT with the opt-in on and off, and report the budget columns and the end point.
Slice 1 is startup: opt-in release of retired committed 2D textures after list and fence lifetimes (slice 1) #2443 (opt-in X2W_D3D12_RELEASE_RETIRED=1). It covers committed 2D textures from slot 27/127 without title memory, with list holds, submission fences and release-time fences, as requested above. The fixture covers the two-list, held-second-submission and discard cases, and 11 local mutants fail it. Please leave review comments on that PR. I keep pushing to its branch myself.
Open: slice 2. The class has to be extended to slot 133 textures with title memory: these are the ones that grow in local start-up runs (in my 600 s run, texture retained reached 7.6 GB and slice 1 released 0). This needs the proof that is still missing for the title-address index (resource_address_index / existing_memory_texture), texture_uploads, written_textures and descriptor or view reuse, before anything there is freed.
Claiming Slice 2 (based on #2443 at 1ecd4cfc), extending X2W_D3D12_RELEASE_RETIRED=1 to slot 133 (device_place_resource_x) committed 2D textures with title_memory (keeping non-RT/DS/UAV, 1-sample, DEFAULT heap, and keeping slot 127 __XMemAllocationHooks__ resources excluded).
Plan for the four Slice 2 requirements listed above:
resource_address_index / existing_memory_texture: Erase (title_memory, wrapper) from resource_address_index() under note_lock when drain_retired_resources() claims the retired wrapper (refs CAS 0 -> retired_refs), keeping resource_infos() intact. Verify same-address slot 133 + slot 70 existing_memory_texture() reuse and X2W_RESOURCE_INDEX_CHECK=1.
texture_uploads / pending_gpu_writes / list_copy_texture: Fix list_copy_texture.inl to check title_memory (rather than !retire_when_idle) so retiring slot 133 textures still upload on CopyTextureRegion; synchronize texture_uploads() in list_copy.inl / list_copy_texture.inl under draw_lock; erase real from texture_uploads() under draw_lock in drain_retired_resources() before real->Release().
written_textures: Snapshot written_textures()[addr].generation at final guest Release() and clear stale entries on retirement only when the generation is unchanged and no tiled_address_srv exists at addr (preserving any newer XG / slot-70 write at the same address while preventing stale bc7_width / desktop_rows from skipping a later texture's upload).
Descriptor & view reuse (view_slot<18> SRVs + draw_translated): Track shadow_slot descriptor references in note_view / note_copy / descriptor-heap release() (falling back to retire_leave_class if a view targets an untracked slot or slots 19/20/21), and hold bound SRV textures in draw_translated via retire_hold(list, resource). Existing #2443 controls (including a resource whose SRV remains live in a descriptor heap) stay retained; once overwritten/freed and all lists/fences complete, the slot 133 texture retires.
Will build and verify on WARP and physical hardware (GTX 1660 SUPER) with source-built fixtures + fail-first mutations, and open a PR stacked on #2443.
@triggered02 thanks for taking slice 2. For comparison, here is a local start-up data point on the same host (RTX 3080 10 GB, 32 GB RAM plus 32 GB page file, 40 GiB job cap, X2W_D3D12_BUDGET=1). It uses the unreviewed v2 prototype, which also frees slot 133 committed stand-ins with title memory after the release-time fences (it does NOT have the list-hold proof from #2443):
access violation at 435 s after 8× E_OUTOFMEMORY in slot 133 placement
0
22.4 / 9.4 GB
13.7 GB
8 / 0
B
v2 prototype
process exited normally at 753 s
21000 resources, 16.3 GB
8.7 / 9.5 GB
0
0 / 0
So slot 133 title-memory textures are the class that matters in that workload. The v2 branch is JB2WIN:experimental/release-retired-v2 for testers only. It is not proposed for merge.
AMD data point for @JB2WIN's experimental/release-retired-v2 (bf937be2, one commit on main673d8e4a). I used one release build for both arms, with only X2W_D3D12_RELEASE_RETIRED differing.
Host:
GPU and OS: AMD Radeon RX 9070 XT (16 GB, driver 32.0.32029.2010), Windows 11 build 26300, 64 GB RAM.
Run settings: a 32 GiB job cap, X2W_D3D12_BUDGET=1 and X2W_D3D12_RENDER=1 (run.ps1 -Render), 600 s.
Input: the same scripted input in both arms; the passes repeat every 35 s from 190 s to 400 s to clear the agreement page.
Shader cache: a warm local cache, the same one for both arms.
arm
end
freed
peak local / budget
texture retained, peak
0x8007000e / device removed
off (= main673d8e4a)
access violation in the title at 493.9 s
0
21.0 / 16.2 GB
11.40 GB / 5171
14 / 0
on
still running at the 600 s timeout
23000 resources, 18.8 GB
10.3 / 16.2 GB
0.01 GB / 8
0 / 0
System commit was 25.5 GiB before the runs and 24.4 GiB 10 s after each exit. Neither arm left a commit increase behind.
This matches the RTX 3080 table above: on AMD too, slot 133 committed stand-ins with title memory are the class that grows, and freeing them after the release-time fences keeps the run inside the budget. The off arm also reproduces the ~495 s crash at this cap that I reported earlier on 7092683a.
Limits:
One run per arm.
These are executable runs with local inputs, not a source-built fixture.
I only checked end state and aggregate counters. I didn't verify per resource that nothing still in use was freed.
Slice 2 is on main in #2468 (6b9fb9d9). The final Release candidate passed all 12 focused WARP and RTX 4060 Laptop retirement tests. The same-address control fails if the older descriptor's view reference is ignored. @MasterDomino, your offered matched run is now unblocked. Keep the executable, saved profile, cache, job cap and observation interval identical, flip only X2W_D3D12_RELEASE_RETIRED, and report retained bytes/count, DXGI budget/peak, first failure or timeout, and the last visible stage. The earlier prototype run remains separate evidence.
@R0Y00, here is the matched run you asked for, on main6b9fb9d9 (#2468 merged).
Setup:
Build: one release build for both arms; only X2W_D3D12_RELEASE_RETIRED differs.
Run settings: the same executable, saved profile and warm shader cache, a 32 GiB job cap, X2W_D3D12_BUDGET=1, run.ps1 -Render, and a 600 s observation window.
Input: the same scripted input, which clears the legal and acceptance page.
access violation in the title at 490.7 s, after 8× 0x8007000e
none; still running at the 600 s timeout
0x8007000e / device removed
8 / 0
0 / 0
desktop references dropped by the retire drain
0
53,000
texture retained, peak
10.67 GB / 4,874 (at the failure)
9.41 GB / 4,364
texture retained, end
10.67 GB / 4,874
9.10 GB / 4,267
DXGI local usage / budget, peak
20.32 / 14.51 GB
19.91 / 14.46 GB
DXGI non-local usage, peak
6.01 GB
6.43 GB
system commit 10 s after exit
24.9 GiB
25.0 GiB (no growth left behind)
last visible stage
a rendered in-title scene, the same scene the earlier runs reached
the final capture at 600 s is one uniform constant color; frame and draw counters were still advancing (see below)
Retention over time (budget heartbeats about 5 s apart, retained bytes / count):
arm
~290 s
~375 s
~460 s
~520 s
off
0.08 GB / 13
6.00 GB / 2,817 (~370 s)
7.83 GB / 3,792 (~430 s)
failed at 490.7 s
on
0.08 GB / 8
3.80 GB / 1,810
6.28 GB / 2,903
9.39 GB / 4,360
Plainly: in this pair slice 2 removed the out-of-memory failure within the 600 s window, but it does not remove the blocker.
Retention: still climbs in steps to about 9.4 GB and doesn't come back down.
Budget: local usage stays about 5.4 GB over the DXGI budget.
Margin: an earlier run of the same runtime code at d03296d3 failed at 573.8 s under the same cap, so surviving to 600 s is marginal, not a fix.
Consistency: a second switch-on run at e29b1a7b, which has the same slice 2 code, also reached the timeout, with 9.14 GB retained.
Compared with v2: the unreviewed v2 prototype kept retention at 0.01 GB, so most of the remainder is releasable in principle.
About the uniform-color frame: both earlier switch-on runs ended at 600 s on the same rendered sequence as the off arm, so this capture differs. Translation activity was comparable: 763,721 translated draws and 72 translated programs on this arm, against 781,344 and 71 at e29b1a7b. I can't attribute the uniform-color frame from one capture and am only recording it.
What's left, which as far as I can see no issue or PR covers yet (a "slice 3"):
Does anyone (@JB2WIN, @triggered02) already plan this? If not, I can open an issue for it.
Limits: one run per arm, and these are local executable runs, not source-built fixtures. I checked aggregate counters only; I didn't verify per resource. No addresses, paths or captures are posted.
Without retire switches (build=fb2f86ac): earlier null AV in d3d12_xs on 381abc31 is gone. Stop is a title soft-assert (0x80000003) at ~255 s with rax/rcx=0x8007000e. Immediately before that: several CreatePlacedResourceX texture creates return 0x8007000e, plus multiple DirectStorage out of memory lines.
With#2579 opt-ins:
$env:X2W_D3D12_BUDGET='1'$env:X2W_D3D12_RELEASE_RETIRED='1'$env:X2W_D3D12_RELEASE_RETIRED_VIEWS='1'$env:X2W_D3D12_RETIRE_REASONS='1'# same run.ps1 … -LogDir out\startup\av-tip-retire
Budget/retire heartbeats appear (x2w-budget / x2w-retire held: never-class:…). Failure mode changes: second-chance C++ exception (0xe06d7363) ~254 s with stack dominated by xmem.dll (not the title int3). CreatePlaced E_OUTOFMEMORY counts were not clearly eliminated.
Not claiming this proves the device-removal path in the OP; it is the same chapter (post-picker resource pressure / retained desktop objects) measured on another host after FakeUser sign-in works.
Refs #2379. Part of #870 only as startup-runtime measurement.
CreatePlacedResourceX 0x8007000e: still 8 (not reduced)
DirectStorage out of memory: still 12 (not reduced)
x2w-budget / x2w-retire: 35 heartbeats each (switches live); late x2w-retire held: still shows never-class held resources (~100–137 MiB)
Stop: second-chance C++ exception 0xe06d7363 at KernelBase.dll after ~253.66 s, return-address stack dominated by xmem.dll (not the title int3 OOM soft-assert)
Takeaway
Opt-in retire (#2579 path) is active here but does not clear the CreatePlaced / DStorage OOM prelude on this tip host run; it does change the debugger stop to an xmem-dominated C++ exception. Filing as a comment on this issue rather than a duplicate tracker.
AI-assisted analysis of uploaded stderr/finished logs.
Thanks for the paired comparison. On the reported build, both runs still recorded eight placed-resource allocation failures and twelve DirectStorage OOMs. The retirement switches changed the later debugger stop, while those earlier counts stayed the same. For the next bounded replay, please record process commit and local video-memory budget/usage immediately before the first failure in each run, plus the first failing subsystem and result code. The four-switch comparison can establish whether the failure moves; a single-switch comparison can then identify which setting matters. Keep addresses, raw logs and private input local. The live-slot rebind guarantee and the #2468 check still apply.
A matched startup pair on main at f4c6998a (RTX 4090, driver 32.0.16.1088, 20 GiB job cap, same profile, cache and scripted input in both arms) with and without X2W_D3D12_RELEASE_RETIRED=1 plus X2W_D3D12_RELEASE_RETIRED_VIEWS=1:
Release off
Release on
Retained committed textures, last sample
3,563 MiB
143 MiB
DXGI local usage / budget, last sample
11,577 / 23,370 MiB
8,662 / 23,370 MiB
Stop (process seconds)
69.7 s
155.2 s
First failure
slot 133 texture placement E_OUTOFMEMORY
same
Device removed
no
no
On this 24 GB card local usage stayed under budget in both arms, so neither run reproduced the device removal reported here. The release kept retained textures flat, and the run lasted about 85 s longer before process commit reached the 20 GiB job cap. At the stop, X2W_D3D12_RETIRE_REASONS=1 still listed 484 MiB held, almost all outside the release class: 5,163 buffers (339 MiB) and 11 render-target, depth or UAV resources (144 MiB). The commit timeline and the untracked part are in #1199.
We’re keeping the same-slot rebind guarantee from #2468. A live slot-18 descriptor or its copy holds the resource until the slot is explicitly overwritten or the heap is destroyed. A recorded or submitted use also keeps the resource alive until that use retires. The #2579 opt-in currently clears slots when those slots are the remaining owners. We’ll remove that rewrite in a separate correction and keep the base retirement path. The old switch can report the retained views without changing any descriptor.
The 20 GiB A/B above is still useful memory-pressure evidence. The correction will verify a nonzero readback from the original slot and its copy after the last guest Release, including a held recording, and verify actual retirement after overwrite. We’ll run those checks both with and without the old switch.
The correction is open in #2679 at d1d92612. The Windows Release suite passed 26/26 on WARP and RTX 4060 Laptop, with the legacy switch both on and off. The same new fixture against the prior shim failed because the resource retired before its slot was overwritten. The measured slot and recording lifetimes are in the PR. This remains separate from the process-commit growth in #1199.
Slice 3b needs a maintainer decision, because the design I proposed is the one #2679 already rejected � and I could not find a safe variant of it.
What I verified
The rule d3d12: keep live SRVs intact during resource retirement #2679 enforces (git show 293e77f, plus ests/startup_resource_retire_views.cpp): a materialized view in a tracked descriptor slot is an owning reference until the slot is explicitly overwritten, copied over, or the heap wrapper is released. The drain may only free when
etire_view_refs == 0 and must never rewrite a live descriptor. X2W_D3D12_RELEASE_RETIRED_VIEWS is now a legacy diagnostic that logs clearing is disabled (d3d12_xs_device.cpp:829-837).
The bounded condition I proposed is empty. "Null only when no live guest wrapper, no hold, no flight, and no recorded view whose heap is still live" while
etire_view_refs > 0 cannot hold: every one of those refs exists because a materialized record sits in a live shadow cell, and cells are cleared only by overwrite, CopyDescriptors*, or the heap wrapper's final Release. So the condition collapses to �iew_refs == 0, which the drain already frees � my step would be dead code; the only remaining "win" state is observably identical to d3d12: keep live SRVs intact during resource retirement #2679's keep case.
later bind of that slot reads zeros; contradicts #2679 cases 1-4
unbounded retention
reverses #2679 for the opt-in path; the keep fixture cannot pass as written; needs a documented "released resource may read null" contract
What I am asking
3b is not code that can be merged as-is; it is a semantics decision about who owns a released-but-still-named texture. If you want the ~9 GB back, design C is the only honest route and it needs (a) your explicit approval to reverse #2679 for an opt-in path, (b) a switch documented as lossy ("a descriptor naming a released resource may read null after retirement"), (c) a fixture that forks the keep cases instead of contradicting them. If you prefer B, then slice 3a is the end of this series and #2379 should record the retention as intended behavior with the numbers.
Either answer is fine � I am not shipping the reverted behavior without it. 3a is in review as #2719.
Keep design B. A materialized descriptor and its copies own the resource until the slot is overwritten or the heap is destroyed. Last guest Release and completed fences can retire prior references and submissions, while the live slot must still support rebinding. Your #2679 mutation confirms the observable failure, so end this slice with #2719 and keep the old switch diagnostic-only. Please record the approximately 9 GB result as pressure measured in that run, alongside the bytes still owned by live slots, recording holds and in-flight work where the counters distinguish them.
Understood — keeping design B (#2679 compatibility: materialized descriptors and their copies own the resource until overwritten, copied over, or heap destruction). We will end slice 3 with #2719 (19–21 slot tracking + retire_leave_class only on untracked destinations) and keep X2W_D3D12_RELEASE_RETIRED_VIEWS diagnostic-only.
I will record the ~9 GB retained pressure from the diagnostic run alongside the live-slot, recording-hold, and in-flight breakdown counters in docs/experiments.md (either on #2719 if helpful or in a clean docs follow-up after #2719 lands).
@triggered02 a question before we start anything in your area.
When local video memory is exhausted, the slot 133 CreateCommittedResource for a placed texture returns E_OUTOFMEMORY, the guest gets a failed creation, and a title can go on to use a resource that does not exist. #2773 should push that point much further out, and #2379 design B covers the release side. Neither makes the creation itself survive a full card.
We would like to take a small, separate fallback on top of #2773: when the default-heap creation fails with E_OUTOFMEMORY, retry once in a custom heap in system memory (D3D12_HEAP_TYPE_CUSTOM, D3D12_MEMORY_POOL_L0), count it in x2w_budget as nonlocal, and log one line per fallback. It would be slower to sample but would not fail. It would be opt-in first, with a WARP + hardware readback test that forces the first creation to fail and checks the fallback texture samples the same texels.
It touches the same creation path as #2773, so we would wait for #2773 to land and build on it, or fit in however you prefer. Is that fine with you, or is it already on your list?
Activity
coordination: claim startup/release-retained-textures (R0Y00#2379 def…
R0Y00 commentedon Nov 25, 2026
Please continue the prototype here. For the first source-built slice, choose one committed texture class whose uses can be accounted for. Record its use before the guest drops its last reference, then submit while the queue is held at a fence. A second recording should also be able to hold the same object. The fixture should prove that both recordings still see the expected pixels, that release happens only after the last relevant fence, and that discarded recordings drop their references without inventing a submission. An early-release mutant should fail. Keep the existing descriptor and address-lookup lifetime for paths without this proof.
Please keep local-budget and process-commit samples separate. Compare at the same load progress and record the first device failure and debug-layer status when available. The budget report gives a retention signal; the removal cause is still open.
JB2WIN commentedon Nov 25, 2026
Local prototype result (branch not pushed yet). Same host and command as above, build
f555b535plus the prototype,X2W_D3D12_BUDGET=1.The prototype, behind an opt-in
X2W_D3D12_RELEASE_RETIRED=1, releases a resource's desktop object after its final guest release, once every shim-created queue has passed a fence signalled at that release. It covers committed resources from slots 27 and 127, and slot 133 textures and non-aliased buffers. Aliased placements, heaps and tiled address SRVs stay retained. The wrapper storage is kept. The resource is removed from the address index and the per-pointer caches before the desktop release.title_memoryresources)In the last run, 43,000 resources were freed (35.7 GB in total over the run), the process commit peak dropped from about 32 GB to 22.8 GB, and 15,500 frames were presented.
Source-built check (
startup_resource_retire_{warp,hardware}, plus_off_variants without the switch) on WARP and the RTX 3080: a release while the queue is held by an unsignalled fence wait is not freed until the gate is signalled, retained returns to the baseline afterwards, and a new slot 133 texture at the same title address finds only the new wrapper. Two mutations fail it: freeing without the fence condition, and skipping the address index removal.ctest --preset release --no-tests=error -R 'd3d12|budget|startup_draw|offscreen|startup_stubs|startup_resource_retire|capture|memory_srv|placed': 84 passed, 0 failed, 1 skipped (d3d12_xs_shim_heap_indexing, 77, also skipped without the change).Not established: multi-queue and multi-thread release races beyond the fixture, and a title that uses a resource after its final release (
Map,GetDescandGetGPUVirtualAddresswould then dereference a null desktop object).AI-assisted (Claude Code).
R0Y00 commentedon Nov 25, 2026
The matched opt-in run and same-address reuse check are useful. Please publish the source-built fixture and the narrowest texture slice when ready. A fence signalled at final guest Release covers work already queued on that queue. A command list may already reference the texture while still waiting to be submitted. The next discriminator is to record two lists, release the last guest reference while both are closed but unsubmitted, let the Release-time fences complete, and then submit the lists separately. Both must read back correctly. Hold the second submission at its own fence and verify retirement waits for it. Add Reset or destruction of an unsubmitted list as the discard case. This would pin the recording and submission lifetime before expanding to more resource classes. The run is useful progress evidence on this host. The precise device-removal cause remains open.
MasterDomino commentedon Nov 25, 2026
An AMD data point that matches this, and how it ends when the job commit cap is reached first.
Setup:
mainat7092683a, Release,X2W_D3D12_BUDGET=1.-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -MemoryGiB 32, warm cache, fresh storage.x2w-budgetheartbeatPlaced, upload, readback and heap stay flat, and
unmeasuredis 0.XMemMapPhysicalPagesScattermap-view failure with error 1455.0x800705af.-MemoryGiB 48the same input reaches the 600 s limit, and commit is still rising: 25.7 GB at 410 s, 32.0 at 470 s and 38.1 at 560 s.c374c7bfthis morning, the same post-confirmation phase peaked at 20 GB by 560 s and was levelling off. I haven't bisected which change since then increased the texture churn.When the
X2W_D3D12_RELEASE_RETIREDfixture and slice are published, I can rerun this matched input on the RX 9070 XT with the opt-in on and off, and report the budget columns and the end point.AI-assisted.
coordination: claim startup/release-retained-textures (R0Y00#2379 opt…
JB2WIN commentedon Nov 25, 2026
Status, for anyone picking this up:
X2W_D3D12_RELEASE_RETIRED=1). It covers committed 2D textures from slot 27/127 without title memory, with list holds, submission fences and release-time fences, as requested above. The fixture covers the two-list, held-second-submission and discard cases, and 11 local mutants fail it. Please leave review comments on that PR. I keep pushing to its branch myself.texture retainedreached 7.6 GB and slice 1 released 0). This needs the proof that is still missing for the title-address index (resource_address_index/existing_memory_texture),texture_uploads,written_texturesand descriptor or view reuse, before anything there is freed.AI-assisted (Claude Code)
triggered02 commentedon Nov 25, 2026
Claiming Slice 2 (based on #2443 at
1ecd4cfc), extendingX2W_D3D12_RELEASE_RETIRED=1to slot 133 (device_place_resource_x) committed 2D textures withtitle_memory(keeping non-RT/DS/UAV, 1-sample,DEFAULTheap, and keeping slot 127__XMemAllocationHooks__resources excluded).Plan for the four Slice 2 requirements listed above:
resource_address_index/existing_memory_texture: Erase(title_memory, wrapper)fromresource_address_index()undernote_lockwhendrain_retired_resources()claims the retired wrapper (refsCAS0 -> retired_refs), keepingresource_infos()intact. Verify same-address slot 133 + slot 70existing_memory_texture()reuse andX2W_RESOURCE_INDEX_CHECK=1.texture_uploads/pending_gpu_writes/list_copy_texture: Fixlist_copy_texture.inlto checktitle_memory(rather than!retire_when_idle) so retiring slot 133 textures still upload onCopyTextureRegion; synchronizetexture_uploads()inlist_copy.inl/list_copy_texture.inlunderdraw_lock; eraserealfromtexture_uploads()underdraw_lockindrain_retired_resources()beforereal->Release().written_textures: Snapshotwritten_textures()[addr].generationat final guestRelease()and clear stale entries on retirement only when the generation is unchanged and notiled_address_srvexists ataddr(preserving any newer XG / slot-70 write at the same address while preventing stalebc7_width/desktop_rowsfrom skipping a later texture's upload).view_slot<18>SRVs +draw_translated): Trackshadow_slotdescriptor references innote_view/note_copy/ descriptor-heaprelease()(falling back toretire_leave_classif a view targets an untracked slot or slots 19/20/21), and hold bound SRV textures indraw_translatedviaretire_hold(list, resource). Existing#2443controls (including a resource whose SRV remains live in a descriptor heap) stay retained; once overwritten/freed and all lists/fences complete, the slot 133 texture retires.Will build and verify on WARP and physical hardware (GTX 1660 SUPER) with source-built fixtures + fail-first mutations, and open a PR stacked on #2443.
AI-assisted (Gemini).
triggered02 commentedon Nov 25, 2026
Slice 2 draft PR (stacked on #2443 at
1ecd4cfc) is up: #2468. Verified on WARP and GTX 1660 SUPER (startup_resource_*,startup_list_copy*,startup_address_srv_*: 29 passed, 8 debug1 skipped, 0 failed) plus 4 fail-first mutations covering slot-133 upload/copy holds,resource_address_index/slot-70 same-address reuse (X2W_RESOURCE_INDEX_CHECK=1),written_texturesstalebc7_widthcleanup, and tracked slot-18 SRV descriptor reuse.JB2WIN commentedon Nov 25, 2026
@triggered02 thanks for taking slice 2. For comparison, here is a local start-up data point on the same host (RTX 3080 10 GB, 32 GB RAM plus 32 GB page file, 40 GiB job cap,
X2W_D3D12_BUDGET=1). It uses the unreviewed v2 prototype, which also frees slot 133 committed stand-ins with title memory after the release-time fences (it does NOT have the list-hold proof from #2443):E_OUTOFMEMORYin slot 133 placementSo slot 133 title-memory textures are the class that matters in that workload. The v2 branch is
JB2WIN:experimental/release-retired-v2for testers only. It is not proposed for merge.AI-assisted (Claude Code)
MasterDomino commentedon Nov 25, 2026
AMD data point for @JB2WIN's
experimental/release-retired-v2(bf937be2, one commit onmain673d8e4a). I used one release build for both arms, with onlyX2W_D3D12_RELEASE_RETIREDdiffering.Host:
X2W_D3D12_BUDGET=1andX2W_D3D12_RENDER=1(run.ps1 -Render), 600 s.0x8007000e/ device removedmain673d8e4a)System commit was 25.5 GiB before the runs and 24.4 GiB 10 s after each exit. Neither arm left a commit increase behind.
This matches the RTX 3080 table above: on AMD too, slot 133 committed stand-ins with title memory are the class that grows, and freeing them after the release-time fences keeps the run inside the budget. The off arm also reproduces the ~495 s crash at this cap that I reported earlier on
7092683a.Limits:
I'll run the same input on #2468 once its next head (the S3 fix) is up.
AI-assisted; runs executed locally, aggregates only.
startup: opt-in release of retired committed 2D textures after list a…
coordination: release startup/release-retained-textures (R0Y00#2379 o…
R0Y00 commentedon Nov 25, 2026
Slice 2 is on
mainin #2468 (6b9fb9d9). The final Release candidate passed all 12 focused WARP and RTX 4060 Laptop retirement tests. The same-address control fails if the older descriptor's view reference is ignored. @MasterDomino, your offered matched run is now unblocked. Keep the executable, saved profile, cache, job cap and observation interval identical, flip onlyX2W_D3D12_RELEASE_RETIRED, and report retained bytes/count, DXGI budget/peak, first failure or timeout, and the last visible stage. The earlier prototype run remains separate evidence.MasterDomino commentedon Nov 25, 2026
@R0Y00, here is the matched run you asked for, on
main6b9fb9d9(#2468 merged).Setup:
X2W_D3D12_RELEASE_RETIREDdiffers.X2W_D3D12_BUDGET=1,run.ps1 -Render, and a 600 s observation window.0x8007000e0x8007000e/ device removedRetention over time (budget heartbeats about 5 s apart, retained bytes / count):
Plainly: in this pair slice 2 removed the out-of-memory failure within the 600 s window, but it does not remove the blocker.
d03296d3failed at 573.8 s under the same cap, so surviving to 600 s is marginal, not a fix.e29b1a7b, which has the same slice 2 code, also reached the timeout, with 9.14 GB retained.About the uniform-color frame: both earlier switch-on runs ended at 600 s on the same rendered sequence as the off arm, so this capture differs. Translation activity was comparable: 763,721 translated draws and 72 translated programs on this arm, against 781,344 and 71 at
e29b1a7b. I can't attribute the uniform-color frame from one capture and am only recording it.What's left, which as far as I can see no issue or PR covers yet (a "slice 3"):
Does anyone (@JB2WIN, @triggered02) already plan this? If not, I can open an issue for it.
Limits: one run per arm, and these are local executable runs, not source-built fixtures. I checked aggregate counters only; I didn't verify per resource. No addresses, paths or captures are posted.
AI-assisted; runs executed locally.
7 remaining items
d3d12: opt-in release of retired textures held only by never-overwrit…
SimSalabimse commentedon Nov 25, 2026
Follow-up measurement (tip
fb2f86ac, after account picker)Environment: Windows 11
10.0.26200, RTX 4070 Ti driver32.0.16.2135, FakeUser offline,xgameruntime.dllpresent under System32. Account picker advances (QueryApiImpl / providers proxied).Without retire switches (
build=fb2f86ac): earlier null AV ind3d12_xson381abc31is gone. Stop is a title soft-assert (0x80000003) at ~255 s withrax/rcx=0x8007000e. Immediately before that: severalCreatePlacedResourceXtexture creates return0x8007000e, plus multiple DirectStorageout of memorylines.With
#2579opt-ins:Budget/retire heartbeats appear (
x2w-budget/x2w-retire held: never-class:…). Failure mode changes: second-chance C++ exception (0xe06d7363) ~254 s with stack dominated byxmem.dll(not the title int3). CreatePlacedE_OUTOFMEMORYcounts were not clearly eliminated.Not claiming this proves the device-removal path in the OP; it is the same chapter (post-picker resource pressure / retained desktop objects) measured on another host after FakeUser sign-in works.
Refs #2379. Part of #870 only as startup-runtime measurement.
AI-assisted.
SimSalabimse commentedon Nov 25, 2026
Tip measurement (
build=fb2f86ac) — retire A/B after account pickerSame host past the account picker (
-FakeUser, System32xgameruntime.dllpresent). Title-neutral; no game files.Environment: Windows 11 Pro 10.0.26200.8655 · NVIDIA GeForce RTX 4070 Ti · driver 32.0.16.2135 · tip stand-ins stamped
D3D12XboxCreateDevice … build=fb2f86ac.Without retire / budget switches
Device::slot133(CreatePlacedResourceX?) … -> 0x8007000e not aliasedout of memoryx2w-budget/x2w-retirelines0x80000003atgame_scarlett_master.exe+0x193e00fafter 254.62 s withrax/rcx/rsi=0x8007000e(title soft-assert on OOM)d3d12_xs.dll+0x1635a70AV (build=381abc31) is gone on tipWith BUDGET + RELEASE_RETIRED + RELEASE_RETIRED_VIEWS + RETIRE_REASONS
0x8007000e: still 8 (not reduced)out of memory: still 12 (not reduced)x2w-budget/x2w-retire: 35 heartbeats each (switches live); latex2w-retire held:still shows never-class held resources (~100–137 MiB)0xe06d7363atKernelBase.dllafter ~253.66 s, return-address stack dominated byxmem.dll(not the titleint3OOM soft-assert)Takeaway
Opt-in retire (#2579 path) is active here but does not clear the CreatePlaced / DStorage OOM prelude on this tip host run; it does change the debugger stop to an
xmem-dominated C++ exception. Filing as a comment on this issue rather than a duplicate tracker.AI-assisted analysis of uploaded stderr/finished logs.
R0Y00 commentedon Nov 25, 2026
Thanks for the paired comparison. On the reported build, both runs still recorded eight placed-resource allocation failures and twelve DirectStorage OOMs. The retirement switches changed the later debugger stop, while those earlier counts stayed the same. For the next bounded replay, please record process commit and local video-memory budget/usage immediately before the first failure in each run, plus the first failing subsystem and result code. The four-switch comparison can establish whether the failure moves; a single-switch comparison can then identify which setting matters. Keep addresses, raw logs and private input local. The live-slot rebind guarantee and the #2468 check still apply.
Not-Saii commentedon Nov 26, 2026
A matched startup pair on
mainatf4c6998a(RTX 4090, driver 32.0.16.1088, 20 GiB job cap, same profile, cache and scripted input in both arms) with and withoutX2W_D3D12_RELEASE_RETIRED=1plusX2W_D3D12_RELEASE_RETIRED_VIEWS=1:E_OUTOFMEMORYOn this 24 GB card local usage stayed under budget in both arms, so neither run reproduced the device removal reported here. The release kept retained textures flat, and the run lasted about 85 s longer before process commit reached the 20 GiB job cap. At the stop,
X2W_D3D12_RETIRE_REASONS=1still listed 484 MiB held, almost all outside the release class: 5,163 buffers (339 MiB) and 11 render-target, depth or UAV resources (144 MiB). The commit timeline and the untracked part are in #1199.AI-assisted (Claude Code).
R0Y00 commentedon Nov 26, 2026
We’re keeping the same-slot rebind guarantee from #2468. A live slot-18 descriptor or its copy holds the resource until the slot is explicitly overwritten or the heap is destroyed. A recorded or submitted use also keeps the resource alive until that use retires. The #2579 opt-in currently clears slots when those slots are the remaining owners. We’ll remove that rewrite in a separate correction and keep the base retirement path. The old switch can report the retained views without changing any descriptor.
The 20 GiB A/B above is still useful memory-pressure evidence. The correction will verify a nonzero readback from the original slot and its copy after the last guest Release, including a held recording, and verify actual retirement after overwrite. We’ll run those checks both with and without the old switch.
R0Y00 commentedon Nov 26, 2026
The correction is open in #2679 at
d1d92612. The Windows Release suite passed 26/26 on WARP and RTX 4060 Laptop, with the legacy switch both on and off. The same new fixture against the prior shim failed because the resource retired before its slot was overwritten. The measured slot and recording lifetimes are in the PR. This remains separate from the process-commit growth in #1199.triggered02 commentedon Nov 26, 2026
Slice 3b needs a maintainer decision, because the design I proposed is the one #2679 already rejected � and I could not find a safe variant of it.
What I verified
etire_view_refs == 0 and must never rewrite a live descriptor. X2W_D3D12_RELEASE_RETIRED_VIEWS is now a legacy diagnostic that logs clearing is disabled (d3d12_xs_device.cpp:829-837).
etire_view_refs > 0 cannot hold: every one of those refs exists because a materialized record sits in a live shadow cell, and cells are cleared only by overwrite, CopyDescriptors*, or the heap wrapper's final Release. So the condition collapses to �iew_refs == 0, which the drain already frees � my step would be dead code; the only remaining "win" state is observably identical to d3d12: keep live SRVs intact during resource retirement #2679's keep case.
ests/startup_resource_retire_views.cpp:423 � FAIL: T1 retired before its slot was overwritten (the first drain after the guest Release). Worktree restored, branch clean, nothing shipped.
The three designs
What I am asking
3b is not code that can be merged as-is; it is a semantics decision about who owns a released-but-still-named texture. If you want the ~9 GB back, design C is the only honest route and it needs (a) your explicit approval to reverse #2679 for an opt-in path, (b) a switch documented as lossy ("a descriptor naming a released resource may read null after retirement"), (c) a fixture that forks the keep cases instead of contradicting them. If you prefer B, then slice 3a is the end of this series and #2379 should record the retention as intended behavior with the numbers.
Either answer is fine � I am not shipping the reverted behavior without it. 3a is in review as #2719.
R0Y00 commentedon Nov 26, 2026
Keep design B. A materialized descriptor and its copies own the resource until the slot is overwritten or the heap is destroyed. Last guest Release and completed fences can retire prior references and submissions, while the live slot must still support rebinding. Your #2679 mutation confirms the observable failure, so end this slice with #2719 and keep the old switch diagnostic-only. Please record the approximately 9 GB result as pressure measured in that run, alongside the bytes still owned by live slots, recording holds and in-flight work where the counters distinguish them.
triggered02 commentedon Nov 26, 2026
Understood — keeping design B (#2679 compatibility: materialized descriptors and their copies own the resource until overwritten, copied over, or heap destruction). We will end slice 3 with #2719 (19–21 slot tracking +
retire_leave_classonly on untracked destinations) and keepX2W_D3D12_RELEASE_RETIRED_VIEWSdiagnostic-only.I will record the ~9 GB retained pressure from the diagnostic run alongside the live-slot, recording-hold, and in-flight breakdown counters in
docs/experiments.md(either on #2719 if helpful or in a clean docs follow-up after #2719 lands).startup: track UAV/RTV/DSV descriptor slots in the retire class (slic…
d3d12_xs: defer slot-133 read-only texture commits under X2W_D3D12_LA…
startup: correct the title-memory leak comment on the wrap() failure …
tedin7 commentedon Nov 26, 2026
@triggered02 a question before we start anything in your area.
When local video memory is exhausted, the slot 133
CreateCommittedResourcefor a placed texture returnsE_OUTOFMEMORY, the guest gets a failed creation, and a title can go on to use a resource that does not exist. #2773 should push that point much further out, and #2379 design B covers the release side. Neither makes the creation itself survive a full card.We would like to take a small, separate fallback on top of #2773: when the default-heap creation fails with
E_OUTOFMEMORY, retry once in a custom heap in system memory (D3D12_HEAP_TYPE_CUSTOM,D3D12_MEMORY_POOL_L0), count it inx2w_budgetas nonlocal, and log one line per fallback. It would be slower to sample but would not fail. It would be opt-in first, with a WARP + hardware readback test that forces the first creation to fail and checks the fallback texture samples the same texels.It touches the same creation path as #2773, so we would wait for #2773 to land and build on it, or fit in however you prefer. Is that fine with you, or is it already on your list?