startup-runtime: guest-released committed textures are never freed, so local video memory exceeds the DXGI budget until the device is removed #2371

Closed
opened 2026-11-25 14:23:51 +00:00 by JB2WIN · 28 comments
JB2WIN commented 2026-11-25 14:23:51 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T14:23:51Z.


Commit or build

Upstream main at 09551998, Release build.

Summary

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.

Command

$env:X2W_D3D12_BUDGET = "1"
.\tools\startup\run.ps1 -Exe <dir>\<title>.exe -DataDir <package root> -LogDir out\startup\run15 -Seconds 600 -MemoryGiB 40 -Render -Translate -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 -InputScript "<menu script>" -StoragePath <dir>

Observed

x2w-budget lines from one run (71 heartbeats):

Heartbeat local usage / budget texture live (bytes/objects) texture retained (bytes/objects)
1 0.56 GB / 9.73 GB 0.30 GB / 32 0 / 0
25 (first over budget) 8.6 GB / 8.1 GB
71 (last) 21.5 GB / 9.1 GB 7.0 GB / 2,283 13.4 GB / 6,226

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.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6606684912 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T14:23:51Z. --- ### Commit or build Upstream `main` at `09551998`, Release build. ### Summary 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. ### Command ```powershell $env:X2W_D3D12_BUDGET = "1" .\tools\startup\run.ps1 -Exe <dir>\<title>.exe -DataDir <package root> -LogDir out\startup\run15 -Seconds 600 -MemoryGiB 40 -Render -Translate -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 -InputScript "<menu script>" -StoragePath <dir> ``` ### Observed `x2w-budget` lines from one run (71 heartbeats): | Heartbeat | local usage / budget | texture live (bytes/objects) | texture retained (bytes/objects) | |---|---|---|---| | 1 | 0.56 GB / 9.73 GB | 0.30 GB / 32 | 0 / 0 | | 25 (first over budget) | 8.6 GB / 8.1 GB | | | | 71 (last) | 21.5 GB / 9.1 GB | 7.0 GB / 2,283 | 13.4 GB / 6,226 | 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. _AI-assisted (Claude Code)._
R0Y00 commented 2026-11-25 15:02:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:34:27Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165485301 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7165485301). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:34:27Z. --- 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 commented 2026-11-25 16:05:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T15:06:26Z.


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).

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7166312226 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7166312226). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T15:06:26Z. --- 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). _AI-assisted (Claude Code)._
R0Y00 commented 2026-11-25 16:05:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T15:13:51Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7166508427 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7166508427). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T15:13:51Z. --- 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 commented 2026-11-25 16:05:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T15:59:09Z.


An AMD data point that matches this, and how it ends when the job commit cap is reached first.

Setup:

  • main at 7092683a, Release, X2W_D3D12_BUDGET=1.
  • AMD Radeon RX 9070 XT, 16 GB, driver 32.0.32029.2010.
  • Windows 11 build 26300, 64 GB RAM.
  • -Render -Translate -FakeUser -GpuMirror -StartupBelow40 -MemoryGiB 32, warm cache, fresh storage.
  • 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.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167489332 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7167489332). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T15:59:09Z. --- An AMD data point that matches this, and how it ends when the job commit cap is reached first. **Setup:** - `main` at `7092683a`, Release, `X2W_D3D12_BUDGET=1`. - AMD Radeon RX 9070 XT, 16 GB, driver 32.0.32029.2010. - Windows 11 build 26300, 64 GB RAM. - `-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -MemoryGiB 32`, warm cache, fresh storage. - 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. AI-assisted.
JB2WIN commented 2026-11-25 18:01:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T17:03:04Z.


Status, for anyone picking this up:

  • Slice 1 is #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.
  • If you start on slice 2, please say so here first, so that we do not build the same thing twice. Base it on #2443 or wait until it is merged.

AI-assisted (Claude Code)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7168927143 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7168927143). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T17:03:04Z. --- Status, for anyone picking this up: - **Slice 1** is #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. - If you start on slice 2, please say so here first, so that we do not build the same thing twice. Base it on #2443 or wait until it is merged. AI-assisted (Claude Code)
triggered02 commented 2026-11-25 18:01:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T17:21:01Z.


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:

  1. 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.
  2. 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().
  3. 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).
  4. 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.

