startup-runtime: physical-page sections exhaust system commit before loading completes #1192

Open
opened 2026-11-24 03:29:32 +00:00 by denn0x · 40 comments
denn0x commented 2026-11-24 03:29:32 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:29:32Z.


On a 32 GB machine with a 13 GB page file and an ordinary desktop open (about 12 GB of commit free), a startup run cannot get past loading. Allocations fail with ERROR_COMMITMENT_LIMIT (1455) and ERROR_NOT_ENOUGH_MEMORY (8), then the process ends.

Observed

  • With a 14 GiB job cap: XMemMapPhysicalPagesScatter fails with 1455, CreatePlacedResourceX returns E_OUTOFMEMORY, then the DirectStorage worker hits a stack overflow (0xc00000fd) while handling the std::bad_alloc (about 280 s, during loading).
  • With a 10 GiB cap: XMemMapPhysicalPages fails with 1455 for single pages at 73 s, before the menus.
  • Earlier runs reached loading with a 20 GiB cap on the same machine when more commit was free.

Why it costs so much: src/xmem_mapped_pages.cpp backs every 64 KiB physical page with its own pagefile-backed section, created as SEC_COMMIT, so each page counts against commit as soon as it is first mapped or written. Pages the executable allocates and maps but never touches still count in full.

Proposed

  1. Report peak commit and the number of live physical-page sections in the startup heartbeat, so runs can be compared.
  2. Look at sections reserved with SEC_RESERVE and committed on first touch, or batch pages into larger sections, so untouched pages do not count against commit.
  3. The DirectStorage worker should not overflow its stack on an allocation failure: handle bad_alloc without extra work on the faulting stack, or give the worker a larger stack.

Done when a run reaches the same point as today with less peak commit (numbers before and after), and an allocation failure in the worker fails the request instead of ending the process.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573963540 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:29:32Z. --- On a 32 GB machine with a 13 GB page file and an ordinary desktop open (about 12 GB of commit free), a startup run cannot get past loading. Allocations fail with `ERROR_COMMITMENT_LIMIT` (1455) and `ERROR_NOT_ENOUGH_MEMORY` (8), then the process ends. **Observed** - With a 14 GiB job cap: `XMemMapPhysicalPagesScatter` fails with 1455, `CreatePlacedResourceX` returns `E_OUTOFMEMORY`, then the DirectStorage worker hits a stack overflow (0xc00000fd) while handling the `std::bad_alloc` (about 280 s, during loading). - With a 10 GiB cap: `XMemMapPhysicalPages` fails with 1455 for single pages at 73 s, before the menus. - Earlier runs reached loading with a 20 GiB cap on the same machine when more commit was free. **Why it costs so much:** `src/xmem_mapped_pages.cpp` backs every 64 KiB physical page with its own pagefile-backed section, created as `SEC_COMMIT`, so each page counts against commit as soon as it is first mapped or written. Pages the executable allocates and maps but never touches still count in full. **Proposed** 1. Report peak commit and the number of live physical-page sections in the startup heartbeat, so runs can be compared. 2. Look at sections reserved with `SEC_RESERVE` and committed on first touch, or batch pages into larger sections, so untouched pages do not count against commit. 3. The DirectStorage worker should not overflow its stack on an allocation failure: handle `bad_alloc` without extra work on the faulting stack, or give the worker a larger stack. **Done when** a run reaches the same point as today with less peak commit (numbers before and after), and an allocation failure in the worker fails the request instead of ending the process. AI-assisted (Claude Code).
denn0x commented 2026-11-24 06:50:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:41:10Z.


Tried one direction locally: physical-page sections created with SEC_RESERVE, each page committed on first touch by a vectored exception handler, and explicitly before the stand-ins' own writes. The placed-resource check also accepts mapped views that are still reserved.

  • Commit charge at the title-screen stage: the executable's private commit was 6.35 GB, and only 32 MiB of physical pages were committed on touch in the first 66 s. So most mapped pages are never touched early on.
  • But loading stalls: DirectStorage stops at about 4,500 requests (20 s), the screen stays black, and frames keep presenting at 30 fps. No API failure is logged. Without the change, the same build issues the next requests from other queues at that point.
  • Not established: what the executable does with a reserved page that no user-mode fault reveals (kernel-mode reads, VirtualQuery state checks, or something else). Anyone taking this route needs to answer that first.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121325672 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7121325672). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:41:10Z. --- Tried one direction locally: physical-page sections created with `SEC_RESERVE`, each page committed on first touch by a vectored exception handler, and explicitly before the stand-ins' own writes. The placed-resource check also accepts mapped views that are still reserved. - Commit charge at the title-screen stage: the executable's private commit was 6.35 GB, and only 32 MiB of physical pages were committed on touch in the first 66 s. So most mapped pages are never touched early on. - But loading stalls: DirectStorage stops at about 4,500 requests (20 s), the screen stays black, and frames keep presenting at 30 fps. No API failure is logged. Without the change, the same build issues the next requests from other queues at that point. - Not established: what the executable does with a reserved page that no user-mode fault reveals (kernel-mode reads, `VirtualQuery` state checks, or something else). Anyone taking this route needs to answer that first. AI-assisted (Claude Code).
denn0x commented 2026-11-24 06:50:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T04:47:20Z.


More measurements: an address-space walk of the running executable every 10 s. Machine: 32 GB RAM, 44 GB commit limit, 11.3 GB of commit free before launch.

  • Mapped: about 5.2 GB of physical-page sections. The walk shows 10.4 GB because the GPU-view mirror maps each section twice; the commit is counted once.
  • Private: 11.2 GB when the run ran out of commit, 188 s into loading.
    • Four pools totalling 4.5 GB are committed up front by XMemVirtualAlloc (0.55–2.2 GB each, one of them write-combined).
    • The rest is write-combined graphics allocations (about 5.7 GB together with the WC pool) and ordinary heap memory.
  • System free commit fell to 0.35 GB. The next allocation failed (std::bad_alloc in the storage stand-in, or a null from the executable).

Experiment: commit the four pools on first touch. They are reserved, and a vectored handler commits 64 KiB on first access. Placed buffers on them commit their span at creation.

  • Fewer than 1 GB of the pools is touched early.
  • Placed buffers that span most of a pool commit it anyway, and other allocations keep growing.
  • The run ran out of commit even earlier (37 s), so this doesn't fix the problem. It stays a local experiment.

Conclusion so far: loading needs roughly 14–16 GB of commit, which is in line with the ~13.5 GB a title gets on the console. On a 32 GB machine that leaves room only if other processes use little memory or the pagefile is larger. Shrinking the footprint needs real changes, for example not mapping the GPU-view mirror for sections the GPU never reads. That is worth a separate experiment.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7122339693 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7122339693). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T04:47:20Z. --- More measurements: an address-space walk of the running executable every 10 s. Machine: 32 GB RAM, 44 GB commit limit, 11.3 GB of commit free before launch. - **Mapped:** about 5.2 GB of physical-page sections. The walk shows 10.4 GB because the GPU-view mirror maps each section twice; the commit is counted once. - **Private:** 11.2 GB when the run ran out of commit, 188 s into loading. - Four pools totalling 4.5 GB are committed up front by XMemVirtualAlloc (0.55–2.2 GB each, one of them write-combined). - The rest is write-combined graphics allocations (about 5.7 GB together with the WC pool) and ordinary heap memory. - **System free commit** fell to 0.35 GB. The next allocation failed (`std::bad_alloc` in the storage stand-in, or a null from the executable). **Experiment: commit the four pools on first touch.** They are reserved, and a vectored handler commits 64 KiB on first access. Placed buffers on them commit their span at creation. - Fewer than 1 GB of the pools is touched early. - Placed buffers that span most of a pool commit it anyway, and other allocations keep growing. - The run ran out of commit even earlier (37 s), so this doesn't fix the problem. It stays a local experiment. **Conclusion so far:** loading needs roughly 14–16 GB of commit, which is in line with the ~13.5 GB a title gets on the console. On a 32 GB machine that leaves room only if other processes use little memory or the pagefile is larger. Shrinking the footprint needs real changes, for example not mapping the GPU-view mirror for sections the GPU never reads. That is worth a separate experiment.
triggered02 commented 2026-11-24 06:50:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:14:18Z.


Claiming the heartbeat/observability slice (item 1 in the issue): report peak commit and the number of live physical-page sections in the startup heartbeat, so runs can be compared.

Scope: read-only accounting added to the existing heartbeat line; no allocator or mapping behaviour change (that is denn0x's SEC_RESERVE direction, not this one). Synthetic fixture check only; no game image.

Verification plan: extend the heartbeat test with a synthetic fixture that creates and releases physical-page sections plus a known peak-commit delta, assert both counters appear and track the fixture in both directions, then run the neighbouring startup tests.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7123726797 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7123726797). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:14:18Z. --- Claiming the heartbeat/observability slice (item 1 in the issue): report **peak commit** and the **number of live physical-page sections** in the startup heartbeat, so runs can be compared. Scope: read-only accounting added to the existing heartbeat line; no allocator or mapping behaviour change (that is denn0x's SEC_RESERVE direction, not this one). Synthetic fixture check only; no game image. Verification plan: extend the heartbeat test with a synthetic fixture that creates and releases physical-page sections plus a known peak-commit delta, assert both counters appear and track the fixture in both directions, then run the neighbouring startup tests. AI-assisted (Claude Code).
triggered02 commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:22:31Z.


Item 1 (heartbeat/observability) is implemented in #1270.

The DirectStorage heartbeat now carries commit peak=<MiB> current=<MiB>, live physical-page sections=<n>, and it re-reports when either memory value changes even if the request counters are static, so a stalled load still shows what it holds. The section count comes from a new experimental x2w_xmem_page_stats export in xmem.dll; no allocator or mapping behaviour changed, so this is independent of the SEC_RESERVE direction.

Source-built checks: xmem_page_stats drives the snapshot through a grant, two mapped pages, unmapping and release, plus a page-token write that has no view; startup_heartbeat_commit starts the real heartbeat in a synthetic process with two mapped sections and checks the reported count and peak against GetProcessMemoryInfo. Both fail on the previous build for the expected reason and pass now; neighbouring xmem/era/stub tests pass. Exact output is in the PR.

Still open for a run with the package: the reported peak commit and section count of a real startup run, for before/after comparison.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7123867436 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7123867436). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:22:31Z. --- Item 1 (heartbeat/observability) is implemented in #1270. The DirectStorage heartbeat now carries `commit peak=<MiB> current=<MiB>, live physical-page sections=<n>`, and it re-reports when either memory value changes even if the request counters are static, so a stalled load still shows what it holds. The section count comes from a new experimental `x2w_xmem_page_stats` export in `xmem.dll`; no allocator or mapping behaviour changed, so this is independent of the `SEC_RESERVE` direction. Source-built checks: `xmem_page_stats` drives the snapshot through a grant, two mapped pages, unmapping and release, plus a page-token write that has no view; `startup_heartbeat_commit` starts the real heartbeat in a synthetic process with two mapped sections and checks the reported count and peak against `GetProcessMemoryInfo`. Both fail on the previous build for the expected reason and pass now; neighbouring xmem/era/stub tests pass. Exact output is in the PR. Still open for a run with the package: the reported peak commit and section count of a real startup run, for before/after comparison. AI-assisted (Claude Code).
triggered02 commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:34:48Z.


The observability from #1270 is now in a branch, and here are the first real-run numbers for this issue — they confirm the scale of item 2.

Offline run of the title to a 120 s timeout (no title file or log attached), with the heartbeat reporting commit and live physical-page sections for the first time:

heartbeat 10 s: commit peak=5482 MiB current=5290 MiB, live physical-page sections=102736
heartbeat 20 s: commit peak=6453 MiB current=6453 MiB, live physical-page sections=102736
heartbeat 30 s: commit peak=6841 MiB current=6841 MiB, live physical-page sections=102736
heartbeat 40 s: commit peak=7697 MiB current=7697 MiB, live physical-page sections=102736
heartbeat 50 s: commit peak=7718 MiB current=7718 MiB, live physical-page sections=102736
heartbeat 60 s: commit peak=7739 MiB current=7739 MiB, live physical-page sections=102736

102,736 live physical-page sections. At 64 KiB per page that is about 6.4 GiB of backing, which matches the ~7.7 GiB of peak commit the same run reached. The section count is flat from 10 s onward while commit keeps rising, so the growth is the mapping/commit of pages that were already section-backed, not new sections — consistent with "each page created as SEC_COMMIT counts against commit as soon as it is first mapped or written".

That gives item 2 a concrete baseline to measure against (peak commit and section count before/after any change to the backing strategy), and it makes the earlier 1455 / ERROR_NOT_ENOUGH_MEMORY failures much easier to attribute: a run that fails needs roughly 7.7 GiB of commit just for the physical-page backing.

I have not attached logs, dumps or anything containing addresses from the executable — these are numbers about the stand-in's own accounting.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124078377 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7124078377). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:34:48Z. --- The observability from #1270 is now in a branch, and here are the first real-run numbers for this issue — they confirm the scale of item 2. Offline run of the title to a 120 s timeout (no title file or log attached), with the heartbeat reporting commit and live physical-page sections for the first time: ``` heartbeat 10 s: commit peak=5482 MiB current=5290 MiB, live physical-page sections=102736 heartbeat 20 s: commit peak=6453 MiB current=6453 MiB, live physical-page sections=102736 heartbeat 30 s: commit peak=6841 MiB current=6841 MiB, live physical-page sections=102736 heartbeat 40 s: commit peak=7697 MiB current=7697 MiB, live physical-page sections=102736 heartbeat 50 s: commit peak=7718 MiB current=7718 MiB, live physical-page sections=102736 heartbeat 60 s: commit peak=7739 MiB current=7739 MiB, live physical-page sections=102736 ``` **102,736 live physical-page sections.** At 64 KiB per page that is about 6.4 GiB of backing, which matches the ~7.7 GiB of peak commit the same run reached. The section count is flat from 10 s onward while commit keeps rising, so the growth is the mapping/commit of pages that were already section-backed, not new sections — consistent with "each page created as SEC_COMMIT counts against commit as soon as it is first mapped or written". That gives item 2 a concrete baseline to measure against (peak commit and section count before/after any change to the backing strategy), and it makes the earlier 1455 / ERROR_NOT_ENOUGH_MEMORY failures much easier to attribute: a run that fails needs roughly 7.7 GiB of commit just for the physical-page backing. I have not attached logs, dumps or anything containing addresses from the executable — these are numbers about the stand-in's own accounting.
R0Y00 commented 2026-11-24 22:01:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T21:40:54Z.


#1756 is on main at 3920220f. The exact Windows Release candidate passed xmem_slab_slots, xmem_page_stats, xmem_shim_mapped_pages and xmem_shim_page_runs (4/4). For comparison runs, the new counters separate open slabs from used and free slots. Freeing a grant returns slots to the allocator. The committed slabs stay open, so the memory-reduction goal remains open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7145249845 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7145249845). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T21:40:54Z. --- #1756 is on main at 3920220f. The exact Windows Release candidate passed xmem_slab_slots, xmem_page_stats, xmem_shim_mapped_pages and xmem_shim_page_runs (4/4). For comparison runs, the new counters separate open slabs from used and free slots. Freeing a grant returns slots to the allocator. The committed slabs stay open, so the memory-reduction goal remains open.
R0Y00 commented 2026-11-25 01:01:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:12:33Z.


#1958 is on main at 5d63a269. Six Windows Release checks passed, including an injected commitment failure that leaves the reservation and slot counts unchanged and allows the same grant to be mapped on retry. In the source-built 16-page comparison, the system commit delta was 256 MiB on the eager baseline and 1 MiB on the lazy candidate.

For the next application comparison, record peak and current commit, live pages and the first stopping condition on the same bounded startup window with identical settings. Please post aggregate counters only. The source-built comparison does not establish a later application startup boundary.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147138962 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7147138962). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T23:12:33Z. --- #1958 is on main at 5d63a269. Six Windows Release checks passed, including an injected commitment failure that leaves the reservation and slot counts unchanged and allows the same grant to be mapped on retry. In the source-built 16-page comparison, the system commit delta was 256 MiB on the eager baseline and 1 MiB on the lazy candidate. For the next application comparison, record peak and current commit, live pages and the first stopping condition on the same bounded startup window with identical settings. Please post aggregate counters only. The source-built comparison does not establish a later application startup boundary.
MasterDomino commented 2026-11-25 07:01:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T06:27:42Z.


Two data points from a 64 GB host: Windows 11 build 26300, RX 9070 XT, system-managed page file at its 116 GiB ceiling, so a commit limit of about 180 GB. Counts only.

1. Process commit once a run gets past the slot 148 stop

