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
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T14:23:51Z.
Commit or build
Upstream
mainat09551998, Release build.Summary
With
X2W_D3D12_BUDGET=1, a start-up run shows guest-released committed textures accumulating in theretainedcolumn until DXGI local usage is more than twice the local budget. Shortly after, the device is removed.release()insrc/startup_stubs/d3d12_xs_device.cppkeeps 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
Observed
x2w-budgetlines from one run (71 heartbeats):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 40reportedDEVICE REMOVED, reason 0x887a0005, first noticed after CommandQueue execute 35at 419 s and 348 s, followed byPresent failed 0x887a0005and every thread waiting until the timeout. Runs with-MemoryGiB 28stopped earlier onE_OUTOFMEMORYfromCreatePlacedResourceand 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).
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.
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
f555b535plus the prototype,X2W_D3D12_BUDGET=1.The prototype, behind an opt-in
X2W_D3D12_RELEASE_RETIRED=1, releases a resource's desktop object after its final guest release, once every shim-created queue has passed a fence signalled at that release. It covers committed resources from slots 27 and 127, and slot 133 textures and non-aliased buffers. Aliased placements, heaps and tiled address SRVs stay retained. The wrapper storage is kept. The resource is removed from the address index and the per-pointer caches before the desktop release.title_memoryresources)In the last run, 43,000 resources were freed (35.7 GB in total over the run), the process commit peak dropped from about 32 GB to 22.8 GB, and 15,500 frames were presented.
Source-built check (
startup_resource_retire_{warp,hardware}, plus_off_variants without the switch) on WARP and the RTX 3080: a release while the queue is held by an unsignalled fence wait is not freed until the gate is signalled, retained returns to the baseline afterwards, and a new slot 133 texture at the same title address finds only the new wrapper. Two mutations fail it: freeing without the fence condition, and skipping the address index removal.ctest --preset release --no-tests=error -R 'd3d12|budget|startup_draw|offscreen|startup_stubs|startup_resource_retire|capture|memory_srv|placed': 84 passed, 0 failed, 1 skipped (d3d12_xs_shim_heap_indexing, 77, also skipped without the change).Not established: multi-queue and multi-thread release races beyond the fixture, and a title that uses a resource after its final release (
Map,GetDescandGetGPUVirtualAddresswould then dereference a null desktop object).AI-assisted (Claude Code).
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.
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:
mainat7092683a, Release,X2W_D3D12_BUDGET=1.-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -MemoryGiB 32, warm cache, fresh storage.x2w-budgetheartbeatPlaced, upload, readback and heap stay flat, and
unmeasuredis 0.XMemMapPhysicalPagesScattermap-view failure with error 1455.0x800705af.-MemoryGiB 48the same input reaches the 600 s limit, and commit is still rising: 25.7 GB at 410 s, 32.0 at 470 s and 38.1 at 560 s.c374c7bfthis morning, the same post-confirmation phase peaked at 20 GB by 560 s and was levelling off. I haven't bisected which change since then increased the texture churn.When the
X2W_D3D12_RELEASE_RETIREDfixture and slice are published, I can rerun this matched input on the RX 9070 XT with the opt-in on and off, and report the budget columns and the end point.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T17:03:04Z.
Status, for anyone picking this up:
X2W_D3D12_RELEASE_RETIRED=1). It covers committed 2D textures from slot 27/127 without title memory, with list holds, submission fences and release-time fences, as requested above. The fixture covers the two-list, held-second-submission and discard cases, and 11 local mutants fail it. Please leave review comments on that PR. I keep pushing to its branch myself.texture retainedreached 7.6 GB and slice 1 released 0). This needs the proof that is still missing for the title-address index (resource_address_index/existing_memory_texture),texture_uploads,written_texturesand descriptor or view reuse, before anything there is freed.AI-assisted (Claude Code)
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T17:21:01Z.
Claiming Slice 2 (based on #2443 at
1ecd4cfc), extendingX2W_D3D12_RELEASE_RETIRED=1to slot 133 (device_place_resource_x) committed 2D textures withtitle_memory(keeping non-RT/DS/UAV, 1-sample,DEFAULTheap, and keeping slot 127__XMemAllocationHooks__resources excluded).Plan for the four Slice 2 requirements listed above:
resource_address_index/existing_memory_texture: Erase(title_memory, wrapper)fromresource_address_index()undernote_lockwhendrain_retired_resources()claims the retired wrapper (refsCAS0 -> retired_refs), keepingresource_infos()intact. Verify same-address slot 133 + slot 70existing_memory_texture()reuse andX2W_RESOURCE_INDEX_CHECK=1.texture_uploads/pending_gpu_writes/list_copy_texture: Fixlist_copy_texture.inlto checktitle_memory(rather than!retire_when_idle) so retiring slot 133 textures still upload onCopyTextureRegion; synchronizetexture_uploads()inlist_copy.inl/list_copy_texture.inlunderdraw_lock; eraserealfromtexture_uploads()underdraw_lockindrain_retired_resources()beforereal->Release().written_textures: Snapshotwritten_textures()[addr].generationat final guestRelease()and clear stale entries on retirement only when the generation is unchanged and notiled_address_srvexists ataddr(preserving any newer XG / slot-70 write at the same address while preventing stalebc7_width/desktop_rowsfrom skipping a later texture's upload).view_slot<18>SRVs +draw_translated): Trackshadow_slotdescriptor references innote_view/note_copy/ descriptor-heaprelease()(falling back toretire_leave_classif a view targets an untracked slot or slots 19/20/21), and hold bound SRV textures indraw_translatedviaretire_hold(list, resource). Existing#2443controls (including a resource whose SRV remains live in a descriptor heap) stay retained; once overwritten/freed and all lists/fences complete, the slot 133 texture retires.Will build and verify on WARP and physical hardware (GTX 1660 SUPER) with source-built fixtures + fail-first mutations, and open a PR stacked on #2443.
AI-assisted (Gemini).
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_texturesstalebc7_widthcleanup, and tracked slot-18 SRV descriptor reuse.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):E_OUTOFMEMORYin slot 133 placementSo slot 133 title-memory textures are the class that matters in that workload. The v2 branch is
JB2WIN:experimental/release-retired-v2for testers only. It is not proposed for merge.AI-assisted (Claude Code)
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 onmain673d8e4a). I used one release build for both arms, with onlyX2W_D3D12_RELEASE_RETIREDdiffering.Host:
X2W_D3D12_BUDGET=1andX2W_D3D12_RENDER=1(run.ps1 -Render), 600 s.0x8007000e/ device removedmain673d8e4a)System commit was 25.5 GiB before the runs and 24.4 GiB 10 s after each exit. Neither arm left a commit increase behind.
This matches the RTX 3080 table above: on AMD too, slot 133 committed stand-ins with title memory are the class that grows, and freeing them after the release-time fences keeps the run inside the budget. The off arm also reproduces the ~495 s crash at this cap that I reported earlier on
7092683a.Limits:
I'll run the same input on #2468 once its next head (the S3 fix) is up.
AI-assisted; runs executed locally, aggregates only.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T19:49:16Z.
Slice 2 is on
mainin #2468 (6b9fb9d9). The final Release candidate passed all 12 focused WARP and RTX 4060 Laptop retirement tests. The same-address control fails if the older descriptor's view reference is ignored. @MasterDomino, your offered matched run is now unblocked. Keep the executable, saved profile, cache, job cap and observation interval identical, flip onlyX2W_D3D12_RELEASE_RETIRED, and report retained bytes/count, DXGI budget/peak, first failure or timeout, and the last visible stage. The earlier prototype run remains separate evidence.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:
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.
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".
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:
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.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.
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(andrun.sh) setX2W_D3D12_RELEASE_RETIRED=1for start-up runs, the same way it already setsX2W_AUDIO_PERMISSIVE,X2W_D3D12_PERMISSIVEand 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=0way 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 noE_OUTOFMEMORYand 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)
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.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T20:12:58Z.
@R0Y00, here is the matched run you asked for, on
main6b9fb9d9(#2468 merged).Setup:
X2W_D3D12_RELEASE_RETIREDdiffers.X2W_D3D12_BUDGET=1,run.ps1 -Render, and a 600 s observation window.0x8007000e0x8007000e/ device removedRetention over time (budget heartbeats about 5 s apart, retained bytes / count):
Plainly: in this pair slice 2 removed the out-of-memory failure within the 600 s window, but it does not remove the blocker.
d03296d3failed at 573.8 s under the same cap, so surviving to 600 s is marginal, not a fix.e29b1a7b, which has the same slice 2 code, also reached the timeout, with 9.14 GB retained.About the uniform-color frame: both earlier switch-on runs ended at 600 s on the same rendered sequence as the off arm, so this capture differs. Translation activity was comparable: 763,721 translated draws and 72 translated programs on this arm, against 781,344 and 71 at
e29b1a7b. I can't attribute the uniform-color frame from one capture and am only recording it.What's left, which as far as I can see no issue or PR covers yet (a "slice 3"):
Does anyone (@JB2WIN, @triggered02) already plan this? If not, I can open an issue for it.
Limits: one run per arm, and these are local executable runs, not source-built fixtures. I checked aggregate counters only; I didn't verify per resource. No addresses, paths or captures are posted.
AI-assisted; runs executed locally.
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 on1cce2a32: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)
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.
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 driver32.0.16.2135, FakeUser offline,xgameruntime.dllpresent under System32. Account picker advances (QueryApiImpl / providers proxied).Without retire switches (
build=fb2f86ac): earlier null AV ind3d12_xson381abc31is gone. Stop is a title soft-assert (0x80000003) at ~255 s withrax/rcx=0x8007000e. Immediately before that: severalCreatePlacedResourceXtexture creates return0x8007000e, plus multiple DirectStorageout of memorylines.With
#2579opt-ins:Budget/retire heartbeats appear (
x2w-budget/x2w-retire held: never-class:…). Failure mode changes: second-chance C++ exception (0xe06d7363) ~254 s with stack dominated byxmem.dll(not the title int3). CreatePlacedE_OUTOFMEMORYcounts were not clearly eliminated.Not claiming this proves the device-removal path in the OP; it is the same chapter (post-picker resource pressure / retained desktop objects) measured on another host after FakeUser sign-in works.
Refs #2379. Part of #870 only as startup-runtime measurement.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-25T22:30:26Z.
Tip measurement (
build=fb2f86ac) — retire A/B after account pickerSame host past the account picker (
-FakeUser, System32xgameruntime.dllpresent). Title-neutral; no game files.Environment: Windows 11 Pro 10.0.26200.8655 · NVIDIA GeForce RTX 4070 Ti · driver 32.0.16.2135 · tip stand-ins stamped
D3D12XboxCreateDevice … build=fb2f86ac.Without retire / budget switches
Device::slot133(CreatePlacedResourceX?) … -> 0x8007000e not aliasedout of memoryx2w-budget/x2w-retirelines0x80000003atgame_scarlett_master.exe+0x193e00fafter 254.62 s withrax/rcx/rsi=0x8007000e(title soft-assert on OOM)d3d12_xs.dll+0x1635a70AV (build=381abc31) is gone on tipWith BUDGET + RELEASE_RETIRED + RELEASE_RETIRED_VIEWS + RETIRE_REASONS
0x8007000e: still 8 (not reduced)out of memory: still 12 (not reduced)x2w-budget/x2w-retire: 35 heartbeats each (switches live); latex2w-retire held:still shows never-class held resources (~100–137 MiB)0xe06d7363atKernelBase.dllafter ~253.66 s, return-address stack dominated byxmem.dll(not the titleint3OOM soft-assert)Takeaway
Opt-in retire (#2579 path) is active here but does not clear the CreatePlaced / DStorage OOM prelude on this tip host run; it does change the debugger stop to an
xmem-dominated C++ exception. Filing as a comment on this issue rather than a duplicate tracker.AI-assisted analysis of uploaded stderr/finished logs.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-26T01:28:05Z.
A matched startup pair on
mainatf4c6998a(RTX 4090, driver 32.0.16.1088, 20 GiB job cap, same profile, cache and scripted input in both arms) with and withoutX2W_D3D12_RELEASE_RETIRED=1plusX2W_D3D12_RELEASE_RETIRED_VIEWS=1:E_OUTOFMEMORYOn this 24 GB card local usage stayed under budget in both arms, so neither run reproduced the device removal reported here. The release kept retained textures flat, and the run lasted about 85 s longer before process commit reached the 20 GiB job cap. At the stop,
X2W_D3D12_RETIRE_REASONS=1still listed 484 MiB held, almost all outside the release class: 5,163 buffers (339 MiB) and 11 render-target, depth or UAV resources (144 MiB). The commit timeline and the untracked part are in #1199.AI-assisted (Claude Code).
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.
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.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
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 whenetire_view_refs == 0 and must never rewrite a live descriptor. X2W_D3D12_RELEASE_RETIRED_VIEWS is now a legacy diagnostic that logs clearing is disabled (d3d12_xs_device.cpp:829-837).
etire_view_refs > 0 cannot hold: every one of those refs exists because a materialized record sits in a live shadow cell, and cells are cleared only by overwrite, CopyDescriptors*, or the heap wrapper's final Release. So the condition collapses to iew_refs == 0, which the drain already frees � my step would be dead code; the only remaining "win" state is observably identical to #2679's keep case.
ests/startup_resource_retire_views.cpp:423 � FAIL: T1 retired before its slot was overwritten (the first drain after the guest Release). Worktree restored, branch clean, nothing shipped.
The three designs
What I am asking
3b is not code that can be merged as-is; it is a semantics decision about who owns a released-but-still-named texture. If you want the ~9 GB back, design C is the only honest route and it needs (a) your explicit approval to reverse #2679 for an opt-in path, (b) a switch documented as lossy ("a descriptor naming a released resource may read null after retirement"), (c) a fixture that forks the keep cases instead of contradicting them. If you prefer B, then slice 3a is the end of this series and #2379 should record the retention as intended behavior with the numbers.
Either answer is fine � I am not shipping the reverted behavior without it. 3a is in review as #2719.
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.
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_classonly on untracked destinations) and keepX2W_D3D12_RELEASE_RETIRED_VIEWSdiagnostic-only.I will record the ~9 GB retained pressure from the diagnostic run alongside the live-slot, recording-hold, and in-flight breakdown counters in
docs/experiments.md(either on #2719 if helpful or in a clean docs follow-up after #2719 lands).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
CreateCommittedResourcefor a placed texture returnsE_OUTOFMEMORY, the guest gets a failed creation, and a title can go on to use a resource that does not exist. #2773 should push that point much further out, and #2379 design B covers the release side. Neither makes the creation itself survive a full card.We would like to take a small, separate fallback on top of #2773: when the default-heap creation fails with
E_OUTOFMEMORY, retry once in a custom heap in system memory (D3D12_HEAP_TYPE_CUSTOM,D3D12_MEMORY_POOL_L0), count it inx2w_budgetas nonlocal, and log one line per fallback. It would be slower to sample but would not fail. It would be opt-in first, with a WARP + hardware readback test that forces the first creation to fail and checks the fallback texture samples the same texels.It touches the same creation path as #2773, so we would wait for #2773 to land and build on it, or fit in however you prefer. Is that fine with you, or is it already on your list?