AI-assisted (Gemini).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7169375455 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7169375455). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T17:21:01Z. --- 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: 1. **`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`. 2. **`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()`. 3. **`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). 4. **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. AI-assisted (Gemini).
triggered02 commented 2026-11-25 18:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T17:36:07Z.


Slice 2 draft PR (stacked on #2443 at 1ecd4cfc) is up: https://github.com/R0Y00/Xbox2Windows/pull/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_textures stale bc7_width cleanup, and tracked slot-18 SRV descriptor reuse.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7169736862 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7169736862). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T17:36:07Z. --- Slice 2 draft PR (stacked on #2443 at `1ecd4cfc`) is up: https://github.com/R0Y00/Xbox2Windows/pull/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_textures` stale `bc7_width` cleanup, and tracked slot-18 SRV descriptor reuse.
JB2WIN commented 2026-11-25 18:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T17:39:55Z.


@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):

run build end freed local / budget at the end texture retained OOM / device removed
A #2443 (slice 1) 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.

AI-assisted (Claude Code)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7169825645 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7169825645). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T17:39:55Z. --- @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): | run | build | end | freed | local / budget at the end | texture retained | OOM / device removed | |---|---|---|---|---|---|---| | A | #2443 (slice 1) | 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. AI-assisted (Claude Code)
MasterDomino commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T18:06:00Z.


AMD data point for @JB2WIN's experimental/release-retired-v2 (bf937be2, one commit on main 673d8e4a). 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 (= main 673d8e4a) 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.
  • v2 lacks the list and descriptor proofs that #2443 and #2468 add, so this is reference data only.

I'll run the same input on #2468 once its next head (the S3 fix) is up.

AI-assisted; runs executed locally, aggregates only.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170437059 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7170437059). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T18:06:00Z. --- AMD data point for @JB2WIN's `experimental/release-retired-v2` (`bf937be2`, one commit on `main` `673d8e4a`). 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 (= `main` `673d8e4a`) | 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. - v2 lacks the list and descriptor proofs that #2443 and #2468 add, so this is reference data only. I'll run the same input on #2468 once its next head (the S3 fix) is up. AI-assisted; runs executed locally, aggregates only.
R0Y00 commented 2026-11-25 20:04:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T19:49:16Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172806402 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7172806402). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T19:49:16Z. --- 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.
triggered02 commented 2026-11-25 21:01:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T20:23:38Z.


@MasterDomino your matched run is exactly the discriminator I needed, and your "what's left" list matches what I see in the shim. Claiming slice 3 here before anyone duplicates it; no issue is needed, this comment is the tracker.

Where the remainder comes from. In d3d12_xs_device.cpp, iew_slot<18> (SRV) keeps a resource in the retire class and adds a per-resource
etire_view_refs count for each tracked descriptor slot (d3d12_capture.inl:318, released when that slot is overwritten at :320 or the heap is destroyed). drain_retired_resources() only frees a resource with
etire_view_refs == 0 (:4632). So a slot 133 texture whose SRV lives in a heap slot that is never overwritten keeps a ref forever � that is your ~9 GB, and it is a deliberate conservatism in #2468, not an accident: the retired wrapper stays resolvable, so freeing the desktop object under a live descriptor would leave a dangling view. Slots 19-21 (UAV/RTV/DSV) are not tracked at all: iew_slot calls
etire_leave_class on them (:3897-3898), so any texture with an RTV/DSV/UAV is permanently out of the class � your second point.

Slice 3, two parts, in this order:

  1. Track the slots 19-21 views like slot 18 (narrowest, provable). Add the same per-descriptor ref accounting for UAV (slot 19, both the resource and its counter resource), RTV (20) and DSV (21), through
    ote_view /
    ote_copy /
    etire_drop_heap_views, keeping
    etire_leave_class only for descriptors in heaps the shim cannot track. Fixture cases that drive each view type, hold the resource, then overwrite the slot and destroy the heap, with mutants that fail if the ref is not added or not released. This closes your "no fixture drives slots 19-21" finding without changing any freeing rule.
  2. Bound the never-overwritten descriptor (the actual leak). A descriptor slot that still names a resource the guest has already released must not keep it alive for the process. The rule I intend to implement: at drain, when the only remaining references are tracked descriptor slots, rewrite those slots to a null descriptor (dropping their refs through the normal path) before the desktop release, so the wrapper retires and a later resolve of that slot binds a null view instead of a dangling one. That keeps the list-hold and submission-fence proof from #2443 and makes the descriptor case stale-safe rather than merely free. It also gives the same-address generation case a defined answer: the slot is nulled, so nothing reads the older generation's metadata.