main at c374c7bf (with #2216), Release, -MemoryGiB 32, the post-confirmation input. The run went to the 600 s limit instead of stopping at the builder. The startup heartbeat (#1270) reported:

Heartbeat Commit peak / current (MiB) Live physical-page sections
10 s 11,217 / 11,217 113,538
250 s 11,678 / 11,646 113,538
360 s 18,707 / 18,696 113,538
460 s 19,785 / 19,645 113,538
580 s 20,035 / 20,029 113,538
  • Before #2216: runs that stopped at about 290 s peaked at 12.1–16.3 GB.
  • After the stop point: past it, process commit grows about 8 GB during the post-confirmation load while the section count stays the same. So the growth is in private commit, not in physical-page sections.

2. System commit stayed exhausted after every process had exited (cause unknown)

At 06:56, during that run, Windows logged Resource-Exhaustion-Detector event 2004 (low virtual memory). Agents were running D3D12 test suites at the same time, including #1942's and #2218's fixtures, which create 256 MiB pagefile-backed sections and open existing heaps over them. The event repeated at intervals until 07:19.

After the title process and every test process had ended:

  • Committed bytes: stayed at 179.7 GB of a 180.0 GB limit, for at least 45 minutes.
  • Process page-file bytes: about 15 GB across all processes, the largest 2.1 GB.
  • Page file in use: 91 MB.
  • GPU adapter committed memory: under 0.5 GB.

The event's own "top consumers" list showed only ordinary desktop processes (2.3, 1.1 and 1.0 GB). So about 160 GB stayed committed with no process accounting for it, and builds then failed with C1060 compiler is out of heap space.

I haven't identified the holder, and I can't tell yet whether the title run, the section and heap fixtures, or something outside this project left it behind. It may be a separate problem from the per-run cost this issue tracks: commit that a run or fixture leaves behind after its process exits. After a restart I'll measure it in isolation:

  • system committed bytes before, during and after one 600 s run on an otherwise idle host;
  • the same around one batch of the existing-heap fixtures.

I'll report the deltas here. If a run or fixture leaves commit behind once its process has exited, that should probably get its own issue.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7154813689 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7154813689). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T06:27:42Z. --- Two data points from a 64 GB host: Windows 11 build 26300, RX 9070 XT, system-managed page file at its 116 GiB ceiling, so a commit limit of about 180 GB. Counts only. ### 1. Process commit once a run gets past the slot 148 stop `main` at `c374c7bf` (with #2216), Release, `-MemoryGiB 32`, the post-confirmation input. The run went to the 600 s limit instead of stopping at the builder. The startup heartbeat (#1270) reported: | Heartbeat | Commit peak / current (MiB) | Live physical-page sections | |---|---|---| | 10 s | 11,217 / 11,217 | 113,538 | | 250 s | 11,678 / 11,646 | 113,538 | | 360 s | 18,707 / 18,696 | 113,538 | | 460 s | 19,785 / 19,645 | 113,538 | | 580 s | 20,035 / 20,029 | 113,538 | - **Before #2216:** runs that stopped at about 290 s peaked at 12.1–16.3 GB. - **After the stop point:** past it, process commit grows about 8 GB during the post-confirmation load while the section count stays the same. So the growth is in private commit, not in physical-page sections. ### 2. System commit stayed exhausted after every process had exited (cause unknown) At 06:56, during that run, Windows logged Resource-Exhaustion-Detector event 2004 (low virtual memory). Agents were running D3D12 test suites at the same time, including #1942's and #2218's fixtures, which create 256 MiB pagefile-backed sections and open existing heaps over them. The event repeated at intervals until 07:19. After the title process and every test process had ended: - **Committed bytes:** stayed at 179.7 GB of a 180.0 GB limit, for at least 45 minutes. - **Process page-file bytes:** about 15 GB across all processes, the largest 2.1 GB. - **Page file in use:** 91 MB. - **GPU adapter committed memory:** under 0.5 GB. The event's own "top consumers" list showed only ordinary desktop processes (2.3, 1.1 and 1.0 GB). So about 160 GB stayed committed with no process accounting for it, and builds then failed with `C1060 compiler is out of heap space`. I haven't identified the holder, and I can't tell yet whether the title run, the section and heap fixtures, or something outside this project left it behind. It may be a separate problem from the per-run cost this issue tracks: commit that a run or fixture leaves behind after its process exits. After a restart I'll measure it in isolation: - system committed bytes before, during and after one 600 s run on an otherwise idle host; - the same around one batch of the existing-heap fixtures. I'll report the deltas here. If a run or fixture leaves commit behind once its process has exited, that should probably get its own issue. AI-assisted.
MasterDomino commented 2026-11-25 07:01:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T06:31:51Z.


Follow-up on the retained commit, read live on the same host before any restart. Read-only, through NtQuerySystemInformation.

  • System performance information (class 2): committed 179.51 GiB of a 179.98 GiB limit, which matches \Memory\Committed Bytes. Shared committed: 158.55 GiB.
  • It isn't RAM or the page file: 42.8 GiB of RAM is available and the page file holds 91 MB. So the retained part is pagefile-backed section commit whose pages are neither resident nor written out.
  • Kernel buffers are small: locked MDL pages 0.49 GiB, paged and nonpaged pool 5 GiB together.
  • No user-mode owner (handle table, class 64):
    • There are 3,170 section handles system wide, ordinary desktop counts. The largest holder is csrss with 277. A startup run alone creates over 113,000 physical-page sections.
    • No process ID owns handles without appearing in the process list, so no process is stuck in termination.
    • No process has unexplained mapped views.

So about 159 GiB of section objects are kept alive by references from kernel mode only.

Hypothesis, not yet tested: D3D12 heaps opened over pagefile-backed sections and their views, with OpenExistingHeapFromFileMapping and OpenExistingHeapFromAddress on MEM_MAPPED views.

  • While such a heap lives, the kernel pins the view. We measured this in #1942 and #2218: XMem's unmap of the view fails with error 87 until the heap is released.
  • If that reference outlives the process, the section stays committed until reboot. That could happen especially when the process is terminated or times out with the heap alive, as the fixtures and the startup wrapper do. The wrappers live for the process.
  • The fixtures that do this (unified_buffer_paths, vm_page_provenance, and the opt-in linear_buffer_backing share path) were run many times on this host today, alongside the startup runs.
  • I can't test it now: with 0.3 GB of commit free, a 256 MiB section can't even be created.

Planned bisect after the restart, on an idle host: for one suspect at a time, record shared committed pages before, at peak, at process exit and 10 s later.

  • unified_buffer_paths on WARP and hardware, run to completion;
  • the same terminated mid-run, the way a CTest TIMEOUT kills it;
  • vm_page_provenance_hardware;
  • the #2218 share path;
  • one 600 s startup run, separately.

A probe that leaves shared commit behind after its process has exited identifies the leaking operation. If it's the existing-heap path, the fixes are in our control: release heaps before exit and never leave them to process teardown, avoid opening heaps over views in fixtures that can be killed, and add a commit check to the long-running tests. I'll post the table here.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7154885473 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7154885473). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T06:31:51Z. --- Follow-up on the retained commit, read live on the same host before any restart. Read-only, through `NtQuerySystemInformation`. - **System performance information (class 2):** committed 179.51 GiB of a 179.98 GiB limit, which matches `\Memory\Committed Bytes`. **Shared committed: 158.55 GiB.** - **It isn't RAM or the page file:** 42.8 GiB of RAM is available and the page file holds 91 MB. So the retained part is pagefile-backed section commit whose pages are neither resident nor written out. - **Kernel buffers are small:** locked MDL pages 0.49 GiB, paged and nonpaged pool 5 GiB together. - **No user-mode owner** (handle table, class 64): - There are 3,170 section handles system wide, ordinary desktop counts. The largest holder is `csrss` with 277. A startup run alone creates over 113,000 physical-page sections. - No process ID owns handles without appearing in the process list, so no process is stuck in termination. - No process has unexplained mapped views. So about 159 GiB of section objects are kept alive by references from kernel mode only. **Hypothesis, not yet tested:** D3D12 heaps opened over pagefile-backed sections and their views, with `OpenExistingHeapFromFileMapping` and `OpenExistingHeapFromAddress` on `MEM_MAPPED` views. - While such a heap lives, the kernel pins the view. We measured this in #1942 and #2218: XMem's unmap of the view fails with error 87 until the heap is released. - If that reference outlives the process, the section stays committed until reboot. That could happen especially when the process is terminated or times out with the heap alive, as the fixtures and the startup wrapper do. The wrappers live for the process. - The fixtures that do this (`unified_buffer_paths`, `vm_page_provenance`, and the opt-in `linear_buffer_backing` share path) were run many times on this host today, alongside the startup runs. - I can't test it now: with 0.3 GB of commit free, a 256 MiB section can't even be created. **Planned bisect after the restart, on an idle host:** for one suspect at a time, record shared committed pages before, at peak, at process exit and 10 s later. - `unified_buffer_paths` on WARP and hardware, run to completion; - the same terminated mid-run, the way a CTest `TIMEOUT` kills it; - `vm_page_provenance_hardware`; - the #2218 share path; - one 600 s startup run, separately. A probe that leaves shared commit behind after its process has exited identifies the leaking operation. If it's the existing-heap path, the fixes are in our control: release heaps before exit and never leave them to process teardown, avoid opening heaps over views in fixtures that can be killed, and add a commit check to the long-running tests. I'll post the table here. AI-assisted.
MasterDomino commented 2026-11-25 07:01:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T06:47:01Z.


Found the retained commit from my earlier comment: #2234. After a reboot I bisected on an idle host.

The leak is OpenExistingHeapFromFileMapping. On Windows 11 build 26300 it keeps the whole pagefile-backed section committed after the process exits, even after the heap is released and the section closed, on WARP and on the RX 9070 XT. OpenExistingHeapFromAddress on a view of the same section does not leak.

Only tests use it. unified_buffer_paths (#1942) leaves about 1.8 GiB per run, which over a day of repeated runs filled this host's 180 GB commit limit. The startup runs did not cause it.

So the per-run cost this issue tracks and that retention are separate problems. #2234 has the repro, the numbers and the test-side fix.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7155152539 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7155152539). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T06:47:01Z. --- Found the retained commit from my earlier comment: #2234. After a reboot I bisected on an idle host. The leak is `OpenExistingHeapFromFileMapping`. On Windows 11 build 26300 it keeps the whole pagefile-backed section committed after the process exits, even after the heap is released and the section closed, on WARP and on the RX 9070 XT. `OpenExistingHeapFromAddress` on a view of the same section does not leak. Only tests use it. `unified_buffer_paths` (#1942) leaves about 1.8 GiB per run, which over a day of repeated runs filled this host's 180 GB commit limit. The startup runs did not cause it. So the per-run cost this issue tracks and that retention are separate problems. #2234 has the repro, the numbers and the test-side fix. AI-assisted.
R0Y00 commented 2026-11-25 08:05:05 +00:00 (Migrated from github.com)
Author
Contributor

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


The opt-in lazy XMem paths landed in #2209 (45fa67fa). On the exact candidate, independent Windows Release passed all 24 selected checks, including refused release, forced handler-installation failure, mapped pages and slot 148. This covers lazy page commitment and startup-block handling. The retained system commit from OpenExistingHeapFromFileMapping remains separately tracked in #2234. Keep any application A/B on the same initial cache and inputs, and report system commit and local video-memory budget separately.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156163591 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7156163591). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T07:42:34Z. --- The opt-in lazy XMem paths landed in #2209 (45fa67fa). On the exact candidate, independent Windows Release passed all 24 selected checks, including refused release, forced handler-installation failure, mapped pages and slot 148. This covers lazy page commitment and startup-block handling. The retained system commit from OpenExistingHeapFromFileMapping remains separately tracked in #2234. Keep any application A/B on the same initial cache and inputs, and report system commit and local video-memory budget separately.
R0Y00 commented 2026-11-25 09:04:12 +00:00 (Migrated from github.com)
Author
Contributor

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


The independent Windows 10 / RTX 3080 Ti replay provides a same-progress comparison for #2209. At 200,000 inflated blocks, process commit was 22,575 MiB with the switches off and 21,336 MiB with them on. Both runs reached 480 seconds under the 26 GiB job cap without an allocation refusal. A separate 16 GiB-capped run still hit the cap. This measures process commit on that configuration. The GTX 1060 local-video-memory budget and the retained system commit in #2234 need their own measurements.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156987975 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7156987975). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T08:24:30Z. --- The [independent Windows 10 / RTX 3080 Ti replay](https://github.com/R0Y00/Xbox2Windows/issues/870#issuecomment-7156362699) provides a same-progress comparison for #2209. At 200,000 inflated blocks, process commit was 22,575 MiB with the switches off and 21,336 MiB with them on. Both runs reached 480 seconds under the 26 GiB job cap without an allocation refusal. A separate 16 GiB-capped run still hit the cap. This measures process commit on that configuration. The GTX 1060 local-video-memory budget and the retained system commit in #2234 need their own measurements.
JVProg commented 2026-11-25 14:05:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T13:35:29Z.


Memory data from a 32 GB host (aggregate counts only, one local run per row, not reproducible from this repository).

Setup: 5fa712ee, Release, Windows 11 build 26300.9974, RX 9070 XT (driver 32.0.32029.2010), 31.1 GB usable RAM. All runs used -Render -Translate -FakeUser -GpuMirror -ContinueAsserts 1000, with the shader cache kept between runs. "Lazy" means X2W_XMEM_LAZY_COMMIT=1 and X2W_XMEM_LAZY_STARTUP=1.

Job cap Lazy -StartupBelow40 Stop Last heartbeat Commit peak / current (MiB) Inflated What ended the run
14 GiB off off 208 s 190 s 12,043 / 12,043 16,616 1455 on page mapping and unwritable DirectStorage destinations, then an access violation
14 GiB on off 198 s 170 s 14,338 / 14,335 44,131 0x8007000e from slot 133, then an access violation; peak at the cap
24 GiB on off 172 s 150 s 15,077 / 15,076 57,252 BVH builder: DestAccelerationStructureData above 40 bits
24 GiB on on 310 s 250 s 24,016 / 24,013 194,445 1455 and out-of-memory errors, then an access violation
30 GiB on on 395 s 350 s 30,349 / 30,349 284,296 unhandled std::bad_alloc thrown in d3d12_xs.dll
  • Commit, current commit and inflated counts are from the last heartbeat. Live physical-page sections were 113,538 in the last heartbeat of all five runs.
  • DirectStorage reported failed=0 in the last heartbeat of each run.
  • Commit was still rising at the last heartbeat of the 30 GiB run: 27,031 MiB / 228,320 inflated at 290 s, 30,349 MiB / 284,296 at 350 s. I did not see it level off.
  • No commit value was recorded at the moment of the bad_alloc, so reaching the cap is an inference.
  • These data do not show whether the growth is needed by the load, extra copies, or memory that is never released. I have no per-category accounting.
  • With the 24 and 30 GiB caps and -StartupBelow40, three startup blocks were placed below 2^40, none was refused, and the 40-bit error did not appear.
  • Page file: system-managed with 10,240 MB allocated when checked after the second 14 GiB run (commit limit 41.1 GB). I then set it to 24,576 MB initial / 32,768 MB maximum before the 24 GiB runs. After the 24 GiB -StartupBelow40 run the commit limit was 55.1 GB; after the 30 GiB run the allocated size was 24,576 MB.

The first two rows are the closest A/B: same build, cap, command-line options and shader cache directory, with only the two lazy switches changed. Their last heartbeats are 20 s apart (190 s and 170 s). The other rows also change the cap or -StartupBelow40. Each configuration was run once.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163999723 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7163999723). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T13:35:29Z. --- Memory data from a 32 GB host (aggregate counts only, one local run per row, not reproducible from this repository). **Setup:** `5fa712ee`, Release, Windows 11 build 26300.9974, RX 9070 XT (driver 32.0.32029.2010), 31.1 GB usable RAM. All runs used `-Render -Translate -FakeUser -GpuMirror -ContinueAsserts 1000`, with the shader cache kept between runs. "Lazy" means `X2W_XMEM_LAZY_COMMIT=1` and `X2W_XMEM_LAZY_STARTUP=1`. | Job cap | Lazy | `-StartupBelow40` | Stop | Last heartbeat | Commit peak / current (MiB) | Inflated | What ended the run | |---|---|---|---|---|---|---|---| | 14 GiB | off | off | 208 s | 190 s | 12,043 / 12,043 | 16,616 | 1455 on page mapping and unwritable DirectStorage destinations, then an access violation | | 14 GiB | on | off | 198 s | 170 s | 14,338 / 14,335 | 44,131 | `0x8007000e` from slot 133, then an access violation; peak at the cap | | 24 GiB | on | off | 172 s | 150 s | 15,077 / 15,076 | 57,252 | BVH builder: `DestAccelerationStructureData` above 40 bits | | 24 GiB | on | on | 310 s | 250 s | 24,016 / 24,013 | 194,445 | 1455 and out-of-memory errors, then an access violation | | 30 GiB | on | on | 395 s | 350 s | 30,349 / 30,349 | 284,296 | unhandled `std::bad_alloc` thrown in `d3d12_xs.dll` | - Commit, current commit and inflated counts are from the last heartbeat. Live physical-page sections were 113,538 in the last heartbeat of all five runs. - DirectStorage reported `failed=0` in the last heartbeat of each run. - Commit was still rising at the last heartbeat of the 30 GiB run: 27,031 MiB / 228,320 inflated at 290 s, 30,349 MiB / 284,296 at 350 s. I did not see it level off. - No commit value was recorded at the moment of the `bad_alloc`, so reaching the cap is an inference. - These data do not show whether the growth is needed by the load, extra copies, or memory that is never released. I have no per-category accounting. - With the 24 and 30 GiB caps and `-StartupBelow40`, three startup blocks were placed below 2^40, none was refused, and the 40-bit error did not appear. - Page file: system-managed with 10,240 MB allocated when checked after the second 14 GiB run (commit limit 41.1 GB). I then set it to 24,576 MB initial / 32,768 MB maximum before the 24 GiB runs. After the 24 GiB `-StartupBelow40` run the commit limit was 55.1 GB; after the 30 GiB run the allocated size was 24,576 MB. The first two rows are the closest A/B: same build, cap, command-line options and shader cache directory, with only the two lazy switches changed. Their last heartbeats are 20 s apart (190 s and 170 s). The other rows also change the cap or `-StartupBelow40`. Each configuration was run once. AI-assisted (Claude Code).
R0Y00 commented 2026-11-25 15:01:58 +00:00 (Migrated from github.com)
Author
Contributor

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