I am starting part 1 now on startup/retire-slice3 from 780f3c0a, source-built fixture on WARP and a GTX 1660 SUPER with fail-first mutants, and I will post the PR here. Part 2 follows in its own PR once part 1 is in � if either of you thinks nulling the descriptor slot is the wrong rule (versus keeping the resource until the slot is overwritten), say so before I write that half, because that is the decision that changes the memory outcome.

Also: @MasterDomino the red frame you saw at 600 s is worth not attributing to slice 2; if you re-run, capturing the last three heartbeats and the frame count before the capture would separate "still rendering" from "stalled on a red clear".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173604598 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7173604598). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T20:23:38Z. --- @MasterDomino your matched run is exactly the discriminator I needed, and your "what's left" list matches what I see in the shim. Claiming **slice 3** here before anyone duplicates it; no issue is needed, this comment is the tracker. **Where the remainder comes from.** In d3d12_xs_device.cpp, iew_slot<18> (SRV) keeps a resource in the retire class and adds a per-resource etire_view_refs count for each tracked descriptor slot (d3d12_capture.inl:318, released when that slot is overwritten at :320 or the heap is destroyed). drain_retired_resources() only frees a resource with etire_view_refs == 0 (:4632). So a slot 133 texture whose SRV lives in a heap slot that is never overwritten keeps a ref forever � that is your ~9 GB, and it is a *deliberate* conservatism in #2468, not an accident: the retired wrapper stays resolvable, so freeing the desktop object under a live descriptor would leave a dangling view. Slots 19-21 (UAV/RTV/DSV) are not tracked at all: iew_slot calls etire_leave_class on them (:3897-3898), so any texture with an RTV/DSV/UAV is permanently out of the class � your second point. **Slice 3, two parts, in this order:** 1. **Track the slots 19-21 views like slot 18 (narrowest, provable).** Add the same per-descriptor ref accounting for UAV (slot 19, both the resource and its counter resource), RTV (20) and DSV (21), through ote_view / ote_copy / etire_drop_heap_views, keeping etire_leave_class only for descriptors in heaps the shim cannot track. Fixture cases that drive each view type, hold the resource, then overwrite the slot and destroy the heap, with mutants that fail if the ref is not added or not released. This closes your "no fixture drives slots 19-21" finding without changing any freeing rule. 2. **Bound the never-overwritten descriptor (the actual leak).** A descriptor slot that still names a resource the guest has already released must not keep it alive for the process. The rule I intend to implement: at drain, when the only remaining references are tracked descriptor slots, rewrite those slots to a null descriptor (dropping their refs through the normal path) before the desktop release, so the wrapper retires and a later resolve of that slot binds a null view instead of a dangling one. That keeps the list-hold and submission-fence proof from #2443 and makes the descriptor case stale-safe rather than merely free. It also gives the same-address generation case a defined answer: the slot is nulled, so nothing reads the older generation's metadata. I am starting part 1 now on startup/retire-slice3 from 780f3c0a, source-built fixture on WARP and a GTX 1660 SUPER with fail-first mutants, and I will post the PR here. Part 2 follows in its own PR once part 1 is in � if either of you thinks nulling the descriptor slot is the wrong rule (versus keeping the resource until the slot is overwritten), say so before I write that half, because that is the decision that changes the memory outcome. Also: @MasterDomino the red frame you saw at 600 s is worth not attributing to slice 2; if you re-run, capturing the last three heartbeats and the frame count before the capture would separate "still rendering" from "stalled on a red clear".
triggered02 commented 2026-11-25 21:01:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T20:25:50Z.


I read @JB2WIN's v2 prototype against #2468 so slice 3 is built with your data rather than next to it. v2's rule (f937be2, one commit on 673d8e4a) is: free the desktop object after the final guest Release once every shim queue has passed its own fence, with no descriptor bookkeeping at all � it does not track view references, so the descriptor-held textures @MasterDomino identified simply disappear with the resource. That is why v2 ends at 0.01 GB retained and #2468 sits at ~9.4 GB.

So slice 3b is the same freeing moment as v2, plus the safety #2468 added: when the only remaining references are tracked descriptor slots, null those slots first (releases their refs through the normal path) and then free, so a later resolve of a stale slot binds a null view instead of a dangling desktop object. Untracked heaps keep the
etire_leave_class fallback. That is deliberately v2-plus-one-invariant rather than a new design.

Two questions that would change the implementation, so please answer before I write that half:

  • @JB2WIN: in your v2 runs, did anything later use a freed texture through a descriptor slot � a crash, an AV, a null view read, existing_memory_texture returning the old wrapper, or a draw that lost its sampled texture after the freeing point? If v2 freed ~43,000 objects over 600 s without that, the nulling step is defensive rather than load-bearing, and I will implement it that way (free first, null as the derived state) instead of gating the free on it.
  • @MasterDomino: your matched run is the only AMD evidence. When the slice 3a PR head is up I will ping you; the useful capture is the same input/settings with only X2W_D3D12_RELEASE_RETIRED flipped, and for the red-frame question the last three budget heartbeats plus the presented-frame counter before the capture, so "still rendering" and "stalled on a red clear" separate.

Slice 3a (tracking iew_slot 19-21 so UAV/RTV/DSV descriptors hold and release like slot 18) is in progress on startup/retire-slice3 from 780f3c0a, source-built fixture, WARP plus a GTX 1660 SUPER, four mutants. I will post the PR with the measurement table; if either of you wants to co-review, say so and I will tag you in it rather than open it as a single-author change.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173659375 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7173659375). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T20:25:50Z. --- I read @JB2WIN's v2 prototype against #2468 so slice 3 is built with your data rather than next to it. v2's rule (f937be2, one commit on 673d8e4a) is: free the desktop object after the final guest Release once every shim queue has passed its own fence, with **no descriptor bookkeeping at all** � it does not track view references, so the descriptor-held textures @MasterDomino identified simply disappear with the resource. That is why v2 ends at 0.01 GB retained and #2468 sits at ~9.4 GB. So slice 3b is the same freeing moment as v2, plus the safety #2468 added: when the only remaining references are tracked descriptor slots, null those slots first (releases their refs through the normal path) and then free, so a later resolve of a stale slot binds a null view instead of a dangling desktop object. Untracked heaps keep the etire_leave_class fallback. That is deliberately v2-plus-one-invariant rather than a new design. Two questions that would change the implementation, so please answer before I write that half: - @JB2WIN: in your v2 runs, did anything later use a freed texture through a descriptor slot � a crash, an AV, a null view read, existing_memory_texture returning the old wrapper, or a draw that lost its sampled texture after the freeing point? If v2 freed ~43,000 objects over 600 s without that, the nulling step is defensive rather than load-bearing, and I will implement it that way (free first, null as the derived state) instead of gating the free on it. - @MasterDomino: your matched run is the only AMD evidence. When the slice 3a PR head is up I will ping you; the useful capture is the same input/settings with only X2W_D3D12_RELEASE_RETIRED flipped, and for the red-frame question the last three budget heartbeats plus the presented-frame counter before the capture, so "still rendering" and "stalled on a red clear" separate. Slice 3a (tracking iew_slot 19-21 so UAV/RTV/DSV descriptors hold and release like slot 18) is in progress on startup/retire-slice3 from 780f3c0a, source-built fixture, WARP plus a GTX 1660 SUPER, four mutants. I will post the PR with the measurement table; if either of you wants to co-review, say so and I will tag you in it rather than open it as a single-author change.
R0Y00 commented 2026-11-25 21:01:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T20:30:38Z.