Thanks for recording both the load progress and the caps. The two 14 GiB runs give a useful common comparison point near 15,000 inflated blocks. If the existing logs include that point, could you post the nearest sample for each run with the exact block count, process commit and physical-page section count? A matched repeat with the same initial shader cache and fixed page-file settings would also help if the logs do not have it.

For the later std::bad_alloc, the last heartbeat establishes rising commit, but there is no sample at the failure. A follow-up can report the first failed allocation category or call site and the process/job commit at that point if available. Aggregate counts are enough.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165068374 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7165068374). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:18:12Z. --- Thanks for recording both the load progress and the caps. The two 14 GiB runs give a useful common comparison point near 15,000 inflated blocks. If the existing logs include that point, could you post the nearest sample for each run with the exact block count, process commit and physical-page section count? A matched repeat with the same initial shader cache and fixed page-file settings would also help if the logs do not have it. For the later `std::bad_alloc`, the last heartbeat establishes rising commit, but there is no sample at the failure. A follow-up can report the first failed allocation category or call site and the process/job commit at that point if available. Aggregate counts are enough.
JVProg commented 2026-11-25 18:01:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T17:48:38Z.


The existing logs have a close matching point for the two 14 GiB runs (nearest heartbeat to 15,000 inflated blocks in each):

Lazy Heartbeat Inflated Requests done Commit peak / current (MiB) Live physical-page sections
off 140 s 16,616 9,896 12,043 / 12,043 113,538
on 110 s 16,621 9,896 11,082 / 11,081 113,538

At this point, current commit was 962 MiB lower with the lazy switches on. In both logs, the first CreatePlacedResourceX result of 0x8007000e appears after these samples.

Limits: one run per configuration, shader cache kept between runs (initial contents not guaranteed identical), and a system-managed page file.

For the std::bad_alloc, the logs I checked show neither the first failed allocation nor the commit at the failure. I am still working on it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170031128 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7170031128). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T17:48:38Z. --- The existing logs have a close matching point for the two 14 GiB runs (nearest heartbeat to 15,000 inflated blocks in each): | Lazy | Heartbeat | Inflated | Requests done | Commit peak / current (MiB) | Live physical-page sections | |---|---|---|---|---|---| | off | 140 s | 16,616 | 9,896 | 12,043 / 12,043 | 113,538 | | on | 110 s | 16,621 | 9,896 | 11,082 / 11,081 | 113,538 | At this point, current commit was 962 MiB lower with the lazy switches on. In both logs, the first `CreatePlacedResourceX` result of `0x8007000e` appears after these samples. Limits: one run per configuration, shader cache kept between runs (initial contents not guaranteed identical), and a system-managed page file. For the `std::bad_alloc`, the logs I checked show neither the first failed allocation nor the commit at the failure. I am still working on it. AI-assisted (Claude Code).
JVProg commented 2026-11-25 19:04:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T18:46:18Z.


Follow-up on the std::bad_alloc, from one new 30 GiB run (not a repeat of the earlier one).

Setup: 1a0e506d plus a local, unpublished debugger diagnostic, Release stand-ins built with PDBs, both lazy switches on, -StartupBelow40, warm shader cache, 32 GB host.

At the failure (476 s), sampled by the debugger:

Reading MiB
Process commit 30,007
Job peak / limit 31,926 / 30,720
System commit / limit 59,643 / 60,813
  • I could not confirm this was the first failed allocation. One job-memory-limit notice was received, together with the bad_alloc; delivery is not guaranteed, so earlier refusals are not ruled out.
  • I did not sample current job commit; the job is limited to one process. I found no 0x8007000e in the stand-in log.
  • The system was also close to its commit limit.
  • Call site: operator new while view_records grows in note_view (d3d12_capture.inl:309).
  • Request size, estimated at about 1.9 GiB: job peak minus commit is 1,919 MiB (in a separate 256 MiB-capped test, the job peak included the refused request). The last logged distinct view count was 11,666,595. By my calculation of MSVC vector growth, the next step is from 11,958,657 to 17,937,985 records of 112 bytes, or 1,916 MiB.

This shows where the allocation failed, not what accounts for the 30 GiB. I did not measure the total size of the view tables, and the draw code reads these records. No log heartbeat appears after the 360 s one; I don't know why yet.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171375226 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7171375226). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T18:46:18Z. --- Follow-up on the `std::bad_alloc`, from one new 30 GiB run (not a repeat of the earlier one). Setup: `1a0e506d` plus a local, unpublished debugger diagnostic, Release stand-ins built with PDBs, both lazy switches on, `-StartupBelow40`, warm shader cache, 32 GB host. At the failure (476 s), sampled by the debugger: | Reading | MiB | |---|---| | Process commit | 30,007 | | Job peak / limit | 31,926 / 30,720 | | System commit / limit | 59,643 / 60,813 | - I could not confirm this was the first failed allocation. One job-memory-limit notice was received, together with the `bad_alloc`; delivery is not guaranteed, so earlier refusals are not ruled out. - I did not sample current job commit; the job is limited to one process. I found no `0x8007000e` in the stand-in log. - The system was also close to its commit limit. - Call site: `operator new` while `view_records` grows in `note_view` (`d3d12_capture.inl:309`). - Request size, estimated at about 1.9 GiB: job peak minus commit is 1,919 MiB (in a separate 256 MiB-capped test, the job peak included the refused request). The last logged distinct view count was 11,666,595. By my calculation of MSVC vector growth, the next step is from 11,958,657 to 17,937,985 records of 112 bytes, or 1,916 MiB. This shows where the allocation failed, not what accounts for the 30 GiB. I did not measure the total size of the view tables, and the draw code reads these records. No log heartbeat appears after the 360 s one; I don't know why yet. AI-assisted (Claude Code).
JVProg commented 2026-11-25 22:02:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T21:45:20Z.


Follow-up to my view_records report: two more runs on newer code ended in std::bad_alloc from note_view, one of them at a second allocation site.

Setup: e9ae884f, Release stand-ins, 32 GB host, system-managed page file. Switches: -Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000, with X2W_XMEM_LAZY_COMMIT, X2W_XMEM_LAZY_STARTUP, X2W_D3D12_RELEASE_RETIRED and X2W_D3D12_BUDGET set to 1. The shader cache was kept between runs (older requests had been re-keyed with shader_cache_rekey.py). One run per row, local, not reproducible from this repository.

Run A Run B
Job cap 26 GiB 30 GiB, no time limit (-Seconds 0)
Stop 489.7 s 682.0 s
Views noted / distinct (last report) 53,648,037 / 16,679,684 98,785,879 / 26,638,970
Failing site in d3d12_capture.inl line 312, view_ids rehash line 309, view_records growth
Next allocation (calculated) ~512 MiB ~4,311 MiB
Commit in a late heartbeat (MiB) 26,306 peak (at 470 s) 29,499 current (at 650 s), 30,140 peak

I found no 0x8007000e in either stand-in log.

How the sizes were calculated (MSVC containers; not measured at the failure):

  • Run A: the last distinct count is just below 2^24 = 16,777,216. I assume the failing request is the bucket array for 2^25 buckets at 16 bytes each.
  • Run B: the last distinct count is just below the vector capacity 26,906,977. The next capacity is 40,360,465 records of 112 bytes. The old block (~2,874 MiB) stays allocated during the copy.

In both runs the calculated request is larger than the room left under the cap in the heartbeat above.

How the sites were found: the ThrowInfo in the DLL that ran names std::bad_alloc. That DLL had no PDB, so I rebuilt it separately with /Zi and /DEBUG /OPT:REF /OPT:ICF. The .text sections have the same size and differ in 26 bytes. Function names and lines come from a scan of the raw stack against that PDB, not from an unwound call stack.

Limits:

  • I did not sample process or job commit at the moment of either failure.
  • I did not measure the total size of the view tables. My rough estimate for Run B is 4–5 GiB, so they do not account for all of the commit.
  • I don't know which view slot or descriptor field produces so many distinct records.
  • A separate 30 GiB run on the same commit reached its 600 s timeout without crashing (commit peak 30,648 MiB).

Possible directions, both untested: chunked storage for the records could avoid the large copy in the vector, but would not stop the growth or cover the map rehash. A per-slot count of new distinct records could show where the growth comes from.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7175497075 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7175497075). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T21:45:20Z. --- Follow-up to my `view_records` report: two more runs on newer code ended in `std::bad_alloc` from `note_view`, one of them at a second allocation site. **Setup:** `e9ae884f`, Release stand-ins, 32 GB host, system-managed page file. Switches: `-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000`, with `X2W_XMEM_LAZY_COMMIT`, `X2W_XMEM_LAZY_STARTUP`, `X2W_D3D12_RELEASE_RETIRED` and `X2W_D3D12_BUDGET` set to `1`. The shader cache was kept between runs (older requests had been re-keyed with `shader_cache_rekey.py`). One run per row, local, not reproducible from this repository. | | Run A | Run B | |---|---|---| | Job cap | 26 GiB | 30 GiB, no time limit (`-Seconds 0`) | | Stop | 489.7 s | 682.0 s | | Views noted / distinct (last report) | 53,648,037 / 16,679,684 | 98,785,879 / 26,638,970 | | Failing site in `d3d12_capture.inl` | line 312, `view_ids` rehash | line 309, `view_records` growth | | Next allocation (calculated) | ~512 MiB | ~4,311 MiB | | Commit in a late heartbeat (MiB) | 26,306 peak (at 470 s) | 29,499 current (at 650 s), 30,140 peak | I found no `0x8007000e` in either stand-in log. **How the sizes were calculated** (MSVC containers; not measured at the failure): - **Run A:** the last distinct count is just below 2^24 = 16,777,216. I assume the failing request is the bucket array for 2^25 buckets at 16 bytes each. - **Run B:** the last distinct count is just below the vector capacity 26,906,977. The next capacity is 40,360,465 records of 112 bytes. The old block (~2,874 MiB) stays allocated during the copy. In both runs the calculated request is larger than the room left under the cap in the heartbeat above. **How the sites were found:** the `ThrowInfo` in the DLL that ran names `std::bad_alloc`. That DLL had no PDB, so I rebuilt it separately with `/Zi` and `/DEBUG /OPT:REF /OPT:ICF`. The `.text` sections have the same size and differ in 26 bytes. Function names and lines come from a scan of the raw stack against that PDB, not from an unwound call stack. **Limits:** - I did not sample process or job commit at the moment of either failure. - I did not measure the total size of the view tables. My rough estimate for Run B is 4–5 GiB, so they do not account for all of the commit. - I don't know which view slot or descriptor field produces so many distinct records. - A separate 30 GiB run on the same commit reached its 600 s timeout without crashing (commit peak 30,648 MiB). Possible directions, both untested: chunked storage for the records could avoid the large copy in the vector, but would not stop the growth or cover the map rehash. A per-slot count of new distinct records could show where the growth comes from. AI-assisted (Claude Code).
R0Y00 commented 2026-11-25 23:02:03 +00:00 (Migrated from github.com)
Author
Contributor

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


Thanks for distinguishing record growth from the separate map rehash. The reported call sites are useful; the calculated next allocation sizes remain estimates. A focused source-built diagnostic would count new unique view records by slot and record the vector capacity and hash bucket count before growth. Please compare repeated identical descriptors with a controlled stream of distinct descriptors and keep both results under a bounded commit budget. This can identify the growth path without changing when a live descriptor can be rebound. The worker’s allocation-failure recovery is a separate acceptance item.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7175882920 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7175882920). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T22:03:35Z. --- Thanks for distinguishing record growth from the separate map rehash. The reported call sites are useful; the calculated next allocation sizes remain estimates. A focused source-built diagnostic would count new unique view records by slot and record the vector capacity and hash bucket count before growth. Please compare repeated identical descriptors with a controlled stream of distinct descriptors and keep both results under a bounded commit budget. This can identify the growth path without changing when a live descriptor can be rebound. The worker’s allocation-failure recovery is a separate acceptance item.
JVProg commented 2026-11-25 23:02:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T22:58:02Z.


I ran the per-slot count you described, plus two one-off looks: at the record contents (run 1) and at the calls that create buffer SRVs (run 2). In run 1 the records are almost all slot 18 (SRV).

Setup (run 1): fb2f86ac plus two local, unpublished patches (the census, and a one-time dump of records), Release stand-ins, 24 GiB job cap. Switches: -Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000, with X2W_XMEM_LAZY_COMMIT, X2W_XMEM_LAZY_STARTUP, X2W_D3D12_RELEASE_RETIRED and X2W_D3D12_BUDGET set to 1. The shader cache was kept from earlier runs. One run, not reproducible from this repository. I stopped it on request at 421 s, after the dump. I found no 0x8007000e in the log.

Last census line:

Total SRV UAV RTV DSV CBV Sampler
5,016,686 5,013,700 2,026 594 366 0 0

Window: records with ids 2,000,000 to 3,999,999. 1,993,823 of them are buffer SRVs, and 1,986,012 of those (99.6%) name the same resource.

Distinct keys among the buffer SRVs, after zeroing the bytes that the desktop D3D12 layout does not use:

Also ignored Keys left Share of buffer SRV records
nothing 1,587,424 79.6%
NumElements 1,240,227 62.2%
FirstElement 8,717 0.44%
both 1,525 0.08%

So in this window the variety comes mainly from the range of the view, FirstElement above all. Ignoring these fields is only an analysis step: views with different ranges are different views.

Unused bytes: of the 1,999,989 SRV records in the window, 406,399 (20.3%) differ from an earlier record only in bytes the desktop layout does not use. note_view hashes the whole captured description, so these get separate ids. I assume the description passed in follows the desktop layout; I have not checked that these bytes have no meaning on the console side. Removing these duplicates would still leave most records in this window distinct.

Run 2: calls. Same base commit and switches, with the census and a local patch that records every slot-18 buffer SRV call, repeated ones included, with its thread, frame and call stack. I stopped it on request at 350 s, after the recording; I found no 0x8007000e in the log. The window is 4,000,000 calls over 639 frames, starting at 3,000,000 records. 3,993,181 of them (99.8%) name one resource; the figures below are for that resource.

Measure Result
Calls per whole frame (median) 7,867
Distinct byte ranges per whole frame (median) 4,813
A frame's ranges also used in the previous frame (median) 1.6%
Calls whose range, format, stride and flags appeared earlier in the window 64.9% (for 64.2% of those, the previous use was in the same frame)
New records per frame (mean, calculated over the 639 frames) about 2,160
  • Threads: six. Five make about 20% of the calls each, the sixth 0.5%. 76.7% of consecutive calls in lock order change thread. For each of the five, about two thirds of its own successive calls are still jumps (not the same range, and not adjacent within 256 bytes).
  • Call sites: grouping by the first frame outside the stand-in, two sites account for 97.0% of the calls and about 97% of the new records:
Site Strides Share of calls Its calls that add a record Share of new records
A most common: 4, 8, 64 59.4% 17.4% about 30%
B all 0 37.7% 61.5% about 67%