The slice 3a source-built tracking work can proceed under the current lifetime rule. Keep slot-18 behavior and use-after-release-through-a-live-view coverage. For 3b, defer freeing any resource while a live tracked descriptor still references it until the lifetime decision is settled. The v2 retention A/B measures pressure; it does not establish whether a later read of one of those descriptors must remain valid. Please keep the ordinary live-view, pending-list and fence controls on the original issue.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173777330 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7173777330). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T20:30:38Z. --- The slice 3a source-built tracking work can proceed under the current lifetime rule. Keep slot-18 behavior and use-after-release-through-a-live-view coverage. For 3b, defer freeing any resource while a live tracked descriptor still references it until the lifetime decision is settled. The v2 retention A/B measures pressure; it does not establish whether a later read of one of those descriptors must remain valid. Please keep the ordinary live-view, pending-list and fence controls on the original issue.
JB2WIN commented 2026-11-25 21:01:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T20:40:07Z.


Now that #2443 and #2468 are merged: would you accept a small PR that has tools/startup/run.ps1 (and run.sh) set X2W_D3D12_RELEASE_RETIRED=1 for start-up runs, the same way it already sets X2W_AUDIO_PERMISSIVE, X2W_D3D12_PERMISSIVE and the other start-up switches? The shim default and the fixtures would stay as they are. It would only change the wrapper scripts, with a -KeepRetired / X2W_D3D12_RELEASE_RETIRED=0 way out.

Reason: people who start runs without the switch keep hitting the video-memory stop. On my host (RTX 3080 10 GB, X2W_D3D12_BUDGET=1), the same start-up path without the switch ended at 435 s after 8× E_OUTOFMEMORY (13.7 GB retained). With slice 1+2 enabled, several 450–1005 s runs had no E_OUTOFMEMORY and no device removal. Retention is not gone: in gameplay up to 8.7 GB stays retained (numbers on #2468), but the runs no longer stop there.

If you would rather keep it fully opt-in until the remaining retention is understood, I will leave it.

AI-assisted (Claude Code)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174011299 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7174011299). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T20:40:07Z. --- Now that #2443 and #2468 are merged: would you accept a small PR that has `tools/startup/run.ps1` (and `run.sh`) set `X2W_D3D12_RELEASE_RETIRED=1` for start-up runs, the same way it already sets `X2W_AUDIO_PERMISSIVE`, `X2W_D3D12_PERMISSIVE` and the other start-up switches? The shim default and the fixtures would stay as they are. It would only change the wrapper scripts, with a `-KeepRetired` / `X2W_D3D12_RELEASE_RETIRED=0` way out. Reason: people who start runs without the switch keep hitting the video-memory stop. On my host (RTX 3080 10 GB, `X2W_D3D12_BUDGET=1`), the same start-up path without the switch ended at 435 s after 8× `E_OUTOFMEMORY` (13.7 GB retained). With slice 1+2 enabled, several 450–1005 s runs had no `E_OUTOFMEMORY` and no device removal. Retention is not gone: in gameplay up to 8.7 GB stays retained (numbers on #2468), but the runs no longer stop there. If you would rather keep it fully opt-in until the remaining retention is understood, I will leave it. AI-assisted (Claude Code)
R0Y00 commented 2026-11-25 21:01:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T20:51:01Z.


Slice 3a may track UAV, RTV and DSV slots 19–21 alongside slot 18. A live descriptor continues to hold its resource until the slot is overwritten or its heap is destroyed. Recorded and in-flight uses keep the existing retirement rules. Final guest Release plus a completed fence does not invalidate a live descriptor. Please keep #2468’s same-slot rebinding control and cover overwrite and heap destruction for the new view kinds. The v2 memory figures remain useful as pressure measurements.

For the launcher proposal, keep retirement explicit for now. We have good matched evidence on AMD and RTX 3080. The latest GTX 1050 Ti report reached a separate allocation failure with the debug layer off. A matched pair on that adapter would help establish the low-budget behavior before we change both launchers’ default. I’ll coordinate that on the existing #870 report.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174272219 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7174272219). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T20:51:01Z. --- Slice 3a may track UAV, RTV and DSV slots 19–21 alongside slot 18. A live descriptor continues to hold its resource until the slot is overwritten or its heap is destroyed. Recorded and in-flight uses keep the existing retirement rules. Final guest Release plus a completed fence does not invalidate a live descriptor. Please keep #2468’s same-slot rebinding control and cover overwrite and heap destruction for the new view kinds. The v2 memory figures remain useful as pressure measurements. For the launcher proposal, keep retirement explicit for now. We have good matched evidence on AMD and RTX 3080. The latest GTX 1050 Ti report reached a separate allocation failure with the debug layer off. A matched pair on that adapter would help establish the low-budget behavior before we change both launchers’ default. I’ll coordinate that on the existing #870 report.
MasterDomino commented 2026-11-25 21:01:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T20:12:58Z.