There are 2,027 distinct stacks overall, and the most frequent one covers 2.5% of the calls. A and B may be shared helpers; I have not looked at the code, and I have not verified that the captured stacks are correct at every level. I'm not including addresses.

So in this window, most of a frame's ranges were not in the previous frame, while the stand-in keeps every record. They may still come back from older frames. This does not show when a record stops being needed: descriptors that carry its id can be copied through title memory.

Limits:

  • Two separate runs, one window each; the mix may change later. Recording stacks may also have changed timing and how the threads interleave.
  • Byte ranges assume the element size follows from the stride or, without one, from the format.
  • I don't know how the ranges are allocated. Temporary sub-ranges of one large buffer would fit, but that is a hypothesis.
  • This is about what adds records, not about what accounts for the process commit.
  • The record dump and call recording are not part of the census below.

Census: I have it locally as an opt-in switch (X2W_D3D12_VIEW_CENSUS=1): new records by slot, and vector capacity and bucket count logged before a predicted growth. It has a fixture that compares repeated and distinct descriptors under a job commit limit, with a switch-off case and a negative control. It passed on WARP and on an RX 9070 XT (driver 32.0.32029.2010, Windows build 26300, debug layer off). The fixture covers slots 17, 18 and 22, not 19 to 21. It does not cover the worker's allocation-failure recovery. I can open a PR for it if that is useful.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176992197 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7176992197). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T22:58:02Z. --- I ran the per-slot count you described, plus two one-off looks: at the record contents (run 1) and at the calls that create buffer SRVs (run 2). In run 1 the records are almost all slot 18 (SRV). **Setup (run 1):** `fb2f86ac` plus two local, unpublished patches (the census, and a one-time dump of records), Release stand-ins, 24 GiB job cap. Switches: `-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000`, with `X2W_XMEM_LAZY_COMMIT`, `X2W_XMEM_LAZY_STARTUP`, `X2W_D3D12_RELEASE_RETIRED` and `X2W_D3D12_BUDGET` set to `1`. The shader cache was kept from earlier runs. One run, not reproducible from this repository. I stopped it on request at 421 s, after the dump. I found no `0x8007000e` in the log. **Last census line:** | Total | SRV | UAV | RTV | DSV | CBV | Sampler | |---|---|---|---|---|---|---| | 5,016,686 | 5,013,700 | 2,026 | 594 | 366 | 0 | 0 | **Window:** records with ids 2,000,000 to 3,999,999. 1,993,823 of them are buffer SRVs, and 1,986,012 of those (99.6%) name the same resource. Distinct keys among the buffer SRVs, after zeroing the bytes that the desktop D3D12 layout does not use: | Also ignored | Keys left | Share of buffer SRV records | |---|---|---| | nothing | 1,587,424 | 79.6% | | `NumElements` | 1,240,227 | 62.2% | | `FirstElement` | 8,717 | 0.44% | | both | 1,525 | 0.08% | So in this window the variety comes mainly from the range of the view, `FirstElement` above all. Ignoring these fields is only an analysis step: views with different ranges are different views. **Unused bytes:** of the 1,999,989 SRV records in the window, 406,399 (20.3%) differ from an earlier record only in bytes the desktop layout does not use. `note_view` hashes the whole captured description, so these get separate ids. I assume the description passed in follows the desktop layout; I have not checked that these bytes have no meaning on the console side. Removing these duplicates would still leave most records in this window distinct. **Run 2: calls.** Same base commit and switches, with the census and a local patch that records every slot-18 buffer SRV call, repeated ones included, with its thread, frame and call stack. I stopped it on request at 350 s, after the recording; I found no `0x8007000e` in the log. The window is 4,000,000 calls over 639 frames, starting at 3,000,000 records. 3,993,181 of them (99.8%) name one resource; the figures below are for that resource. | Measure | Result | |---|---| | Calls per whole frame (median) | 7,867 | | Distinct byte ranges per whole frame (median) | 4,813 | | A frame's ranges also used in the previous frame (median) | 1.6% | | Calls whose range, format, stride and flags appeared earlier in the window | 64.9% (for 64.2% of those, the previous use was in the same frame) | | New records per frame (mean, calculated over the 639 frames) | about 2,160 | - **Threads:** six. Five make about 20% of the calls each, the sixth 0.5%. 76.7% of consecutive calls in lock order change thread. For each of the five, about two thirds of its own successive calls are still jumps (not the same range, and not adjacent within 256 bytes). - **Call sites:** grouping by the first frame outside the stand-in, two sites account for 97.0% of the calls and about 97% of the new records: | Site | Strides | Share of calls | Its calls that add a record | Share of new records | |---|---|---|---|---| | A | most common: 4, 8, 64 | 59.4% | 17.4% | about 30% | | B | all 0 | 37.7% | 61.5% | about 67% | There are 2,027 distinct stacks overall, and the most frequent one covers 2.5% of the calls. A and B may be shared helpers; I have not looked at the code, and I have not verified that the captured stacks are correct at every level. I'm not including addresses. So in this window, most of a frame's ranges were not in the previous frame, while the stand-in keeps every record. They may still come back from older frames. This does not show when a record stops being needed: descriptors that carry its id can be copied through title memory. **Limits:** - Two separate runs, one window each; the mix may change later. Recording stacks may also have changed timing and how the threads interleave. - Byte ranges assume the element size follows from the stride or, without one, from the format. - I don't know how the ranges are allocated. Temporary sub-ranges of one large buffer would fit, but that is a hypothesis. - This is about what adds records, not about what accounts for the process commit. - The record dump and call recording are not part of the census below. **Census:** I have it locally as an opt-in switch (`X2W_D3D12_VIEW_CENSUS=1`): new records by slot, and vector capacity and bucket count logged before a predicted growth. It has a fixture that compares repeated and distinct descriptors under a job commit limit, with a switch-off case and a negative control. It passed on WARP and on an RX 9070 XT (driver 32.0.32029.2010, Windows build 26300, debug layer off). The fixture covers slots 17, 18 and 22, not 19 to 21. It does not cover the worker's allocation-failure recovery. I can open a PR for it if that is useful. AI-assisted (Claude Code).
R0Y00 commented 2026-11-26 00:01:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T23:12:14Z.


Please open the focused census PR. The two samples make a useful distinction: the calls are mostly buffer SRVs for one resource, and different FirstElement ranges explain much of the ID growth. The samples do not establish how much process commit those records account for or when an ID can be retired. Keep the range, format, stride and flags in identity. Keep the opt-in counters, switch-off case, bounded repeated-vs-distinct fixture and its negative control. The scope can stay slots 17, 18 and 22. Please leave the record dump, stack collection, lifetime policy and worker recovery out of this PR.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177261634 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7177261634). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T23:12:14Z. --- Please open the focused census PR. The two samples make a useful distinction: the calls are mostly buffer SRVs for one resource, and different `FirstElement` ranges explain much of the ID growth. The samples do not establish how much process commit those records account for or when an ID can be retired. Keep the range, format, stride and flags in identity. Keep the opt-in counters, switch-off case, bounded repeated-vs-distinct fixture and its negative control. The scope can stay slots 17, 18 and 22. Please leave the record dump, stack collection, lifetime policy and worker recovery out of this PR.
roansystemlabs commented 2026-11-26 00:01:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-25T23:43:07Z.


@JVProg, R0Y00 kept the worker's allocation-failure recovery out of your census PR as a separate acceptance item. If you plan to do it yourself, I'll leave it; otherwise I'd like to take it.

Scope:

  • When growing view_records or view_ids in note_view fails, the call reports a named failure and the process keeps running, with no further allocation on the faulting path and no stack overflow (0xc00000fd).
  • The lifetime policy for view IDs, the record dump and the descriptor identity rules from your PR stay as they are; this changes only what happens after the allocation has already failed.
  • #1410's DirectStorage request failure is left unchanged and re-run as a regression.

Evidence: a source-built fixture under a Windows job with a low commit cap (or an opt-in fault-injection switch), on WARP and an RTX 3070, plus your #2613 census checks and the DirectStorage allocation-failure checks re-run. Negative control: the same fixture without the change must stop as before.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177952017 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7177952017). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-25T23:43:07Z. --- @JVProg, R0Y00 kept the worker's allocation-failure recovery out of your census PR as a separate acceptance item. If you plan to do it yourself, I'll leave it; otherwise I'd like to take it. Scope: - When growing `view_records` or `view_ids` in `note_view` fails, the call reports a named failure and the process keeps running, with no further allocation on the faulting path and no stack overflow (0xc00000fd). - The lifetime policy for view IDs, the record dump and the descriptor identity rules from your PR stay as they are; this changes only what happens after the allocation has already failed. - #1410's DirectStorage request failure is left unchanged and re-run as a regression. Evidence: a source-built fixture under a Windows job with a low commit cap (or an opt-in fault-injection switch), on WARP and an RTX 3070, plus your #2613 census checks and the DirectStorage allocation-failure checks re-run. Negative control: the same fixture without the change must stop as before. AI-assisted.
R0Y00 commented 2026-11-26 00:01:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T23:53:33Z.


The worker recovery is the next separate implementation slice. Please coordinate with @JVProg on the existing claim. For the source-built control, inject failure into the two growth sites separately and check that a failed descriptor publication leaves previously published IDs readable, does not leave a partial record/index pair, and permits a later valid descriptor. A deterministic, bounded injection is enough for this slice. Keep the matched commit-budget replay here as separate evidence for the later loading stop.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178175338 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7178175338). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T23:53:33Z. --- The worker recovery is the next separate implementation slice. Please coordinate with @JVProg on the existing claim. For the source-built control, inject failure into the two growth sites separately and check that a failed descriptor publication leaves previously published IDs readable, does not leave a partial record/index pair, and permits a later valid descriptor. A deterministic, bounded injection is enough for this slice. Keep the matched commit-budget replay here as separate evidence for the later loading stop.
Not-Saii commented 2026-11-26 01:02:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-26T00:35:25Z.


Another data point at a newer revision, including a paired run with both lazy-commit switches.

Build and environment: main at d371ce46, release preset. Windows 11 Pro 26300.9974, AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088, debug layer off). About 19 GB of physical memory was free before each run.

Command: same switches in all three runs, with the title driven by a controller (no input script):

.\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <log> -ShaderCache <warm cache> `
    -Seconds 900 -MemoryGiB <cap> -Render -Translate -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000

Process commit (PagefileUsage from the DirectStorage heartbeat, MiB; heartbeat time base):

Run 10 s 60 s 70 s 80 s 110 s 120 s 130 s (last sample) Stop
-MemoryGiB 12 5,306 6,745 6,790 12,157 12,167 12,167 12,170 (12,235 at 170 s) 221.3 s, see below
-MemoryGiB 20 5,307 6,720 8,343 12,159 14,719 18,269 20,193 187.3 s
-MemoryGiB 20, X2W_XMEM_LAZY_COMMIT=1 and X2W_XMEM_LAZY_STARTUP=1 3,094 4,717 11,109 11,168 12,247 17,953 19,360 194.3 s

The jump around 70-80 s comes as the menus hand over to loading; the second one around 110-130 s is during loading. All three runs stopped at the same visible point: after the loading screen, on the first prologue screens, which were full-screen magenta (see #870).

First failures in each run:

  • 12 GiB: the D3D12 stand-in itself stopped first, on an unchecked _aligned_malloc in wrap(). Reported separately as #2653.
  • 20 GiB: XMemMapPhysicalPagesScatter failed with 1455 (stage=map-view). Then a package BVH-builder DLL took two C++ exceptions from desktop D3D12.dll / D3D12Core.dll and stopped on a null write.
  • 20 GiB with lazy commit: no 1455. Three CreatePlacedResourceX texture placements returned E_OUTOFMEMORY (0x8007000e), followed by the same BVH-builder stop.

What the lazy switches changed here: about 2.2 GiB less commit at the start (3.1 against 5.3 GiB) and through the menus, but about the same during loading (19.4 against 20.2 GiB at the last sample). The stop moved from 187 s to 194 s, and the first failure moved from the xmem map to D3D12 placement. A repeat of the lazy-commit run stopped at the same instruction at 225.9 s, with 8 E_OUTOFMEMORY placements and 19,163 MiB at the last sample. Its loading jump started about 80 s later (more time spent in the menus), so the stop follows the start of loading rather than a fixed time.

Not measured: local video-memory budget and usage (no X2W_D3D12_BUDGET=1), and system-wide commit. I can add both on the next run if that helps.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178913236 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7178913236). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T00:35:25Z. --- Another data point at a newer revision, including a paired run with both lazy-commit switches. **Build and environment:** `main` at `d371ce46`, `release` preset. Windows 11 Pro 26300.9974, AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088, debug layer off). About 19 GB of physical memory was free before each run. **Command:** same switches in all three runs, with the title driven by a controller (no input script): ```powershell .\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <log> -ShaderCache <warm cache> ` -Seconds 900 -MemoryGiB <cap> -Render -Translate -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 ``` **Process commit** (`PagefileUsage` from the DirectStorage heartbeat, MiB; heartbeat time base): | Run | 10 s | 60 s | 70 s | 80 s | 110 s | 120 s | 130 s (last sample) | Stop | |---|---:|---:|---:|---:|---:|---:|---:|---| | `-MemoryGiB 12` | 5,306 | 6,745 | 6,790 | 12,157 | 12,167 | 12,167 | 12,170 (12,235 at 170 s) | 221.3 s, see below | | `-MemoryGiB 20` | 5,307 | 6,720 | 8,343 | 12,159 | 14,719 | 18,269 | 20,193 | 187.3 s | | `-MemoryGiB 20`, `X2W_XMEM_LAZY_COMMIT=1` and `X2W_XMEM_LAZY_STARTUP=1` | 3,094 | 4,717 | 11,109 | 11,168 | 12,247 | 17,953 | 19,360 | 194.3 s | The jump around 70-80 s comes as the menus hand over to loading; the second one around 110-130 s is during loading. All three runs stopped at the same visible point: after the loading screen, on the first prologue screens, which were full-screen magenta (see #870). **First failures in each run:** - **12 GiB:** the D3D12 stand-in itself stopped first, on an unchecked `_aligned_malloc` in `wrap()`. Reported separately as #2653. - **20 GiB:** `XMemMapPhysicalPagesScatter` failed with 1455 (`stage=map-view`). Then a package BVH-builder DLL took two C++ exceptions from desktop `D3D12.dll` / `D3D12Core.dll` and stopped on a null write. - **20 GiB with lazy commit:** no 1455. Three `CreatePlacedResourceX` texture placements returned `E_OUTOFMEMORY` (`0x8007000e`), followed by the same BVH-builder stop. **What the lazy switches changed here:** about 2.2 GiB less commit at the start (3.1 against 5.3 GiB) and through the menus, but about the same during loading (19.4 against 20.2 GiB at the last sample). The stop moved from 187 s to 194 s, and the first failure moved from the xmem map to D3D12 placement. A repeat of the lazy-commit run stopped at the same instruction at 225.9 s, with 8 `E_OUTOFMEMORY` placements and 19,163 MiB at the last sample. Its loading jump started about 80 s later (more time spent in the menus), so the stop follows the start of loading rather than a fixed time. Not measured: local video-memory budget and usage (no `X2W_D3D12_BUDGET=1`), and system-wide commit. I can add both on the next run if that helps. AI-assisted (Claude Code).
R0Y00 commented 2026-11-26 01:02:14 +00:00 (Migrated from github.com)
Author
Contributor

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


Please include system commit/limit and local DXGI current usage/budget in the next matched pair. Use the same cap, revision, cache, profile and input in both arms. Capture those counters immediately before the first loading failure, plus process commit and the exact failing return code. The 12 GiB wrapper failure already has its own fix candidate #2656. The two 20 GiB runs moved the first failure from page mapping to D3D12 placement with similar late commit, so keep those stages separate when reporting the result.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179223452 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179223452). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T00:53:48Z. --- Please include system commit/limit and local DXGI current usage/budget in the next matched pair. Use the same cap, revision, cache, profile and input in both arms. Capture those counters immediately before the first loading failure, plus process commit and the exact failing return code. The 12 GiB wrapper failure already has its own fix candidate #2656. The two 20 GiB runs moved the first failure from page mapping to D3D12 placement with similar late commit, so keep those stages separate when reporting the result.
Not-Saii commented 2026-11-26 02:05:09 +00:00 (Migrated from github.com)
Author
Contributor

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


Matched pair as requested: one variable (lazy commit), everything else the same.

Shared setup. Release build of d371ce46 (without #2656). Windows 11 Pro 26300.9974, RTX 4090 (driver 32.0.16.1088, debug layer off), Ryzen 9 7900X, 32 GB RAM, system commit limit 97,956 MiB. -MemoryGiB 20 (20,480 MiB). Each arm started from its own copy of the same saved-profile snapshot and the same shader cache snapshot, with no translation during the run (no -Translate). Both used the same input script, A every 4 s from 4 s to 200 s after the first input poll (4@4,4@8,...,4@200), with no manual input. The title read 14 presses in each arm.

.\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <arm>\log -ShaderCache <arm>\shader_cache `
    -Seconds 420 -MemoryGiB 20 -Render -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 `
    -InputScript <script> -StoragePath <arm>\storage

With X2W_D3D12_BUDGET=1 in both arms, and X2W_XMEM_LAZY_COMMIT=1 with X2W_XMEM_LAZY_STARTUP=1 in arm B only. System commit, commit limit and process private commit were sampled once a second from outside the process (the Memory performance counters and the process's private bytes).

Counters before the first loading failure:

A: lazy off B: lazy on
First loading failure x2w-render list Close failed 0x8007000e (2 lines) Device::slot133(CreatePlacedResourceX?) texture, 4096×4096, 11 mips -> 0x8007000e (9 lines)
Process commit, last heartbeat before it 20,186 MiB 19,387 MiB
Process private, last outside sample 20,455 MiB at 116.3 s 20,405 MiB at 97.1 s
System commit / limit, same sample 53,906 / 97,956 MiB 53,526 / 97,956 MiB
DXGI local usage / budget, last line before it 11,477 / 23,370 MiB 11,622 / 23,370 MiB
DXGI nonlocal usage / budget 4,873 / 15,442 MiB 4,934 / 15,442 MiB
XMemMapPhysicalPages* 1455 none none
Stop 116.9 s: null write (0x24) in the title's own code 97.5 s: null write in the package BVH-builder DLL (as in the earlier lazy runs)
Asserts / C++ exceptions before the stop 4 / 18 132 / 1,007

Only the job cap was reached. System commit stayed at 55% of its limit, and DXGI local usage at about half its budget in both arms.

Process private commit over time (outside sampler, MiB; process seconds):

0 s 10 s 30 s 40 s 50 s 60 s 70 s 80 s 90 s 100 s 110 s
A 4,643 5,308 5,308 5,307 12,066 12,149 12,152 12,215 17,470 19,107 20,237
B 2,394 3,095 4,410 11,117 11,174 11,779 17,216 18,669 19,447 — —

Arm B reached its first input poll 12.4 s earlier (30.0 s against 42.4 s), so its curve runs about 12 s ahead. Lazy commit saved about 2.2 GiB before the menus and about 1 GiB through them. Both arms then climbed to the cap within about 25 s of the loading start.

Stages, kept separate:

  • Page mapping (1455): not reached in either arm. In the earlier controller run without lazy commit it came first. That run's input and timing differed, so this pair does not show whether 1455 depends on the switch or on timing.
  • D3D12 placement (CreatePlacedResourceX): first in arm B, and in both earlier lazy runs.
  • Command list Close (E_OUTOFMEMORY): first in arm A. This stage was not seen before. It was followed by a null write in the title rather than the BVH-builder stop.

So without lazy commit, the first failure at the cap has now differed between two runs (1455 before, list Close here). With lazy commit it was D3D12 placement in all three runs. One run per arm here; I have not repeated arm A.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179395499 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179395499). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T01:03:52Z. --- Matched pair as requested: one variable (lazy commit), everything else the same. **Shared setup.** Release build of `d371ce46` (without #2656). Windows 11 Pro 26300.9974, RTX 4090 (driver 32.0.16.1088, debug layer off), Ryzen 9 7900X, 32 GB RAM, system commit limit 97,956 MiB. `-MemoryGiB 20` (20,480 MiB). Each arm started from its own copy of the same saved-profile snapshot and the same shader cache snapshot, with no translation during the run (no `-Translate`). Both used the same input script, A every 4 s from 4 s to 200 s after the first input poll (`4@4,4@8,...,4@200`), with no manual input. The title read 14 presses in each arm. ```powershell .\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <arm>\log -ShaderCache <arm>\shader_cache ` -Seconds 420 -MemoryGiB 20 -Render -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 ` -InputScript <script> -StoragePath <arm>\storage ``` With `X2W_D3D12_BUDGET=1` in both arms, and `X2W_XMEM_LAZY_COMMIT=1` with `X2W_XMEM_LAZY_STARTUP=1` in arm B only. System commit, commit limit and process private commit were sampled once a second from outside the process (the `Memory` performance counters and the process's private bytes). **Counters before the first loading failure:** | | A: lazy off | B: lazy on | |---|---|---| | First loading failure | `x2w-render list Close failed 0x8007000e` (2 lines) | `Device::slot133(CreatePlacedResourceX?)` texture, 4096×4096, 11 mips -> `0x8007000e` (9 lines) | | Process commit, last heartbeat before it | 20,186 MiB | 19,387 MiB | | Process private, last outside sample | 20,455 MiB at 116.3 s | 20,405 MiB at 97.1 s | | System commit / limit, same sample | 53,906 / 97,956 MiB | 53,526 / 97,956 MiB | | DXGI local usage / budget, last line before it | 11,477 / 23,370 MiB | 11,622 / 23,370 MiB | | DXGI nonlocal usage / budget | 4,873 / 15,442 MiB | 4,934 / 15,442 MiB | | `XMemMapPhysicalPages*` 1455 | none | none | | Stop | 116.9 s: null write (`0x24`) in the title's own code | 97.5 s: null write in the package BVH-builder DLL (as in the earlier lazy runs) | | Asserts / C++ exceptions before the stop | 4 / 18 | 132 / 1,007 | Only the job cap was reached. System commit stayed at 55% of its limit, and DXGI local usage at about half its budget in both arms. **Process private commit over time** (outside sampler, MiB; process seconds): | | 0 s | 10 s | 30 s | 40 s | 50 s | 60 s | 70 s | 80 s | 90 s | 100 s | 110 s | |---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:| | A | 4,643 | 5,308 | 5,308 | 5,307 | 12,066 | 12,149 | 12,152 | 12,215 | 17,470 | 19,107 | 20,237 | | B | 2,394 | 3,095 | 4,410 | 11,117 | 11,174 | 11,779 | 17,216 | 18,669 | 19,447 | — | — | Arm B reached its first input poll 12.4 s earlier (30.0 s against 42.4 s), so its curve runs about 12 s ahead. Lazy commit saved about 2.2 GiB before the menus and about 1 GiB through them. Both arms then climbed to the cap within about 25 s of the loading start. **Stages, kept separate:** - **Page mapping (1455):** not reached in either arm. In the earlier controller run without lazy commit it came first. That run's input and timing differed, so this pair does not show whether 1455 depends on the switch or on timing. - **D3D12 placement (`CreatePlacedResourceX`):** first in arm B, and in both earlier lazy runs. - **Command list `Close` (`E_OUTOFMEMORY`):** first in arm A. This stage was not seen before. It was followed by a null write in the title rather than the BVH-builder stop. So without lazy commit, the first failure at the cap has now differed between two runs (1455 before, list `Close` here). With lazy commit it was D3D12 placement in all three runs. One run per arm here; I have not repeated arm A. AI-assisted (Claude Code).
R0Y00 commented 2026-11-26 02:05:10 +00:00 (Migrated from github.com)
Author
Contributor

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


The matched pair narrows this to the 20 GiB process job cap on this host. The last private-commit samples were 20,455 and 20,405 MiB. System commit and both DXGI budgets still had headroom. With lazy commit off, the first reported failure was Close with E_OUTOFMEMORY; with it on, the first was slot 133 texture placement with the same HRESULT. Neither arm emitted the earlier page-map 1455. That is useful attribution even though the two runs reached loading at different times.

The next useful comparison is by loading phase and allocation class. If you already have the budget traces, please align the two arms at the first loading request and summarize which tracked allocations grew before the failed call, alongside the last private-commit sample. A category with no counter can stay unknown. Keep the 20 GiB cap fixed. The merged #2656 is a separate error-handling fix for the 12 GiB wrapper crash; #1199 stays open for the growth seen here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179536858 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179536858). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:12:16Z. --- The matched pair narrows this to the 20 GiB process job cap on this host. The last private-commit samples were 20,455 and 20,405 MiB. System commit and both DXGI budgets still had headroom. With lazy commit off, the first reported failure was `Close` with `E_OUTOFMEMORY`; with it on, the first was slot 133 texture placement with the same HRESULT. Neither arm emitted the earlier page-map 1455. That is useful attribution even though the two runs reached loading at different times. The next useful comparison is by loading phase and allocation class. If you already have the budget traces, please align the two arms at the first loading request and summarize which tracked allocations grew before the failed call, alongside the last private-commit sample. A category with no counter can stay unknown. Keep the 20 GiB cap fixed. The merged #2656 is a separate error-handling fix for the 12 GiB wrapper crash; #1199 stays open for the growth seen here.
Not-Saii commented 2026-11-26 02:05:10 +00:00 (Migrated from github.com)
Author
Contributor

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


Aligned from the existing traces of the same pair (d371ce46, 20 GiB cap, X2W_D3D12_BUDGET=1, A without and B with lazy commit). Each x2w-budget line is attributed to the DirectStorage heartbeat before it in the log, so times are on the heartbeat clock, not process seconds. Values are MiB, and each category is live + retained.

Alignment point. In both arms, committed textures sat at 4,318 + 98 MiB through the menus. I took the first heartbeat where that grew as the start of loading: A at 80 s, B at 50 s. The row before it is the baseline.

Phase 1, before loading (the earlier 5 → 12 GiB step): process commit went from 5,341 to 12,109 MiB in A, and from 4,901 to 11,167 MiB in B. In the same interval, live physical-page sections went from 102,736 to 113,609, and every x2w-budget category stayed the same. This step is title memory through xmem, which has no byte counter in the budget line, so its split stays unknown here. The section count did not change again before the failure in either arm.

Phase 2, loading start to the last sample before the first failed call:

A: 70 → 100 s B: 40 → 80 s
Process commit (heartbeat) 12,151 → 20,186 (+8,035) 11,167 → 19,387 (+8,220)
Process private, last outside sample 20,455 20,405
Committed textures, live 4,376 → 7,052 (+2,676) 4,318 → 6,707 (+2,389)
Committed textures, retained 98 → 3,268 (+3,170) 98 → 3,759 (+3,661)
Committed buffers, live + retained 1,055 + 0 → 1,090 + 130 (+165) 1,054 + 0 → 1,090 + 144 (+180)
Upload buffers 264 → 757 (+493) 256 → 793 (+537)
Placed resources 205 → 214 (+9) 195 → 213 (+18)
Explicit heaps, readback unchanged (3,371; 32) unchanged (3,371; 32)
Physical-page sections unchanged (113,609) unchanged (113,609)
DXGI local usage 5,572 → 11,477 (+5,905) 5,514 → 11,622 (+6,108)
DXGI nonlocal usage 4,072 → 4,873 (+801) 4,063 → 4,934 (+871)
First failed call after this sample list Close → E_OUTOFMEMORY slot 133 texture placement → E_OUTOFMEMORY

What grew. Committed textures account for about +5.8 GiB in A and +6.1 GiB in B, and more than half of that is the retained column: textures the title has released whose desktop objects the stand-in still holds. That matches #2379. Upload buffers add about 0.5 GiB. Committed buffers, placed resources, heaps and the xmem sections add little or nothing. The tracked categories sum to about +6.5 GiB (A) and +6.8 GiB (B) against +8.0 and +8.2 GiB of process commit, leaving about 1.5 GiB in each arm with no counter. These runs do not establish how much of the texture growth is charged to process commit rather than only to local video memory; DXGI local usage rose by about the same amount as the texture categories.

Both arms ran without X2W_D3D12_RELEASE_RETIRED. A matched run with it, at the same 20 GiB cap, would show how much of the retained growth comes back. I have not run that yet.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179662789 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179662789). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T01:19:40Z. --- Aligned from the existing traces of the same pair (`d371ce46`, 20 GiB cap, `X2W_D3D12_BUDGET=1`, A without and B with lazy commit). Each `x2w-budget` line is attributed to the DirectStorage heartbeat before it in the log, so times are on the heartbeat clock, not process seconds. Values are MiB, and each category is live + retained. **Alignment point.** In both arms, committed textures sat at 4,318 + 98 MiB through the menus. I took the first heartbeat where that grew as the start of loading: A at 80 s, B at 50 s. The row before it is the baseline. **Phase 1, before loading** (the earlier 5 → 12 GiB step): process commit went from 5,341 to 12,109 MiB in A, and from 4,901 to 11,167 MiB in B. In the same interval, `live physical-page sections` went from 102,736 to 113,609, and every `x2w-budget` category stayed the same. This step is title memory through xmem, which has no byte counter in the budget line, so its split stays unknown here. The section count did not change again before the failure in either arm. **Phase 2, loading start to the last sample before the first failed call:** | | A: 70 → 100 s | B: 40 → 80 s | |---|---:|---:| | Process commit (heartbeat) | 12,151 → 20,186 (+8,035) | 11,167 → 19,387 (+8,220) | | Process private, last outside sample | 20,455 | 20,405 | | Committed textures, live | 4,376 → 7,052 (+2,676) | 4,318 → 6,707 (+2,389) | | Committed textures, retained | 98 → 3,268 (+3,170) | 98 → 3,759 (+3,661) | | Committed buffers, live + retained | 1,055 + 0 → 1,090 + 130 (+165) | 1,054 + 0 → 1,090 + 144 (+180) | | Upload buffers | 264 → 757 (+493) | 256 → 793 (+537) | | Placed resources | 205 → 214 (+9) | 195 → 213 (+18) | | Explicit heaps, readback | unchanged (3,371; 32) | unchanged (3,371; 32) | | Physical-page sections | unchanged (113,609) | unchanged (113,609) | | DXGI local usage | 5,572 → 11,477 (+5,905) | 5,514 → 11,622 (+6,108) | | DXGI nonlocal usage | 4,072 → 4,873 (+801) | 4,063 → 4,934 (+871) | | First failed call after this sample | list `Close` → `E_OUTOFMEMORY` | slot 133 texture placement → `E_OUTOFMEMORY` | **What grew.** Committed textures account for about +5.8 GiB in A and +6.1 GiB in B, and more than half of that is the retained column: textures the title has released whose desktop objects the stand-in still holds. That matches #2379. Upload buffers add about 0.5 GiB. Committed buffers, placed resources, heaps and the xmem sections add little or nothing. The tracked categories sum to about +6.5 GiB (A) and +6.8 GiB (B) against +8.0 and +8.2 GiB of process commit, leaving about 1.5 GiB in each arm with no counter. These runs do not establish how much of the texture growth is charged to process commit rather than only to local video memory; DXGI local usage rose by about the same amount as the texture categories. Both arms ran without `X2W_D3D12_RELEASE_RETIRED`. A matched run with it, at the same 20 GiB cap, would show how much of the retained growth comes back. I have not run that yet. AI-assisted (Claude Code).
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:27:57Z.


Follow-up to the allocation-class alignment: a new matched pair at the same 20 GiB cap, varying only the retired-resource release.

Setup. Release build of main at f4c6998a. Windows 11 Pro 26300.9974, RTX 4090 (driver 32.0.16.1088, debug layer off), 32 GB RAM, system commit limit 97,956 MiB. Both arms started from copies of one saved-profile snapshot and one shader-cache snapshot (revision 17, translated offline first), with no translation during the run, lazy commit off, X2W_D3D12_BUDGET=1, and the same input script (A every 4 s from 4 s to 200 s after the first poll, no manual input).

.\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <arm>\log -ShaderCache <arm>\shader_cache `
    -Seconds 420 -MemoryGiB 20 -Render -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 `
    -InputScript <script> -StoragePath <arm>\storage

Arm D adds X2W_D3D12_RELEASE_RETIRED=1, X2W_D3D12_RELEASE_RETIRED_VIEWS=1 and the diagnostic X2W_D3D12_RETIRE_REASONS=1.

Result (times on the DirectStorage heartbeat clock unless marked as process seconds; MiB):

C: release off D: release on
Stop (process seconds) 69.7 s 155.2 s
Stop null write in a package BVH-builder DLL same instruction
First failure slot 133 texture placement → 0x8007000e (8 in total) same (8 in total)
Page-map 1455 / wrapper allocation failures 0 / 0 0 / 0
Committed textures, retained, last sample 3,563 143
DXGI local usage, last sample 11,577 8,662
Process commit, last heartbeat 19,505 19,470
Process private, last outside sample 20,480 20,462
System commit / limit, same sample 54,031 / 97,956 53,920 / 97,956
ExecuteIndirect forwarded 0 0
Refused mesh / compute dispatches 533,625 / 195,047 5,480,136 / 1,895,999
A presses read / title asserts 13 / 109 35 / 22

On screen, arm D got noticeably further than arm C, through to later credit cards. Both showed a solid red background where d371ce46 had shown magenta. I have not looked into what changed between the two revisions.

Where the commit went. Sum of the tracked x2w-budget categories (live + retained, all six) against process commit, from the last menu sample (20 s) to the last sample:

Tracked categories Process commit Not tracked
C, 20 → 50 s 9,370 → 15,936 (+6,566) 12,153 → 19,505 (+7,352) about +0.8 GiB
D, 20 → 140 s 9,400 → 13,644 (+4,244) 12,151 → 19,470 (+7,319) about +3.0 GiB

With the release on, the tracked categories peak early (13,896 at 30 s) and then stay roughly flat, while process commit keeps rising for another 110 s. The physical-page section count stayed at 113,609 throughout in both arms. So once retained textures are released, most of the remaining growth to the cap is outside the six budget categories and outside the xmem section count. It could be title heap memory, the stand-ins' own heaps or driver allocations; these runs have no counter for it.

At the stop, arm D's retire-reasons line still held 484 MiB: 5,163 buffers (339 MiB, outside the release class), 11 render-target, depth or UAV resources (144 MiB), 4 of another dimension (0.25 MiB) and 1 texture with a live view (1.4 MiB). Upload buffers grew 626 → 982 MiB over the same interval.

One run per arm.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179799005 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179799005). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T01:27:57Z. --- Follow-up to the allocation-class alignment: a new matched pair at the same 20 GiB cap, varying only the retired-resource release. **Setup.** Release build of `main` at `f4c6998a`. Windows 11 Pro 26300.9974, RTX 4090 (driver 32.0.16.1088, debug layer off), 32 GB RAM, system commit limit 97,956 MiB. Both arms started from copies of one saved-profile snapshot and one shader-cache snapshot (revision 17, translated offline first), with no translation during the run, lazy commit off, `X2W_D3D12_BUDGET=1`, and the same input script (A every 4 s from 4 s to 200 s after the first poll, no manual input). ```powershell .\tools\startup\run.ps1 -Exe <run dir>\<title>.exe -DataDir G:\ -LogDir <arm>\log -ShaderCache <arm>\shader_cache ` -Seconds 420 -MemoryGiB 20 -Render -FakeUser -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 1000 ` -InputScript <script> -StoragePath <arm>\storage ``` Arm D adds `X2W_D3D12_RELEASE_RETIRED=1`, `X2W_D3D12_RELEASE_RETIRED_VIEWS=1` and the diagnostic `X2W_D3D12_RETIRE_REASONS=1`. **Result** (times on the DirectStorage heartbeat clock unless marked as process seconds; MiB): | | C: release off | D: release on | |---|---:|---:| | Stop (process seconds) | 69.7 s | **155.2 s** | | Stop | null write in a package BVH-builder DLL | same instruction | | First failure | slot 133 texture placement → `0x8007000e` (8 in total) | same (8 in total) | | Page-map 1455 / wrapper allocation failures | 0 / 0 | 0 / 0 | | Committed textures, retained, last sample | 3,563 | **143** | | DXGI local usage, last sample | 11,577 | 8,662 | | Process commit, last heartbeat | 19,505 | 19,470 | | Process private, last outside sample | 20,480 | 20,462 | | System commit / limit, same sample | 54,031 / 97,956 | 53,920 / 97,956 | | `ExecuteIndirect` forwarded | 0 | 0 | | Refused mesh / compute dispatches | 533,625 / 195,047 | 5,480,136 / 1,895,999 | | A presses read / title asserts | 13 / 109 | 35 / 22 | On screen, arm D got noticeably further than arm C, through to later credit cards. Both showed a solid **red** background where `d371ce46` had shown magenta. I have not looked into what changed between the two revisions. **Where the commit went.** Sum of the tracked `x2w-budget` categories (live + retained, all six) against process commit, from the last menu sample (20 s) to the last sample: | | Tracked categories | Process commit | Not tracked | |---|---:|---:|---:| | C, 20 → 50 s | 9,370 → 15,936 (+6,566) | 12,153 → 19,505 (+7,352) | about +0.8 GiB | | D, 20 → 140 s | 9,400 → 13,644 (+4,244) | 12,151 → 19,470 (+7,319) | about +3.0 GiB | With the release on, the tracked categories peak early (13,896 at 30 s) and then stay roughly flat, while process commit keeps rising for another 110 s. The physical-page section count stayed at 113,609 throughout in both arms. So once retained textures are released, most of the remaining growth to the cap is outside the six budget categories and outside the xmem section count. It could be title heap memory, the stand-ins' own heaps or driver allocations; these runs have no counter for it. At the stop, arm D's retire-reasons line still held 484 MiB: 5,163 buffers (339 MiB, outside the release class), 11 render-target, depth or UAV resources (144 MiB), 4 of another dimension (0.25 MiB) and 1 texture with a live view (1.4 MiB). Upload buffers grew 626 → 982 MiB over the same interval. One run per arm. 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:33:37Z.


The f4c6998a pair gives us a useful split. The release options lowered retained committed textures from 3,563 to 143 MiB and extended this run from 69.7 to 155.2 s. Both arms still hit the 20 GiB process-job cap at slot 133 texture placement with E_OUTOFMEMORY. The section count was unchanged and neither arm forwarded indirect work. I’m keeping this open for the roughly 3 GiB growth outside the tracked categories in the release-on arm. The results in #2379 establish lower retention, with the live-view lifetime guarantee still in force.

For a follow-up, one bounded release-on run can use the existing budget timeline as its anchor. At two comparable loading landmarks, record the committed-byte deltas for private heap and mapped regions separately, and the first large growing aggregate if the sampler can identify it. Keep paths, addresses and raw captures local. That would help aim the next source-built allocation fixture at a specific class.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179894177 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7179894177). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:33:37Z. --- The `f4c6998a` pair gives us a useful split. The release options lowered retained committed textures from 3,563 to 143 MiB and extended this run from 69.7 to 155.2 s. Both arms still hit the 20 GiB process-job cap at slot 133 texture placement with `E_OUTOFMEMORY`. The section count was unchanged and neither arm forwarded indirect work. I’m keeping this open for the roughly 3 GiB growth outside the tracked categories in the release-on arm. The results in #2379 establish lower retention, with the live-view lifetime guarantee still in force. For a follow-up, one bounded release-on run can use the existing budget timeline as its anchor. At two comparable loading landmarks, record the committed-byte deltas for private heap and mapped regions separately, and the first large growing aggregate if the sampler can identify it. Keep paths, addresses and raw captures local. That would help aim the next source-built allocation fixture at a specific class.
Not-Saii commented 2026-11-26 02:05:12 +00:00 (Migrated from github.com)
Author
Contributor

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