@R0Y00, here is the matched run you asked for, on main 6b9fb9d9 (#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.
  • Host: AMD Radeon RX 9070 XT (16 GB, driver 32.0.32029.2010), Windows 11 build 26300.
switch off switch on
first failure or timeout 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"):

  1. Descriptor-held textures: slot 133 textures that stay counted through descriptor slots that are never overwritten (the S7 hypothesis on #2468), which is most of the ~9 GB above.
  2. UAV/RTV/DSV views: the slots 19–21 branch that @ChazY11 found no fixture drives on #2468.

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173347195 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7173347195). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T20:12:58Z. --- @R0Y00, here is the matched run you asked for, on `main` `6b9fb9d9` (#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. - **Host:** AMD Radeon RX 9070 XT (16 GB, driver 32.0.32029.2010), Windows 11 build 26300. | | switch off | switch on | |---|---|---| | first failure or timeout | 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"):** 1. **Descriptor-held textures:** slot 133 textures that stay counted through descriptor slots that are never overwritten (the S7 hypothesis on #2468), which is most of the ~9 GB above. 2. **UAV/RTV/DSV views:** the slots 19–21 branch that @ChazY11 found no fixture drives on #2468. 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.
JB2WIN commented 2026-11-25 22:02:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T21:07:04Z.


@triggered02 Data on the remaining retention with #2468 merged. A local opt-in counter (X2W_D3D12_RETIRE_REASONS, not upstream) attributes every final-released, still-live resource to a reason. At the end of a ~6 min start-up run on 1cce2a32:

x2w-retire held: view-refs=2297/4445110272(oldest 4374f) never-class:buffer=8178/551813120 never-class:dimension=4/262144 never-class:rt-ds-uav=14/200212480 view-refs-in-visible-heap=2297/4445110272 total=10493/5197398016 unattributed=0/0

So about 4.4 GB of the retained textures are slot 133 class members that only live on because a descriptor in a shader-visible heap still names them, and the title never overwrites those slots. The oldest is 4374 frames old.

I am trying a local follow-up: once the existing holds, flights and release fences allow the release, rewrite those descriptors (and their shim shadow/token entries) to null SRVs of the same dimension before releasing. A stale read would then see zeros, not freed memory. The fixture plan covers never-overwritten slots, a closed unsubmitted list that uses the slot, copied descriptors and fail-first mutants. If you are already on this, or would rather design it yourself, say so and I will stop.

AI-assisted (Claude Code)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174634554 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7174634554). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T21:07:04Z. --- @triggered02 Data on the remaining retention with #2468 merged. A local opt-in counter (`X2W_D3D12_RETIRE_REASONS`, not upstream) attributes every final-released, still-live resource to a reason. At the end of a ~6 min start-up run on `1cce2a32`: ``` x2w-retire held: view-refs=2297/4445110272(oldest 4374f) never-class:buffer=8178/551813120 never-class:dimension=4/262144 never-class:rt-ds-uav=14/200212480 view-refs-in-visible-heap=2297/4445110272 total=10493/5197398016 unattributed=0/0 ``` So about 4.4 GB of the retained textures are slot 133 class members that only live on because a descriptor in a shader-visible heap still names them, and the title never overwrites those slots. The oldest is 4374 frames old. I am trying a local follow-up: once the existing holds, flights and release fences allow the release, rewrite those descriptors (and their shim shadow/token entries) to null SRVs of the same dimension before releasing. A stale read would then see zeros, not freed memory. The fixture plan covers never-overwritten slots, a closed unsubmitted list that uses the slot, copied descriptors and fail-first mutants. If you are already on this, or would rather design it yourself, say so and I will stop. AI-assisted (Claude Code)
R0Y00 commented 2026-11-25 22:02:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T21:15:21Z.


The reason counter is useful. Please keep the counter experiment and its aggregate view-held count, and pause the rewrite-to-null variant. The current contract lets a live slot be rebound after the last guest Release, even after older queues have finished. The existing #2468 same-slot readback would legitimately change if that slot were rewritten. Slice 3a is already claimed here. A focused, opt-in attribution counter could be reviewed separately if it distinguishes view reference, pending recording and in-flight queue holds without changing reclamation.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174824250 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7174824250). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T21:15:21Z. --- The reason counter is useful. Please keep the counter experiment and its aggregate view-held count, and pause the rewrite-to-null variant. The current contract lets a live slot be rebound after the last guest Release, even after older queues have finished. The existing #2468 same-slot readback would legitimately change if that slot were rewritten. Slice 3a is already claimed here. A focused, opt-in attribution counter could be reviewed separately if it distinguishes view reference, pending recording and in-flight queue holds without changing reclamation.
SimSalabimse commented 2026-11-25 23:02:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-25T22:30:05Z.


Follow-up measurement (tip fb2f86ac, after account picker)

Environment: Windows 11 10.0.26200, RTX 4070 Ti driver 32.0.16.2135, FakeUser offline, xgameruntime.dll present under System32. Account picker advances (QueryApiImpl / providers proxied).

subst G: "<package root>"
.\tools\startup\run.ps1 `
  -Exe "<title>.exe" -DataDir "G:\" -BuildDir out\build\dev `
  -LogDir out\startup\av-tip-retest `
  -Seconds 600 -ContinueAsserts 1000 -Render -Translate -FakeUser -GpuMirror `
  -TraceApi -InputScript "20@90,4@120,4@180"

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.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176439269 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7176439269). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-25T22:30:05Z. --- ### Follow-up measurement (tip `fb2f86ac`, after account picker) Environment: Windows 11 `10.0.26200`, RTX 4070 Ti driver `32.0.16.2135`, FakeUser offline, `xgameruntime.dll` present under System32. Account picker advances (QueryApiImpl / providers proxied). ```powershell subst G: "<package root>" .\tools\startup\run.ps1 ` -Exe "<title>.exe" -DataDir "G:\" -BuildDir out\build\dev ` -LogDir out\startup\av-tip-retest ` -Seconds 600 -ContinueAsserts 1000 -Render -Translate -FakeUser -GpuMirror ` -TraceApi -InputScript "20@90,4@120,4@180" ``` **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: ```powershell $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. AI-assisted.
SimSalabimse commented 2026-11-25 23:02:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-25T22:30:26Z.