One bounded release-on run with the split you asked for. Same setup as arm D of the f4c6998a pair: 20 GiB cap, X2W_D3D12_RELEASE_RETIRED=1, X2W_D3D12_RELEASE_RETIRED_VIEWS=1, X2W_D3D12_RETIRE_REASONS=1 and X2W_D3D12_BUDGET=1, lazy commit off, the same profile and cache snapshots and the same scripted input.

Sampler. A separate process walked the title's address space with VirtualQueryEx every 5 s. It read no memory contents. It summed committed bytes by region type (private, mapped, image) and kept per-allocation committed bytes for allocations of 1 MiB or more. A walk took 0.6-1.4 s. Private here is committed MEM_PRIVATE; it runs about 0.2-0.5 GiB below the private-bytes counter, which also includes copy-on-write image pages. Process heaps were matched by base address from the toolhelp heap list. That matched only about 1 MiB, so I cannot separate heap from other private allocations from outside the process. In what follows, "private" means all MEM_PRIVATE.

Alignment. Process seconds. Matching process commit puts the DirectStorage heartbeat clock about 6-8 s behind process time in this run. Landmark 1 is the last menu sample before the loading step (25.9 s). Landmark 2 is where commit levels off after that step (51.5 s). The run stopped at 173.6 s. The last sample before the stop was at 171.7 s.

MiB 25.9 s 51.5 s 171.7 s
Private (MEM_PRIVATE) 12,049 16,515 (+4,466) 19,794 (+3,279)
Mapped (MEM_MAPPED) 10,692 13,857 (+3,165) 13,929 (+72)
Image 506 507 507
Physical-page sections (heartbeat) 113,609 113,609 113,609

The mapped views are all under 1 MiB: about 170,000 at the first landmark, 221,000 at the second and 222,000 at the end. The added views appear while the section count stays the same, so they look like more views of existing sections (for example the GPU-view mirror). Their commit is charged to the sections, not to process private commit.

Private growth by allocation (allocations of at least 1 MiB):

  • 25.9 → 51.5 s, +4.5 GiB: 247 new allocations and no growth inside existing ones. By size: 113 of 16-64 MiB (3,067 MiB in total, most of them 32 MiB), 119 of 4-16 MiB (1,127 MiB), one of 112 MiB and 14 of 1-4 MiB.
  • 51.5 → 171.7 s, +3.3 GiB: 97 new allocations (2,365 MiB), including a single 851 MiB allocation that first appears at 136.8 s, one of 128 MiB, 22 of 16-64 MiB and 65 of 4-16 MiB. Existing allocations also committed about 1.2 GiB more inside their reservations. Three allocations (118 MiB) went away.
  • Allocations under 1 MiB stayed at about 20 MiB throughout.

So the first large growing aggregate is a burst of new 4-64 MiB private allocations (mostly 32 MiB) at the loading step. After that the largest single item is one 851 MiB allocation. I cannot attribute either to a module from outside the process. Over the first interval, the tracked x2w-budget categories grew by about 3.6 GiB (mostly live committed textures, plus 0.5 GiB of upload buffers), and DXGI local usage rose by about 3.0 GiB at the same time. So the private allocations are probably not the committed textures themselves, but these runs do not show that. A stack for the first 32 MiB and the 851 MiB allocation would be the next step.

Stop. This run did not stop at slot 133 placement. No E_OUTOFMEMORY, 1455 or wrapper failure was logged. At 173.6 s an unhandled C++ exception was thrown from d3d12_xs.dll, and its throw information names std::bad_alloc. Private bytes were 19,980 MiB (cap 20,480). So a C++ allocation inside the stand-in failed at the cap and the exception left the stand-in uncaught, which is a separate error-handling gap next to #2656. The run forwarded no ExecuteIndirect work; 7.1 M mesh and 2.3 M compute dispatches were refused.

The sampler and the per-allocation data stay local. One run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180066740 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7180066740). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-26T01:43:50Z. --- One bounded release-on run with the split you asked for. Same setup as arm D of the `f4c6998a` pair: 20 GiB cap, `X2W_D3D12_RELEASE_RETIRED=1`, `X2W_D3D12_RELEASE_RETIRED_VIEWS=1`, `X2W_D3D12_RETIRE_REASONS=1` and `X2W_D3D12_BUDGET=1`, lazy commit off, the same profile and cache snapshots and the same scripted input. **Sampler.** A separate process walked the title's address space with `VirtualQueryEx` every 5 s. It read no memory contents. It summed committed bytes by region type (private, mapped, image) and kept per-allocation committed bytes for allocations of 1 MiB or more. A walk took 0.6-1.4 s. Private here is committed `MEM_PRIVATE`; it runs about 0.2-0.5 GiB below the private-bytes counter, which also includes copy-on-write image pages. Process heaps were matched by base address from the toolhelp heap list. That matched only about 1 MiB, so I cannot separate heap from other private allocations from outside the process. In what follows, "private" means all `MEM_PRIVATE`. **Alignment.** Process seconds. Matching process commit puts the DirectStorage heartbeat clock about 6-8 s behind process time in this run. Landmark 1 is the last menu sample before the loading step (25.9 s). Landmark 2 is where commit levels off after that step (51.5 s). The run stopped at 173.6 s. The last sample before the stop was at 171.7 s. | MiB | 25.9 s | 51.5 s | 171.7 s | |---|---:|---:|---:| | Private (`MEM_PRIVATE`) | 12,049 | 16,515 (+4,466) | 19,794 (+3,279) | | Mapped (`MEM_MAPPED`) | 10,692 | 13,857 (+3,165) | 13,929 (+72) | | Image | 506 | 507 | 507 | | Physical-page sections (heartbeat) | 113,609 | 113,609 | 113,609 | The mapped views are all under 1 MiB: about 170,000 at the first landmark, 221,000 at the second and 222,000 at the end. The added views appear while the section count stays the same, so they look like more views of existing sections (for example the GPU-view mirror). Their commit is charged to the sections, not to process private commit. **Private growth by allocation (allocations of at least 1 MiB):** - **25.9 → 51.5 s, +4.5 GiB:** 247 new allocations and no growth inside existing ones. By size: 113 of 16-64 MiB (3,067 MiB in total, most of them 32 MiB), 119 of 4-16 MiB (1,127 MiB), one of 112 MiB and 14 of 1-4 MiB. - **51.5 → 171.7 s, +3.3 GiB:** 97 new allocations (2,365 MiB), including a single **851 MiB** allocation that first appears at 136.8 s, one of 128 MiB, 22 of 16-64 MiB and 65 of 4-16 MiB. Existing allocations also committed about 1.2 GiB more inside their reservations. Three allocations (118 MiB) went away. - Allocations under 1 MiB stayed at about 20 MiB throughout. So the first large growing aggregate is a burst of new 4-64 MiB private allocations (mostly 32 MiB) at the loading step. After that the largest single item is one 851 MiB allocation. I cannot attribute either to a module from outside the process. Over the first interval, the tracked `x2w-budget` categories grew by about 3.6 GiB (mostly live committed textures, plus 0.5 GiB of upload buffers), and DXGI local usage rose by about 3.0 GiB at the same time. So the private allocations are probably not the committed textures themselves, but these runs do not show that. A stack for the first 32 MiB and the 851 MiB allocation would be the next step. **Stop.** This run did not stop at slot 133 placement. No `E_OUTOFMEMORY`, 1455 or wrapper failure was logged. At 173.6 s an unhandled C++ exception was thrown from `d3d12_xs.dll`, and its throw information names `std::bad_alloc`. Private bytes were 19,980 MiB (cap 20,480). So a C++ allocation inside the stand-in failed at the cap and the exception left the stand-in uncaught, which is a separate error-handling gap next to #2656. The run forwarded no `ExecuteIndirect` work; 7.1 M mesh and 2.3 M compute dispatches were refused. The sampler and the per-allocation data stay local. One run. AI-assisted (Claude Code).
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-26T02:00:39Z.


The two loading landmarks separate the large private allocation burst from the mapped-view growth. After the second landmark the measured private regions grew by another 3,279 MiB while mapped regions grew by 72 MiB and the section count held. The final std::bad_alloc is a different first error from the prior slot-133 and wrapper failures. This sample does not yet identify the 32 MiB allocations or the 851 MiB allocation.

For the next bounded replay, the highest-value evidence is the first repo-owned caller above the failing allocation and whether it escapes an exported call or a worker entry. If available, include only symbol names for a representative 32 MiB allocation and the 851 MiB allocation. Keep stacks with addresses and raw traces local. Those names will let us target allocation failure injection and verify the caller's output and lifetime rules, as #2656 did for wrappers.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180368717 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7180368717). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T02:00:39Z. --- The two loading landmarks separate the large private allocation burst from the mapped-view growth. After the second landmark the measured private regions grew by another 3,279 MiB while mapped regions grew by 72 MiB and the section count held. The final `std::bad_alloc` is a different first error from the prior slot-133 and wrapper failures. This sample does not yet identify the 32 MiB allocations or the 851 MiB allocation. For the next bounded replay, the highest-value evidence is the first repo-owned caller above the failing allocation and whether it escapes an exported call or a worker entry. If available, include only symbol names for a representative 32 MiB allocation and the 851 MiB allocation. Keep stacks with addresses and raw traces local. Those names will let us target allocation failure injection and verify the caller's output and lifetime rules, as #2656 did for wrappers.
triggered02 commented 2026-11-26 07:00:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T06:46:36Z.


Measured WDDM2 commit behavior and X2W_XMEM_LAZY_COMMIT / X2W_XMEM_LAZY_STARTUP on a 16 GiB Windows 11 host (NVIDIA GeForce GTX 1660 SUPER, driver 32.0.16.1074, DedicatedVRAM=5966 MiB, SysCommitLimit=22931.80 MiB) at e3cf6a91 / e6902a11, and found why 16 GiB hosts still exhaust system commit during heavy startup loads even with the existing lazy switches:

1. Why commit jumps +5 GiB during texture/buffer placement (standalone D3D12 micro-probe)