Tip measurement (build=fb2f86ac) — retire A/B after account picker

Same host past the account picker (-FakeUser, System32 xgameruntime.dll present). 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

.\tools\startup\run.ps1 `
  -Exe <run-dir>\<title>.exe `
  -DataDir <package-root> `
  -BuildDir out\build\dev `
  -LogDir out\startup\tip-oom-assert `
  -Seconds 400 `
  -ContinueAsserts 1000 `
  -Render -Translate -FakeUser -GpuMirror `
  -InputScript "4@70"
  • Eight Device::slot133(CreatePlacedResourceX?) … -> 0x8007000e not aliased
  • Twelve DirectStorage out of memory
  • No x2w-budget / x2w-retire lines
  • Stop: first-chance 0x80000003 at game_scarlett_master.exe+0x193e00f after 254.62 s with rax/rcx/rsi = 0x8007000e (title soft-assert on OOM)
  • Prior d3d12_xs.dll+0x1635a70 AV (build=381abc31) is gone on tip

With BUDGET + RELEASE_RETIRED + RELEASE_RETIRED_VIEWS + RETIRE_REASONS

$env:X2W_D3D12_BUDGET = "1"
$env:X2W_D3D12_RELEASE_RETIRED = "1"
$env:X2W_D3D12_RELEASE_RETIRED_VIEWS = "1"
$env:X2W_D3D12_RETIRE_REASONS = "1"
.\tools\startup\run.ps1 `
  -Exe <run-dir>\<title>.exe `
  -DataDir <package-root> `
  -BuildDir out\build\dev `
  -LogDir out\startup\tip-retire-oom `
  -Seconds 400 `
  -ContinueAsserts 1000 `
  -Render -Translate -FakeUser -GpuMirror `
  -InputScript "4@70"
  • 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176446549 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7176446549). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-25T22:30:26Z. --- ### Tip measurement (`build=fb2f86ac`) — retire A/B after account picker Same host past the account picker (`-FakeUser`, System32 `xgameruntime.dll` present). 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 ```powershell .\tools\startup\run.ps1 ` -Exe <run-dir>\<title>.exe ` -DataDir <package-root> ` -BuildDir out\build\dev ` -LogDir out\startup\tip-oom-assert ` -Seconds 400 ` -ContinueAsserts 1000 ` -Render -Translate -FakeUser -GpuMirror ` -InputScript "4@70" ``` - Eight `Device::slot133(CreatePlacedResourceX?) … -> 0x8007000e not aliased` - Twelve DirectStorage `out of memory` - No `x2w-budget` / `x2w-retire` lines - Stop: first-chance `0x80000003` at `game_scarlett_master.exe+0x193e00f` after **254.62 s** with `rax`/`rcx`/`rsi` = `0x8007000e` (title soft-assert on OOM) - Prior `d3d12_xs.dll+0x1635a70` AV (`build=381abc31`) is **gone** on tip #### With BUDGET + RELEASE_RETIRED + RELEASE_RETIRED_VIEWS + RETIRE_REASONS ```powershell $env:X2W_D3D12_BUDGET = "1" $env:X2W_D3D12_RELEASE_RETIRED = "1" $env:X2W_D3D12_RELEASE_RETIRED_VIEWS = "1" $env:X2W_D3D12_RETIRE_REASONS = "1" .\tools\startup\run.ps1 ` -Exe <run-dir>\<title>.exe ` -DataDir <package-root> ` -BuildDir out\build\dev ` -LogDir out\startup\tip-retire-oom ` -Seconds 400 ` -ContinueAsserts 1000 ` -Render -Translate -FakeUser -GpuMirror ` -InputScript "4@70" ``` - 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._