A standalone x64 probe on the GTX 1660 SUPER measuring GetProcessMemoryInfo().PagefileUsage and GetPerformanceInfo().CommitTotal before/after D3D12 operations shows:

  • CreateCommittedResource(D3D12_HEAP_TYPE_DEFAULT) charges ~1:1 to BOTH PagefileUsage and SysCommit (64 × 8 MiB = 512 MiB textures → Pagefile +514.93 MiB, SysCommit +519.47 MiB, Local +512.00 MiB). Calling Evict() frees Local (-> +0.00 MiB) without releasing any PagefileUsage or SysCommit (+514.93 MiB / +519.47 MiB unchanged). D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT also charges +513.01 MiB Pagefile / +513.68 MiB SysCommit immediately at CreateHeap time.
  • Tiny committed buffers pay a 64 KiB floor in Local, Pagefile, and SysCommit (512 × 4 KiB = 2 MiB logical → Local +32.00 MiB, Pagefile +33.89 MiB, SysCommit +31.70 MiB). Suballocating in a single buffer drops this to +2.00 MiB.
  • OpenExistingHeapFromAddress pins 100% of the allocation in WorkingSetSize and DXGI NonLocal even on untouched MEM_COMMIT pages (256 MiB VirtualAlloc with WS +0.00 MiB → immediately WS +256.03 MiB, NonLocal +256.00 MiB on OpenExistingHeapFromAddress).

2. Specific remaining XMem/D3D12 gaps found in code

  1. commit_startup_block disables X2W_XMEM_LAZY_STARTUP when X2W_XMEM_STARTUP_BELOW_40=1 is active (src/xmem_mapped_pages.cpp:1788, !below_40), leaving 0x283 large-page pool blocks eagerly committed up front.
  2. slot 133 calls x2w_local::commit_lazy_block(address) unconditionally (src/startup_stubs/d3d12_xs_device.cpp:4958) before checking (offset & 0xFFFF) == 0 && range.covered && range.type == MEM_PRIVATE, forcing whole multi-GiB lazy startup blocks to commit in full even when a tiny unaligned buffer falls back to CreateCommittedResource.
  3. Empty physical-page slabs (4096 × 64 KiB = 256 MiB SEC_RESERVE) never close their section handle on XMemFreePhysicalPages (src/xmem_slab_slots.h, src/xmem_mapped_pages.cpp), pinning commit at the high-water mark until process exit.
  4. Comparison with/without X2W_XMEM_LAZY_COMMIT=1 + X2W_XMEM_LAZY_STARTUP=1 + X2W_XMEM_SHARED_VIEWS=1 on e6902a11 (same 16 GiB host): early PagefileUsage dropped from 6,736–6,847 MiB down to 3,875–4,991 MiB (-1.9 to -2.9 GiB), then jumped +5,149 MiB (5,912 -> 11,061 MiB) as soon as slot 133 created ~4.16 GiB of read-only textures and ~900 MiB of un-aliased committed buffers (while textures uploaded stayed 0).

Filing separate narrow issues for the D3D12 lazy-texture and slot 133 heap-cap slices, and working on the XMem below_40 lazy + slab reclamation slice under #1199.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184770771 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7184770771). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T06:46:36Z. --- Measured WDDM2 commit behavior and `X2W_XMEM_LAZY_COMMIT` / `X2W_XMEM_LAZY_STARTUP` on a 16 GiB Windows 11 host (NVIDIA GeForce GTX 1660 SUPER, driver `32.0.16.1074`, `DedicatedVRAM=5966 MiB`, `SysCommitLimit=22931.80 MiB`) at `e3cf6a91` / `e6902a11`, and found why 16 GiB hosts still exhaust system commit during heavy startup loads even with the existing lazy switches: ### 1. Why commit jumps +5 GiB during texture/buffer placement (standalone D3D12 micro-probe) A standalone x64 probe on the GTX 1660 SUPER measuring `GetProcessMemoryInfo().PagefileUsage` and `GetPerformanceInfo().CommitTotal` before/after D3D12 operations shows: - **`CreateCommittedResource(D3D12_HEAP_TYPE_DEFAULT)` charges ~1:1 to BOTH `PagefileUsage` and `SysCommit`** (64 × 8 MiB = 512 MiB textures → `Pagefile +514.93 MiB`, `SysCommit +519.47 MiB`, `Local +512.00 MiB`). Calling `Evict()` frees `Local` (`-> +0.00 MiB`) **without releasing any `PagefileUsage` or `SysCommit`** (`+514.93 MiB` / `+519.47 MiB` unchanged). `D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT` also charges `+513.01 MiB` `Pagefile` / `+513.68 MiB` `SysCommit` immediately at `CreateHeap` time. - **Tiny committed buffers pay a 64 KiB floor** in `Local`, `Pagefile`, and `SysCommit` (512 × 4 KiB = `2 MiB` logical → `Local +32.00 MiB`, `Pagefile +33.89 MiB`, `SysCommit +31.70 MiB`). Suballocating in a single buffer drops this to `+2.00 MiB`. - **`OpenExistingHeapFromAddress` pins 100% of the allocation** in `WorkingSetSize` and DXGI `NonLocal` even on untouched `MEM_COMMIT` pages (`256 MiB` `VirtualAlloc` with `WS +0.00 MiB` → immediately `WS +256.03 MiB`, `NonLocal +256.00 MiB` on `OpenExistingHeapFromAddress`). ### 2. Specific remaining XMem/D3D12 gaps found in code 1. **`commit_startup_block` disables `X2W_XMEM_LAZY_STARTUP` when `X2W_XMEM_STARTUP_BELOW_40=1` is active** (`src/xmem_mapped_pages.cpp:1788`, `!below_40`), leaving `0x283` large-page pool blocks eagerly committed up front. 2. **`slot 133` calls `x2w_local::commit_lazy_block(address)` unconditionally** (`src/startup_stubs/d3d12_xs_device.cpp:4958`) before checking `(offset & 0xFFFF) == 0 && range.covered && range.type == MEM_PRIVATE`, forcing whole multi-GiB lazy startup blocks to commit in full even when a tiny unaligned buffer falls back to `CreateCommittedResource`. 3. **Empty physical-page slabs (`4096 × 64 KiB` = 256 MiB `SEC_RESERVE`) never close their section handle** on `XMemFreePhysicalPages` (`src/xmem_slab_slots.h`, `src/xmem_mapped_pages.cpp`), pinning commit at the high-water mark until process exit. 4. **Comparison with/without `X2W_XMEM_LAZY_COMMIT=1` + `X2W_XMEM_LAZY_STARTUP=1` + `X2W_XMEM_SHARED_VIEWS=1`** on `e6902a11` (same 16 GiB host): early `PagefileUsage` dropped from `6,736–6,847 MiB` down to `3,875–4,991 MiB` (`-1.9` to `-2.9 GiB`), then jumped `+5,149 MiB` (`5,912 -> 11,061 MiB`) as soon as `slot 133` created ~4.16 GiB of read-only textures and ~900 MiB of un-aliased committed buffers (while `textures uploaded` stayed `0`). Filing separate narrow issues for the D3D12 lazy-texture and `slot 133` heap-cap slices, and working on the XMem `below_40` lazy + slab reclamation slice under `#1199`.
R0Y00 commented 2026-11-26 08:01:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:35:35Z.


#2770 landed at f30a9e3a. The source-built below-40 startup block stayed reserved until touch, the synthetic slab returned 64 MiB of system commit in one serial run, and the in-flight lease regressions passed on WARP and RTX. This gives #1199 a matched replay to run on the existing 16 GiB report host. If you can, keep the save, adapter, page-file limit and other startup switches fixed. Compare the old and new builds with the same lazy-memory flags. Report commit immediately before and after each existing loading landmark, whether slab/slot counts fall after release, and the first failing call or last verified stage in each run. A run without the new lazy flags is the control for the startup-block part. Keep raw traces local. The slot-133 changes in #2764 and #2765 remain separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185622886 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7185622886). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T07:35:35Z. --- #2770 landed at f30a9e3a. The source-built below-40 startup block stayed reserved until touch, the synthetic slab returned 64 MiB of system commit in one serial run, and the in-flight lease regressions passed on WARP and RTX. This gives #1199 a matched replay to run on the existing 16 GiB report host. If you can, keep the save, adapter, page-file limit and other startup switches fixed. Compare the old and new builds with the same lazy-memory flags. Report commit immediately before and after each existing loading landmark, whether slab/slot counts fall after release, and the first failing call or last verified stage in each run. A run without the new lazy flags is the control for the startup-block part. Keep raw traces local. The slot-133 changes in #2764 and #2765 remain separate.
R0Y00 commented 2026-11-26 10:04:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T09:30:05Z.


The 16 GiB report now includes a main-only run at d1b2be6a. On the GTX 1660 SUPER host, it reported 180 seconds, 3,260 storage requests, a peak host commit of 11,053 MiB, and zero mapping-failure/device-removal/out-of-memory lines during that window. Original report in #2780

The 8,787 MiB number comes from a separate 300-second experiment with additional changes and the existing-heap cap enabled. #2775 has landed with that cap opt-in because the default needs to preserve alias-backed consumers. Please keep this issue open until a matched same-window replay on the 16 GiB host verifies the loading boundary with the cap unset. The cap-on run can remain a separate pressure comparison with its publication limits called out.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7188074449 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7188074449). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T09:30:05Z. --- The 16 GiB report now includes a main-only run at d1b2be6a. On the GTX 1660 SUPER host, it reported 180 seconds, 3,260 storage requests, a peak host commit of 11,053 MiB, and zero mapping-failure/device-removal/out-of-memory lines during that window. [Original report in #2780](https://github.com/R0Y00/Xbox2Windows/pull/2780#issuecomment-7187587300) The 8,787 MiB number comes from a separate 300-second experiment with additional changes and the existing-heap cap enabled. #2775 has landed with that cap opt-in because the default needs to preserve alias-backed consumers. Please keep this issue open until a matched same-window replay on the 16 GiB host verifies the loading boundary with the cap unset. The cap-on run can remain a separate pressure comparison with its publication limits called out.
JVProg commented 2026-11-26 10:04:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-26T09:57:26Z.


@roansystemlabs Thanks for asking. I plan to do this one myself.

From reading note_view on main (b2cf7dc5), without running anything yet: besides view_records and view_ids, view_materialized also grows, so I plan to inject a failure there too. view_ids can also allocate on an ordinary insert, not only on a rehash.

Plan:

  • A bounded, opt-in injection for each allocation site, one at a time.
  • After each failure, check that earlier IDs are still readable, no partial entry is left, and a later valid descriptor is published.
  • Re-run the #2613 census checks and the DirectStorage allocation-failure checks.
  • Negative control: the same fixture without the fix must fail.

The Create*View calls return void, so my plan is to report the failure as a named log line. I also need to check what the destination descriptor slot and the resource lifetime tracking should hold after a failed publication.

I will test on WARP and an RX 9070 XT. I don't have an RTX 3070. The matched commit-budget replay stays separate and is not part of this change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7188707851 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7188707851). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-26T09:57:26Z. --- @roansystemlabs Thanks for asking. I plan to do this one myself. From reading `note_view` on `main` (`b2cf7dc5`), without running anything yet: besides `view_records` and `view_ids`, `view_materialized` also grows, so I plan to inject a failure there too. `view_ids` can also allocate on an ordinary insert, not only on a rehash. Plan: - A bounded, opt-in injection for each allocation site, one at a time. - After each failure, check that earlier IDs are still readable, no partial entry is left, and a later valid descriptor is published. - Re-run the #2613 census checks and the DirectStorage allocation-failure checks. - Negative control: the same fixture without the fix must fail. The `Create*View` calls return `void`, so my plan is to report the failure as a named log line. I also need to check what the destination descriptor slot and the resource lifetime tracking should hold after a failed publication. I will test on WARP and an RX 9070 XT. I don't have an RTX 3070. The matched commit-budget replay stays separate and is not part of this change. AI-assisted (Claude Code).
SimSalabimse commented 2026-11-26 14:00:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T13:56:57Z.


Data point from a second machine (Windows 11 25H2 26200, MSVC 19.42, dev preset, NVIDIA GeForce RTX 4070 Ti driver 621.35 / 32.0.16.2135, hardware backend). With the default run.ps1 job cap (-MemoryGiB 14), process commit (PagefileUsage) reached 12.8 GB at 110 s with 113,609 live physical-page sections. At about 125 s CreatePlacedResourceX returned E_OUTOFMEMORY, DirectStorage requests failed with out of memory and the page-batch mapping (queue slot 31) returned 0x800705af. On a build before #2727 this ended in a null wrapper write in the memory-SRV path; #2727 removes that crash.

The same input with -MemoryGiB 24 on 7256cecf (with #2823 reverted locally, see #2837) had 0 out-of-memory failures, and process commit peaked at 17,563 MiB at 230 s. Adding -StartupBelow40 (#1758) the run reached the 900 s limit with no stop. So on this machine the 14 GiB default cap is the limit, and the loading phase needs roughly 17–18 GiB of commit.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7194061222 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7194061222). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T13:56:57Z. --- Data point from a second machine (Windows 11 25H2 26200, MSVC 19.42, dev preset, NVIDIA GeForce RTX 4070 Ti driver 621.35 / 32.0.16.2135, hardware backend). With the default `run.ps1` job cap (`-MemoryGiB 14`), process commit (`PagefileUsage`) reached 12.8 GB at 110 s with 113,609 live physical-page sections. At about 125 s `CreatePlacedResourceX` returned `E_OUTOFMEMORY`, DirectStorage requests failed with out of memory and the page-batch mapping (queue slot 31) returned `0x800705af`. On a build before #2727 this ended in a null wrapper write in the memory-SRV path; #2727 removes that crash. The same input with `-MemoryGiB 24` on `7256cecf` (with #2823 reverted locally, see #2837) had 0 out-of-memory failures, and process commit peaked at 17,563 MiB at 230 s. Adding `-StartupBelow40` (#1758) the run reached the 900 s limit with no stop. So on this machine the 14 GiB default cap is the limit, and the loading phase needs roughly 17–18 GiB of commit. AI-Assisted
Not-Saii commented 2026-11-27 16:33:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-27T16:33:34Z.


Follow-up to my sampler comment and to the request for the owners of the 851 MiB allocation and of a 32 MiB one. I still have no stacks. Both attributions below rest on other evidence, described with each.

Setup. de1595b9, Release stand-ins, Windows 11 build 26300.9974, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), 32 GB host, commit limit 49.7 GiB. Switches: -Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000, 24 GiB job cap, lazy commit off, X2W_D3D12_BUDGET=1, X2W_D3D12_DEBUG not set. Warm shader cache and the same scripted input in every run. Times are process seconds.

Run Length Difference
A 210 s baseline
B 210 s A plus X2W_D3D12_RELEASE_RETIRED=1 and X2W_D3D12_RETIRE_REASONS=1
C 270 s as B, with the memory reader described below
D 250 s as C

All four ran to their time limit and logged no E_OUTOFMEMORY.

The 851 MiB allocation is view_records. In runs C and D a second local process waited until the block had kept its size for two samples, then read 512 bytes from 64 MiB into it. The bytes are records of 112 bytes, and every field lines up with ViewRecord in d3d12_capture.inl, whose size is also 112:

  • id counts up by one per record and equals the record's index in the block;
  • slot is 18 in every record read;
  • desc_bytes is 40;
  • desc holds a buffer SRV description with the default component mapping.

The block grows the way an MSVC vector does. In run C it was 252 MiB at 90 s, 378 MiB at 107 s and 567 MiB at 131 s, and in run D it was 851 MiB at 235 s. Each step is 1.5 times the one before, and old and new blocks both exist while the records are copied. From the two steps in run C the list passed 2.36 million records at about 107 s and 3.54 million at about 131 s, which is roughly 49,000 new records a second (the sampler ticks every 5 to 6 s, so that rate is approximate).

In the bytes read, consecutive records name the same resource and differ in the first element of the buffer view. Those are distinct descriptions, so the shared-id rule in note_view does not merge them. I did not run X2W_D3D12_VIEW_CENSUS, so I have by-slot counts only for the two 512-byte samples, not for the whole list.

The reader also searched the process for pointers to the first 256 bytes of the block and found none. The first page of the block was not readable, so the vector's data probably begins further in than I searched. The attribution therefore rests on the record layout alone.

The 16–256 MiB private allocations add up to the adapter memory in use. Run A, with the same kind of outside sampler as in my earlier comment (15 s interval), set against the x2w-budget line nearest in time:

Process time Private allocations of 16–256 MiB (MiB) local + nonlocal minus the explicit heap (MiB)
30 s 4,397 4,489
60 s 13,288 13,211
120 s 14,623 14,690
195 s 15,607 15,403

The explicit heap (1,277 MiB, one object) is subtracted because it appears as its own allocation above 256 MiB. Over the whole run the two columns stay within about 0.3 GiB of each other. This is a fit from one run, and it agrees with the probe result above that default-heap committed resources charge PagefileUsage one for one. I did not take a stack for a single 32 MiB allocation. It does correct my earlier guess that the private allocations were "probably not the committed textures themselves".

Release pair, A against B. Last sampler row and budget line before the time limit:

MiB A B
Process commit at 195 s 21,805 17,371
texture retained 6,156 (3,650 objects) 1,117 (603 objects)
texture live 5,886 5,723
local 12,989 7,809
nonlocal 3,723 5,373

B uploaded about twice as many textures as A (3,101 against 1,529) and presented 3,884 frames in 204.5 s against 4,156.

The retire line in B attributes everything still held: view-refs 585 objects and 945 MiB, all of them view-refs-in-visible-heap; never-class:buffer 6,194 and 420 MiB; never-class:rt-ds-uav 14 and 172 MiB; never-class:dimension 4; unattributed 0.

What still grows in B. Commit rose from 15,320 MiB at 90 s to 17,388 MiB at 210 s. Over that stretch nonlocal grew from 4,428 to 5,373 MiB while retained buffers grew by about 0.24 GiB, so most of the nonlocal growth is outside the tracked categories. The private allocations above 256 MiB grew by 851 MiB, which is the view_records block.

Limits. One run per arm, one host, one adapter. The view_records identification comes from memory contents, not from a stack or symbols. I did not measure view_ids or view_materialized. The readers, the dumps and the per-allocation data stay local.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7223401580 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7223401580). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-27T16:33:34Z. --- Follow-up to [my sampler comment](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7180066740) and to the request for the owners of the 851 MiB allocation and of a 32 MiB one. I still have no stacks. Both attributions below rest on other evidence, described with each. **Setup.** `de1595b9`, Release stand-ins, Windows 11 build 26300.9974, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), 32 GB host, commit limit 49.7 GiB. Switches: `-Render -Translate -FakeUser -GpuMirror -StartupBelow40 -ContinueAsserts 1000`, 24 GiB job cap, lazy commit off, `X2W_D3D12_BUDGET=1`, `X2W_D3D12_DEBUG` not set. Warm shader cache and the same scripted input in every run. Times are process seconds. | Run | Length | Difference | |---|---|---| | A | 210 s | baseline | | B | 210 s | A plus `X2W_D3D12_RELEASE_RETIRED=1` and `X2W_D3D12_RETIRE_REASONS=1` | | C | 270 s | as B, with the memory reader described below | | D | 250 s | as C | All four ran to their time limit and logged no `E_OUTOFMEMORY`. **The 851 MiB allocation is `view_records`.** In runs C and D a second local process waited until the block had kept its size for two samples, then read 512 bytes from 64 MiB into it. The bytes are records of 112 bytes, and every field lines up with `ViewRecord` in `d3d12_capture.inl`, whose size is also 112: - `id` counts up by one per record and equals the record's index in the block; - `slot` is 18 in every record read; - `desc_bytes` is 40; - `desc` holds a buffer SRV description with the default component mapping. The block grows the way an MSVC vector does. In run C it was 252 MiB at 90 s, 378 MiB at 107 s and 567 MiB at 131 s, and in run D it was 851 MiB at 235 s. Each step is 1.5 times the one before, and old and new blocks both exist while the records are copied. From the two steps in run C the list passed 2.36 million records at about 107 s and 3.54 million at about 131 s, which is roughly 49,000 new records a second (the sampler ticks every 5 to 6 s, so that rate is approximate). In the bytes read, consecutive records name the same resource and differ in the first element of the buffer view. Those are distinct descriptions, so the shared-id rule in `note_view` does not merge them. I did not run `X2W_D3D12_VIEW_CENSUS`, so I have by-slot counts only for the two 512-byte samples, not for the whole list. The reader also searched the process for pointers to the first 256 bytes of the block and found none. The first page of the block was not readable, so the vector's data probably begins further in than I searched. The attribution therefore rests on the record layout alone. **The 16–256 MiB private allocations add up to the adapter memory in use.** Run A, with the same kind of outside sampler as in my earlier comment (15 s interval), set against the `x2w-budget` line nearest in time: | Process time | Private allocations of 16–256 MiB (MiB) | `local` + `nonlocal` minus the explicit heap (MiB) | |---|---:|---:| | 30 s | 4,397 | 4,489 | | 60 s | 13,288 | 13,211 | | 120 s | 14,623 | 14,690 | | 195 s | 15,607 | 15,403 | The explicit heap (1,277 MiB, one object) is subtracted because it appears as its own allocation above 256 MiB. Over the whole run the two columns stay within about 0.3 GiB of each other. This is a fit from one run, and it agrees with [the probe result above](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7184770771) that default-heap committed resources charge `PagefileUsage` one for one. I did not take a stack for a single 32 MiB allocation. It does correct my earlier guess that the private allocations were "probably not the committed textures themselves". **Release pair, A against B.** Last sampler row and budget line before the time limit: | MiB | A | B | |---|---:|---:| | Process commit at 195 s | 21,805 | 17,371 | | `texture` retained | 6,156 (3,650 objects) | 1,117 (603 objects) | | `texture` live | 5,886 | 5,723 | | `local` | 12,989 | 7,809 | | `nonlocal` | 3,723 | 5,373 | B uploaded about twice as many textures as A (3,101 against 1,529) and presented 3,884 frames in 204.5 s against 4,156. The retire line in B attributes everything still held: `view-refs` 585 objects and 945 MiB, all of them `view-refs-in-visible-heap`; `never-class:buffer` 6,194 and 420 MiB; `never-class:rt-ds-uav` 14 and 172 MiB; `never-class:dimension` 4; `unattributed` 0. **What still grows in B.** Commit rose from 15,320 MiB at 90 s to 17,388 MiB at 210 s. Over that stretch `nonlocal` grew from 4,428 to 5,373 MiB while retained buffers grew by about 0.24 GiB, so most of the `nonlocal` growth is outside the tracked categories. The private allocations above 256 MiB grew by 851 MiB, which is the `view_records` block. **Limits.** One run per arm, one host, one adapter. The `view_records` identification comes from memory contents, not from a stack or symbols. I did not measure `view_ids` or `view_materialized`. The readers, the dumps and the per-allocation data stay local. AI-assisted (Claude Code).
JVProg commented 2026-11-27 18:59:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-27T18:59:32Z.


The note_view recovery from #2799 ran in a startup run of the main executable, and the process kept running.

Setup: 429f11d5, release preset. Windows 11 build 26300.9974, default adapter (the PC has an RX 9070 XT, driver 32.0.32029.2010, and a Radeon iGPU; the log does not name the one used), D3D12 debug layer not enabled. run.ps1 with -Seconds 0 -Render -Translate -FakeUser -ContinueAsserts 1000 -GpuMirror -MemoryGiB 30 -StartupBelow40, and X2W_XMEM_LAZY_COMMIT, X2W_XMEM_LAZY_STARTUP, X2W_D3D12_RELEASE_RETIRED, X2W_D3D12_BUDGET and X2W_D3D12_RING_RELEASE_AT_SUBMIT set to 1. Re-keyed shader cache, kept from earlier runs. One run.

Observed:

  • From 741 s the log shows x2w-d3d12 note_view: out of memory in view_records -> view of slot 18 not recorded, destination descriptor untracked (8 lines; this message is capped at 8).
  • The process did not crash. I ended it with the stop file at 787.6 s.
  • In that period the debugger logged 448,366 first-chance C++ exceptions. Their ThrowInfo in d3d12_xs.dll names std::bad_alloc.
  • views distinct stayed at 17,937,983 for the last nine 5 s reports, while views noted kept rising. That number is one of the view_records capacity steps. The next one, 26,906,975 records of 112 bytes, needs a 2,874 MiB block. The last heartbeat showed 28,024 MiB current commit, and the job peak was 30,923 MiB against a 30,720 MiB cap (I infer that the peak includes the refused request).

Where the exceptions come from: first-chance events carry no stack. One thread was inside a throw in the thread dump taken at the stop: operator new → store_view (d3d12_capture.inl:388, the view_records growth) → note_view. I resolved it with a separate PDB build of the same commit (.text has the same size and differs in 188 bytes). Together with the frozen count, this points to note_view, but I have not shown it for each of the 448,366 exceptions.

Limits: this shows only that the process survived the failed view allocations. It does not fix the memory growth, and I did not measure the effect of the untracked descriptors or of the exception volume on the picture or on performance. The run lasted only about 46 s after the first of these exceptions.

AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7226077939 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7226077939). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-27T18:59:32Z. --- The `note_view` recovery from #2799 ran in a startup run of the main executable, and the process kept running. **Setup:** `429f11d5`, `release` preset. Windows 11 build 26300.9974, default adapter (the PC has an RX 9070 XT, driver 32.0.32029.2010, and a Radeon iGPU; the log does not name the one used), D3D12 debug layer not enabled. `run.ps1` with `-Seconds 0 -Render -Translate -FakeUser -ContinueAsserts 1000 -GpuMirror -MemoryGiB 30 -StartupBelow40`, and `X2W_XMEM_LAZY_COMMIT`, `X2W_XMEM_LAZY_STARTUP`, `X2W_D3D12_RELEASE_RETIRED`, `X2W_D3D12_BUDGET` and `X2W_D3D12_RING_RELEASE_AT_SUBMIT` set to `1`. Re-keyed shader cache, kept from earlier runs. One run. **Observed:** - From 741 s the log shows `x2w-d3d12 note_view: out of memory in view_records -> view of slot 18 not recorded, destination descriptor untracked` (8 lines; this message is capped at 8). - The process did not crash. I ended it with the stop file at 787.6 s. - In that period the debugger logged 448,366 first-chance C++ exceptions. Their `ThrowInfo` in `d3d12_xs.dll` names `std::bad_alloc`. - `views distinct` stayed at 17,937,983 for the last nine 5 s reports, while `views noted` kept rising. That number is one of the `view_records` capacity steps. The next one, 26,906,975 records of 112 bytes, needs a 2,874 MiB block. The last heartbeat showed 28,024 MiB current commit, and the job peak was 30,923 MiB against a 30,720 MiB cap (I infer that the peak includes the refused request). **Where the exceptions come from:** first-chance events carry no stack. One thread was inside a throw in the thread dump taken at the stop: `operator new` → `store_view` (`d3d12_capture.inl:388`, the `view_records` growth) → `note_view`. I resolved it with a separate PDB build of the same commit (`.text` has the same size and differs in 188 bytes). Together with the frozen count, this points to `note_view`, but I have not shown it for each of the 448,366 exceptions. **Limits:** this shows only that the process survived the failed view allocations. It does not fix the memory growth, and I did not measure the effect of the untracked descriptors or of the exception volume on the picture or on performance. The run lasted only about 46 s after the first of these exceptions. AI was used.
lukaslw-lab commented 2026-11-28 12:54:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-28T12:54:48Z.


Two additions to the view_records growth analysis above, measured on current main (after #3211).

1. CBVs now add about 30% of the new records. #3211 routes the title's CBV creation through the shim. JVProg's census before it had CBV = 0; with it:

X2W_D3D12_VIEW_CENSUS, 250 s CBV (17) SRV (18) UAV/RTV/DSV/sampler
New distinct records 2,061,111 4,710,609 3,026

Each CBV names a new GPU address and size. In a second run, 15% of the new CBV records (233,762 of 1,536,227) differed from an earlier one only in bytes 12–15, which the desktop layout does not use. For buffer SRVs the share was 23% (719,107 of 3,180,798), in line with the 20.3% above.

2. The growth also costs CPU time, on note_lock. Local timers around each acquire and release, 100–175k inflated blocks:

Calls/s Wait (µs) Hold (µs)
note_view, exclusive 137k 3.2 0.8
note_copy, exclusive 60k 3.1 0.5
All sites together ≈ 1.0 thread ≈ 0.27 thread
  • About 90% of note_view calls change the slot (a new record, or another record into the slot), so they need the exclusive lock. The readers (resource_info 222k/s, resolve_title_table 132k/s, placed_buffer_range 120k/s, memory_srv_destination 101k/s) queue behind them.
  • A shared-lock early exit for unchanged calls does not help: 88% of note_copy calls but only ~10% of note_view calls are unchanged. In an A/B/B/A it saved about 0.07 threads, with no fps change.
  • So a record lifetime policy would reduce lock waiting as well as memory.

Setup: main 3926a289 + #3097, Release, Windows 10 22H2, i7-4790K, RTX 3080 Ti, 16 GB. Switches: X2W_PROBE_PRECHECK=0, X2W_D3D12_RELEASE_RETIRED, X2W_D3D12_RING_RELEASE_AT_SUBMIT, X2W_D3D12_TABLE_ALIAS, X2W_D3D12_ROOT_SRV_AT_DRAW, X2W_D3D12_VIEW_TOKEN_GUARDED, X2W_D3D12_BUDGET. Warm shader cache, scripted input. The lock timers and the padding count are local, unpublished patches; the timers slow the run by 1–3 fps, so the absolute µs are a little high. One run per measurement. Counts only.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7239555025 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7239555025). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-28T12:54:48Z. --- Two additions to the `view_records` growth analysis above, measured on current `main` (after #3211). **1. CBVs now add about 30% of the new records.** #3211 routes the title's CBV creation through the shim. JVProg's census before it had CBV = 0; with it: | `X2W_D3D12_VIEW_CENSUS`, 250 s | CBV (17) | SRV (18) | UAV/RTV/DSV/sampler | |---|---:|---:|---:| | New distinct records | 2,061,111 | 4,710,609 | 3,026 | Each CBV names a new GPU address and size. In a second run, 15% of the new CBV records (233,762 of 1,536,227) differed from an earlier one only in bytes 12–15, which the desktop layout does not use. For buffer SRVs the share was 23% (719,107 of 3,180,798), in line with the 20.3% above. **2. The growth also costs CPU time, on `note_lock`.** Local timers around each acquire and release, 100–175k inflated blocks: | | Calls/s | Wait (µs) | Hold (µs) | |---|---:|---:|---:| | `note_view`, exclusive | 137k | 3.2 | 0.8 | | `note_copy`, exclusive | 60k | 3.1 | 0.5 | | All sites together | | ≈ 1.0 thread | ≈ 0.27 thread | - About 90% of `note_view` calls change the slot (a new record, or another record into the slot), so they need the exclusive lock. The readers (`resource_info` 222k/s, `resolve_title_table` 132k/s, `placed_buffer_range` 120k/s, `memory_srv_destination` 101k/s) queue behind them. - A shared-lock early exit for unchanged calls does not help: 88% of `note_copy` calls but only ~10% of `note_view` calls are unchanged. In an A/B/B/A it saved about 0.07 threads, with no fps change. - So a record lifetime policy would reduce lock waiting as well as memory. **Setup:** `main` `3926a289` + #3097, Release, Windows 10 22H2, i7-4790K, RTX 3080 Ti, 16 GB. Switches: `X2W_PROBE_PRECHECK=0`, `X2W_D3D12_RELEASE_RETIRED`, `X2W_D3D12_RING_RELEASE_AT_SUBMIT`, `X2W_D3D12_TABLE_ALIAS`, `X2W_D3D12_ROOT_SRV_AT_DRAW`, `X2W_D3D12_VIEW_TOKEN_GUARDED`, `X2W_D3D12_BUDGET`. Warm shader cache, scripted input. The lock timers and the padding count are local, unpublished patches; the timers slow the run by 1–3 fps, so the absolute µs are a little high. One run per measurement. Counts only. AI-assisted (Claude Code).
lukaslw-lab commented 2026-11-28 16:18:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-28T16:18:23Z.


#3377 adds an opt-in record lifetime for the two views that make up most new records here (buffer SRVs and CBVs): X2W_D3D12_VIEW_CONTENT_TOKENS=1 writes those views into title memory as tokens that carry the view instead of a record id, so a copy the title makes with its own memory copy needs no record, and the record can be freed once no shadow slot names it. Range, format, stride and flags stay in the identity.

250 s startup run, two pairs unset set
view records at the end 6.2–6.4 M 257–266k
process commit at 200k loaded blocks 18.3–18.6 GB 17.0–17.8 GB
fps – unchanged

An 800 s run with it set ended with 388k records and no device removal. Textures and other views keep id tokens and are still never freed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7242138788 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1199#issuecomment-7242138788). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-28T16:18:23Z. --- #3377 adds an opt-in record lifetime for the two views that make up most new records here (buffer SRVs and CBVs): `X2W_D3D12_VIEW_CONTENT_TOKENS=1` writes those views into title memory as tokens that carry the view instead of a record id, so a copy the title makes with its own memory copy needs no record, and the record can be freed once no shadow slot names it. Range, format, stride and flags stay in the identity. | 250 s startup run, two pairs | unset | set | |---|---|---| | view records at the end | 6.2–6.4 M | 257–266k | | process commit at 200k loaded blocks | 18.3–18.6 GB | 17.0–17.8 GB | | fps | – | unchanged | An 800 s run with it set ended with 388k records and no device removal. Textures and other views keep id tokens and are still never freed.
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#1192
No description provided.