R0Y00 commented 2026-11-25 23:02:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T22:43:55Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176720661 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7176720661). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T22:43:55Z. --- 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 commented 2026-11-26 02:05:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-26T01:28:05Z.


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.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179801296 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7179801296). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T01:28:05Z. --- 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. AI-assisted (Claude Code).
R0Y00 commented 2026-11-26 02:05:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T01:41:42Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180031853 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7180031853). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:41:42Z. --- 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 commented 2026-11-26 02:05:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T01:48:19Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180149804 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7180149804). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:48:19Z. --- 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 commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T04:16:24Z.


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

  1. The rule #2679 enforces (git show 293e77f6, 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).
  2. 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 #2679's keep case.
  3. Empirical check. I temporarily re-applied only the source half of the #2579 revert and ran the merged #2679 fixture: it fails immediately at
    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

A. #2579 (reverted) B. #2679 (current) C. policy-gated eviction
Descriptor is disposable an owner until overwritten an owner, evictable under an explicit opt-in
Nulls a live slot yes, after release fences never yes, only when a documented policy says so
Memory descriptor-only textures freed the ~9 GB stays retained (intended) some memory back, bounded and lossy
Cost 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182449251 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7182449251). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T04:16:24Z. --- 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 1. **The rule #2679 enforces** (git show 293e77f6, 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). 2. **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 #2679's keep case. 3. **Empirical check.** I temporarily re-applied only the source half of the #2579 revert and ran the merged #2679 fixture: it fails immediately at 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 | | A. #2579 (reverted) | B. #2679 (current) | C. policy-gated eviction | |---|---|---|---| | Descriptor is | disposable | an owner until overwritten | an owner, evictable under an explicit opt-in | | Nulls a live slot | yes, after release fences | never | yes, only when a documented policy says so | | Memory | descriptor-only textures freed | the ~9 GB stays retained (intended) | some memory back, bounded and lossy | | Cost | 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.
R0Y00 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:37:59Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182763926 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7182763926). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T04:37:59Z. --- 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 commented 2026-11-26 05:02:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T04:57:25Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183050445 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7183050445). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T04:57:25Z. --- 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).
tedin7 commented 2026-11-26 12:04:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:02:08Z.


@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?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7191482201 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2379#issuecomment-7191482201). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T12:02:08Z. --- @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?
Sign in to join this conversation.
No labels
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.

Reference
R0Y00/Xbox2Windows#2371
No description provided.