D3D12.X: video memory use is high, title memory and textures are mirrored into VRAM #1773

Open
opened 2026-11-26 05:04:31 +00:00 by github-bot · 29 comments
Owner

@⁠1bugproof on GitHub · 2026-11-24 20:31 UTC · original

XCL needs far more video memory than VIctory, another project that runs console titles natively. I compared the two by reading the code, at XCL 4178e88 and VIctory main of 2026-11-24. Nothing here was measured.

Where XCL's video memory goes

  1. All of the title's graphics memory is in VRAM, whether the GPU reads it or not. Every 64 KiB page the title commits in the sparse windows (XMem allocations, physical pages, graphics reservations) is mapped onto a 64 KiB tile of a D3D12_HEAP_TYPE_DEFAULT pool heap (hle/d3d12x/sparse.rs, about line 611). A title that commits 8–10 GB costs about that much VRAM.
  2. Textures placed at title addresses are kept twice.
    • Sampled textures: the console-layout bytes stay in the sparse-window tiles, and a detiled PC copy is made as well, on vram::place_pages pages or as a committed default resource (device_x.rs, about lines 902–926).
    • Render targets, depth buffers and UAV textures: they get their own vram::place pages, and the sparse-window tiles at the same address stay mapped too.
  3. Memory is held back in large blocks.
    • Pool heaps are 64 MB each and go only when all 1024 tiles are free, 2 s later (retire_free_pools).
    • Up to 256 MB of decommitted tiles stay mapped (PARKED_MAX).
    • Arenas for D32S8 / MSAA take about 2.8 GB (HANDOFF.md, "Open: arenas for D32S8 targets").
    • WDDM also charges all of it to the process's commit.

What VIctory does

  • A title buffer gets a host copy only when a draw first uses it (crates/victory-gpu/src/shadow.rs, find). The copy is in system memory, a custom heap with MEMORY_POOL_L0 and write-back pages (host.rs, shared_buffer), not VRAM.
  • Title memory outside buffers is copied in 4 MiB windows, only those that are used.
  • Textures are one committed default resource each (resource.rs, about line 846). There is no second copy of the title's bytes in VRAM.

This is not a like-for-like comparison. VIctory's README says its world does not render yet (frames take 0.5–1.8 s). Its buffers in system memory are likely part of why it is that slow. XCL maps everything because translated shaders reach arbitrary addresses through SGPRs, so it cannot know ahead of time what a shader reads. Point 1 is mostly a design choice.

Possible reductions

  • Point 2: a range of tiles covered only by textures that have their own PC copy does not need sparse-window video memory. Open question: GPU copies or writes to those addresses, which title_textures.rs says are already not seen.
  • D32S8 arenas: split them into R32 plus a separate stencil, or use heaps of the exact size, as HANDOFF.md already suggests.
  • Before choosing between these: run a heavy title with XCL_ACTIVITY=1 to find which part dominates (sparse pools, texture pages or arenas), and add the numbers to this issue.

AI use: the analysis and this text were written with Claude Code (Claude Opus 5.5), from reading both codebases. No runs or measurements were made.

**@⁠1bugproof** on GitHub · 2026-11-24 20:31 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773) XCL needs far more video memory than [VIctory](https://github.com/Marvisak/VIctory), another project that runs console titles natively. I compared the two by reading the code, at XCL `4178e88` and VIctory `main` of 2026-11-24. **Nothing here was measured.** ### Where XCL's video memory goes 1. **All of the title's graphics memory is in VRAM, whether the GPU reads it or not.** Every 64 KiB page the title commits in the sparse windows (XMem allocations, physical pages, graphics reservations) is mapped onto a 64 KiB tile of a `D3D12_HEAP_TYPE_DEFAULT` pool heap (`hle/d3d12x/sparse.rs`, about line 611). A title that commits 8–10 GB costs about that much VRAM. 2. **Textures placed at title addresses are kept twice.** - **Sampled textures:** the console-layout bytes stay in the sparse-window tiles, and a detiled PC copy is made as well, on `vram::place_pages` pages or as a committed default resource (`device_x.rs`, about lines 902–926). - **Render targets, depth buffers and UAV textures:** they get their own `vram::place` pages, and the sparse-window tiles at the same address stay mapped too. 3. **Memory is held back in large blocks.** - Pool heaps are 64 MB each and go only when all 1024 tiles are free, 2 s later (`retire_free_pools`). - Up to 256 MB of decommitted tiles stay mapped (`PARKED_MAX`). - Arenas for D32S8 / MSAA take about 2.8 GB (`HANDOFF.md`, "Open: arenas for D32S8 targets"). - WDDM also charges all of it to the process's commit. ### What VIctory does - A title buffer gets a host copy only when a draw first uses it (`crates/victory-gpu/src/shadow.rs`, `find`). The copy is in system memory, a custom heap with `MEMORY_POOL_L0` and write-back pages (`host.rs`, `shared_buffer`), not VRAM. - Title memory outside buffers is copied in 4 MiB windows, only those that are used. - Textures are one committed default resource each (`resource.rs`, about line 846). There is no second copy of the title's bytes in VRAM. **This is not a like-for-like comparison.** VIctory's README says its world does not render yet (frames take 0.5–1.8 s). Its buffers in system memory are likely part of why it is that slow. XCL maps everything because translated shaders reach arbitrary addresses through SGPRs, so it cannot know ahead of time what a shader reads. Point 1 is mostly a design choice. ### Possible reductions - **Point 2:** a range of tiles covered only by textures that have their own PC copy does not need sparse-window video memory. Open question: GPU copies or writes to those addresses, which `title_textures.rs` says are already not seen. - **D32S8 arenas:** split them into R32 plus a separate stencil, or use heaps of the exact size, as `HANDOFF.md` already suggests. - **Before choosing between these:** run a heavy title with `XCL_ACTIVITY=1` to find which part dominates (sparse pools, texture pages or arenas), and add the numbers to this issue. --- AI use: the analysis and this text were written with Claude Code (Claude Opus 5.5), from reading both codebases. No runs or measurements were made.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:31 +00:00
Author
Owner

@⁠certified-retart on GitHub · 2026-11-24 21:35 UTC · original

Measured XCL_ACTIVITY=1 breakdown on a heavy retail title on an RTX 5070 (12 GB local VRAM, XCL_HEAP_WINDOWS=1):

Phase Process commit Local VRAM Non-local target pages (pools) arenas sparse pools (mapped)
Menus (steady) 14,869 MB 6,488 MB 4,508 MB 3,531 MB (3,584 MB) 318 MB 960 MB
Early 3D world load 30,255 MB 14,837 MB 4,565 MB 9,556 MB (10,176 MB) 318 MB 2,176 MB
Active 3D frames 31,852 MB 15,287 MB 4,629 MB 9,883 MB (10,240 MB) 318 MB 2,432 MB (2,414 MB)

target pages dominates by a wide margin: 10.24 GB of pools (~65% of local VRAM) ? over 4? larger than sparse pools (2.43 GB) and 32? larger than arenas (318 MB). On a 12 GB card this pushes local VRAM ~3.3 GB over budget during world streaming, causing heavy paging slowdown and eventually device removal (0x887a0006).

**@⁠certified-retart** on GitHub · 2026-11-24 21:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7145125626) Measured `XCL_ACTIVITY=1` breakdown on a heavy retail title on an RTX 5070 (12 GB local VRAM, `XCL_HEAP_WINDOWS=1`): | Phase | Process commit | Local VRAM | Non-local | `target pages` (pools) | `arenas` | `sparse pools` (mapped) | |---|---:|---:|---:|---:|---:|---:| | Menus (steady) | 14,869 MB | 6,488 MB | 4,508 MB | 3,531 MB (3,584 MB) | 318 MB | 960 MB | | Early 3D world load | 30,255 MB | 14,837 MB | 4,565 MB | 9,556 MB (10,176 MB) | 318 MB | 2,176 MB | | Active 3D frames | 31,852 MB | 15,287 MB | 4,629 MB | 9,883 MB (10,240 MB) | 318 MB | 2,432 MB (2,414 MB) | `target pages` dominates by a wide margin: **10.24 GB of pools (~65% of local VRAM)** ? over **4? larger than `sparse pools` (2.43 GB)** and **32? larger than `arenas` (318 MB)**. On a 12 GB card this pushes local VRAM ~3.3 GB over budget during world streaming, causing heavy paging slowdown and eventually device removal (`0x887a0006`).
Author
Owner

@⁠rrrarrra9 on GitHub · 2026-11-24 21:56 UTC · original

Windows / GTX 1650 (4 GB) measurements for #1773. Clean main c4d37bec1b completed a 150 s offline startup smoke run with 1,391 PresentX calls and no device removal. At 144.708 s, XCL reported 6,653 MiB DXGI local usage and 1,370 MiB non-local. The tracked allocations were 3,648 MiB texture pools, 960 MiB sparse pools (954 mapped), and 397 MiB arenas.

On clean #1702 head d19ae2e, two fresh 150 s starts of the same title let me isolate the L0 flag. Near 59 s both had 3,584 MiB in texture pools, 896 MiB in sparse pools and 461 MiB in arenas. Local usage went from 6,580 to 2,995 MiB with L0, while non-local went from 1,365 to 4,947 MiB. Process commit was 15,526 vs 15,497 MiB. Both completed without device loss.

A separate synthetic GTX 1650 copy probe verified all bytes and measured a median of 5.12 ms with DEFAULT and 40.19 ms with L0 for 16 copies of a 16 MiB tiled texture into a local texture. This gives a cost for the copy path. Story mode and frame-rate changes remain unverified. #1854 adds an elapsed-time comparison tool for the activity counters.

AI use: OpenAI Codex with gpt-6.2-sol ran the tests and summarized the results.

**@⁠rrrarrra9** on GitHub · 2026-11-24 21:56 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7145603084) Windows / GTX 1650 (4 GB) measurements for #1773. Clean main c4d37bec1bb4286eb373aea963404a23f13401fa completed a 150 s offline startup smoke run with 1,391 PresentX calls and no device removal. At 144.708 s, XCL reported 6,653 MiB DXGI local usage and 1,370 MiB non-local. The tracked allocations were 3,648 MiB texture pools, 960 MiB sparse pools (954 mapped), and 397 MiB arenas. On clean #1702 head d19ae2e, two fresh 150 s starts of the same title let me isolate the L0 flag. Near 59 s both had 3,584 MiB in texture pools, 896 MiB in sparse pools and 461 MiB in arenas. Local usage went from 6,580 to 2,995 MiB with L0, while non-local went from 1,365 to 4,947 MiB. Process commit was 15,526 vs 15,497 MiB. Both completed without device loss. A separate synthetic GTX 1650 copy probe verified all bytes and measured a median of 5.12 ms with DEFAULT and 40.19 ms with L0 for 16 copies of a 16 MiB tiled texture into a local texture. This gives a cost for the copy path. Story mode and frame-rate changes remain unverified. #1854 adds an elapsed-time comparison tool for the activity counters. AI use: OpenAI Codex with gpt-6.2-sol ran the tests and summarized the results.
Author
Owner

@⁠3L1A5-1 on GitHub · 2026-11-24 22:27 UTC · original

Measured on an 8 GB card with 16 GB RAM, with what is resident next to what is committed: the card is full from ~160 s, local video memory past it is demoted to system memory (1.5 GB by the end), and the 64 MB private regions next to every pool heap are commit, not RAM. The Series S profile does not lower any of it.

Setup: RTX 2060 SUPER 8 GB (driver 617.14), i5-9400F, 16 GB RAM, fixed 32 GB page file (commit limit 49 GB), Windows 11 26300, release. Retail 1.0.2.1, Series X profile unless noted, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=3072 (#640), scripted A presses, 600 s runs. Local tree (not for upstream): main 930e8b4 + #1182, #759, #1273, #1278, #1055, #1102, a local change that gives GPU-view page textures video memory only where a page is mapped (A/B on #1102), #562, #1288, #1515, #640, #929, #1405, revert of b8b1f49, local logging. Next to the run, a read-only script sampled the process every 30 s: VirtualQueryEx per allocation, QueryWorkingSetEx for the resident pages, and the GPU Process Memory counters.

One run (XCL_ACTIVITY and the sampler), Series X; it ended at 518 s on the title's int3 at +0x2474606:

s process commit working set GPU dedicated GPU shared XCL local / non-local local − dedicated sparse pools target pages (pools)
64 16.4 GB 10.6 GB 5.5 GB 4.9 GB 5.4 / 4.9 GB 0 1.0 GB 2.7 (2.8) GB
162 26.2 GB 5.4 GB 7.5 GB 5.3 GB 7.6 / 4.9 GB 0.1 GB 2.3 GB 3.1 (3.1) GB
328 29.3 GB 4.6 GB 7.5 GB 6.2 GB 8.2 / 5.4 GB 0.7 GB 2.8 GB 3.1 (3.1) GB
494 30.1 GB 5.6 GB 7.5 GB 7.1 GB 9.0 / 5.4 GB 1.5 GB 3.5 GB 2.9 (3.1) GB
  • GPU dedicated stays at ~7.5 GB from ~160 s, which is the DXGI budget (7.2 GB in #1515's line). From then on "shared" = XCL's non-local + (local − dedicated) to within ~150 MB at every sample, so what does not fit on the card is demoted into system memory: 0 up to 130 s, 1.5 GB at 494 s.
  • With #640's 3 GB budget the target pages stay flat; what keeps growing is the sparse pools (1.0 → 3.5 GB, 95–99 % of their tiles mapped), i.e. the title's own GPU memory (point 1 above).
  • The 64 MB private regions: the process has one 64 MB MEM_PRIVATE region per 64 MB pool heap. At every sample their count is texture page pools / 64 + sparse pools / 64 + 1 (43 at 32 s … 106 at 527 s, 6.8 GB). XCL does not VirtualAlloc them, and both kinds of pool are D3D12_HEAP_TYPE_DEFAULT heaps, so they come from the runtime or driver. They are commit only: 0.05–0.8 GB of the 6.8 GB was resident in any sample. Of the 30 GB process commit, 6.8 GB is these regions, and only 4.6–5.6 GB of the whole process was resident after 160 s; the 49 GB commit limit was never reached, while free RAM sat at 0.5–2 GB for most of the run.
  • This tree's runs end at 393–503 s (3 runs), on 0x8007000e from a command list Close and the title's int3 at +0x72ac (2 runs; once with free RAM at 0.37 GB) or on the +0x23cf683 watchdog (1 run).

Series S profile (device_type = "lockhart", the same tree + #605 + #495, 1 run): it does not help here. The sparse pools are 4.6 GB from 60 s on and stay flat (the title commits its smaller GPU memory at the start), local video memory is 9.0 GB at 400 s (Series X: 8.7–9.2 GB), the target pages are capped at 3 GB in both, and the run ended at 456 s on the same 0x8007000e / +0x72ac.

So on this machine the pressure is the title's own sparse-window memory once the texture pages are capped, not XCL bookkeeping. Point 2 of the issue (textures with a PC copy keeping their sparse tiles) would act on the right part; I have not measured how much of the 3.5 GB that is.

Not tested: AMD; without #640's budget (then target pages dominate, as on the 5070 above); which allocations the sparse tiles under textures with their own PC copy account for.

AI use: Claude Code (Claude Opus 5.5) wrote the sampler, ran the runs, compared the logs and wrote this.

**@⁠3L1A5-1** on GitHub · 2026-11-24 22:27 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7146244998) **Measured on an 8 GB card with 16 GB RAM, with what is resident next to what is committed: the card is full from ~160 s, local video memory past it is demoted to system memory (1.5 GB by the end), and the 64 MB private regions next to every pool heap are commit, not RAM. The Series S profile does not lower any of it.** **Setup:** RTX 2060 SUPER 8 GB (driver 617.14), i5-9400F, 16 GB RAM, fixed 32 GB page file (commit limit 49 GB), Windows 11 26300, release. Retail 1.0.2.1, Series X profile unless noted, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=3072` (#640), scripted A presses, 600 s runs. Local tree (not for upstream): `main` `930e8b4` + #1182, #759, #1273, #1278, #1055, #1102, a local change that gives GPU-view page textures video memory only where a page is mapped (A/B on #1102), #562, #1288, #1515, #640, #929, #1405, revert of `b8b1f49`, local logging. Next to the run, a read-only script sampled the process every 30 s: `VirtualQueryEx` per allocation, `QueryWorkingSetEx` for the resident pages, and the `GPU Process Memory` counters. **One run (`XCL_ACTIVITY` and the sampler), Series X; it ended at 518 s on the title's `int3` at `+0x2474606`:** | s | process commit | working set | GPU dedicated | GPU shared | XCL local / non-local | local − dedicated | sparse pools | target pages (pools) | |---|---|---|---|---|---|---|---|---| | 64 | 16.4 GB | 10.6 GB | 5.5 GB | 4.9 GB | 5.4 / 4.9 GB | 0 | 1.0 GB | 2.7 (2.8) GB | | 162 | 26.2 GB | 5.4 GB | 7.5 GB | 5.3 GB | 7.6 / 4.9 GB | 0.1 GB | 2.3 GB | 3.1 (3.1) GB | | 328 | 29.3 GB | 4.6 GB | 7.5 GB | 6.2 GB | 8.2 / 5.4 GB | 0.7 GB | 2.8 GB | 3.1 (3.1) GB | | 494 | 30.1 GB | 5.6 GB | 7.5 GB | 7.1 GB | 9.0 / 5.4 GB | 1.5 GB | 3.5 GB | 2.9 (3.1) GB | - **GPU dedicated stays at ~7.5 GB from ~160 s**, which is the DXGI budget (7.2 GB in #1515's line). From then on "shared" = XCL's non-local + (local − dedicated) to within ~150 MB at every sample, so what does not fit on the card is demoted into system memory: 0 up to 130 s, 1.5 GB at 494 s. - With #640's 3 GB budget the target pages stay flat; what keeps growing is the **sparse pools** (1.0 → 3.5 GB, 95–99 % of their tiles mapped), i.e. the title's own GPU memory (point 1 above). - **The 64 MB private regions:** the process has one 64 MB `MEM_PRIVATE` region per 64 MB pool heap. At every sample their count is texture page pools / 64 + sparse pools / 64 + 1 (43 at 32 s … 106 at 527 s, 6.8 GB). XCL does not `VirtualAlloc` them, and both kinds of pool are `D3D12_HEAP_TYPE_DEFAULT` heaps, so they come from the runtime or driver. **They are commit only:** 0.05–0.8 GB of the 6.8 GB was resident in any sample. Of the 30 GB process commit, 6.8 GB is these regions, and only 4.6–5.6 GB of the whole process was resident after 160 s; the 49 GB commit limit was never reached, while free RAM sat at 0.5–2 GB for most of the run. - This tree's runs end at 393–503 s (3 runs), on `0x8007000e` from a command list `Close` and the title's `int3` at `+0x72ac` (2 runs; once with free RAM at 0.37 GB) or on the `+0x23cf683` watchdog (1 run). **Series S profile** (`device_type = "lockhart"`, the same tree + #605 + #495, 1 run): it does not help here. The sparse pools are 4.6 GB from 60 s on and stay flat (the title commits its smaller GPU memory at the start), local video memory is 9.0 GB at 400 s (Series X: 8.7–9.2 GB), the target pages are capped at 3 GB in both, and the run ended at 456 s on the same `0x8007000e` / `+0x72ac`. So on this machine the pressure is the title's own sparse-window memory once the texture pages are capped, not XCL bookkeeping. Point 2 of the issue (textures with a PC copy keeping their sparse tiles) would act on the right part; I have not measured how much of the 3.5 GB that is. **Not tested:** AMD; without #640's budget (then target pages dominate, as on the 5070 above); which allocations the sparse tiles under textures with their own PC copy account for. **AI use:** Claude Code (Claude Opus 5.5) wrote the sampler, ran the runs, compared the logs and wrote this.
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 22:37 UTC · original

Same picture on an RTX 3080 Ti 12 GB (driver 610.88, DXGI local budget 11316 MB), GTA VI 1.0.2.1, and a data point for a budget-based fix.

Without a budget (main c4d37be + #433 + #1697 + #1580, 600 s): local video memory reaches 15.1–15.2 GB (target pages ~9990 MB in pools of 10176 MB, sparse pools 2816 MB, arenas 465 MB). Earlier runs at 14.1–14.4 GB had a thread blocked ~28 s in UpdateTileMappings; this one ran to 385 s and ended in D3D12 device removed: 0x887a0007.

Same tree + a budget check (fork branch vladbondarenko97/xcl fix/vram-budget 741cb5a, +74/−5 in vram.rs + README): a new 64 MiB pool heap for title texture pages stays DEFAULT while local usage + the heap + XCL_VRAM_HEADROOM_MB (default 1024, the same meaning as #1515) fits in QueryVideoMemoryInfo's budget, and is made CUSTOM / NOT_AVAILABLE / L0 otherwise (no flag, unlike #1702; heaps already placed stay). Result over 600 s: the first system-memory pool at 90.5 s (local video memory 9954 of 10970 MB budget), local then flat at 11.53–11.56 GB with 9.2 GB non-local, exit 0x0, 0 crashes, 0 device removals for the whole run (2563 frames, nearly all before the world load). Frames in the world are still ~0–1 per 10 s, so this removes the over-commit failure, not the slowness.

I'll open it as a PR once the regression pair (main vs the branch alone) is done; if the #1702 author prefers it folded into #1702 instead, that works too.

AI use: Claude Code (Claude Opus 5.5) traced the memory use, wrote the change and its test, ran the box and wrote this.

**@⁠vladbondarenko97** on GitHub · 2026-11-24 22:37 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7146458916) Same picture on an RTX 3080 Ti 12 GB (driver 610.88, DXGI local budget 11316 MB), GTA VI 1.0.2.1, and a data point for a budget-based fix. **Without a budget** (main `c4d37be` + #433 + #1697 + #1580, 600 s): local video memory reaches 15.1–15.2 GB (target pages ~9990 MB in pools of 10176 MB, sparse pools 2816 MB, arenas 465 MB). Earlier runs at 14.1–14.4 GB had a thread blocked ~28 s in `UpdateTileMappings`; this one ran to 385 s and ended in `D3D12 device removed: 0x887a0007`. **Same tree + a budget check** (fork branch `vladbondarenko97/xcl` `fix/vram-budget` `741cb5a`, +74/−5 in `vram.rs` + README): a new 64 MiB pool heap for title texture pages stays DEFAULT while local usage + the heap + `XCL_VRAM_HEADROOM_MB` (default 1024, the same meaning as #1515) fits in `QueryVideoMemoryInfo`'s budget, and is made CUSTOM / NOT_AVAILABLE / L0 otherwise (no flag, unlike #1702; heaps already placed stay). Result over 600 s: the first system-memory pool at 90.5 s (`local video memory 9954 of 10970 MB budget`), local then flat at 11.53–11.56 GB with 9.2 GB non-local, **exit 0x0, 0 crashes, 0 device removals** for the whole run (2563 frames, nearly all before the world load). Frames in the world are still ~0–1 per 10 s, so this removes the over-commit failure, not the slowness. I'll open it as a PR once the regression pair (main vs the branch alone) is done; if the #1702 author prefers it folded into #1702 instead, that works too. AI use: Claude Code (Claude Opus 5.5) traced the memory use, wrote the change and its test, ran the box and wrote this.
Author
Owner

@⁠3L1A5-1 on GitHub · 2026-11-24 23:21 UTC · original

Follow-up to my measurements above, on point 2 (textures with a PC copy keeping their sparse-window video memory): on this title it applies to physical pages, not to the textures' own addresses, and it reaches ~0.8 GB in the world load.

Same machine, tree and settings as above, plus a local diagnostic (not for a PR) that every 30 s takes the active title_textures ranges (by_va, merged), looks up kernelx::physical_pages for each 64 KiB page under them, and checks whether that page's home is a mapped tile in sparse (State::mapped). One run, ended at 392 s on the +0x72ac stop.

s active textures (on vram pages) texture pages on a physical page / on plain title memory homes of those physical pages on mapped sparse tiles of those, the page lies inside one texture
92 18.3k (17.1k) 11.2k / 56.0k 0 0
153 25.1k (21.5k) 32.8k / 71.5k 0 0
243 25.5k (21.3k) 39.5k / 67.5k 759 MB 668 MB
334 26.0k (21.8k) 40.0k / 71.7k 933 MB 821 MB
364 24.7k (20.0k) 33.9k / 79.4k 806 MB 701 MB
  • No texture's own address range overlapped a mapped sparse tile in any sample (up to 6.6 GB of texture ranges, 3.5 GB of sparse tiles). The title places textures over physical pages it maps there, or in plain title memory, which has no sparse tiles.
  • From ~180 s on, the homes of those physical pages are mapped sparse tiles: up to 933 MB, about a quarter of the 3.46 GB of sparse pools at that point. 700–820 MB of it are pages that lie entirely inside one texture kept in step, so as far as title_textures is concerned the GPU reads those bytes from the texture's PC copy. On this 8 GB card that is about half of what is demoted to system memory by the end (1.5 GB).

What I would try, if it is a direction you would take: unmap a home tile while every page on it lies inside textures kept in step (the tile stays committed for the CPU view and is mapped again before the title's next submit once anything other than such a texture claims it), behind an opt-in switch first, to see whether anything reads the zeros.

The open question, which decides whether it is safe: XCL cannot see a translated shader reading those bytes as a buffer through an SGPR address, and an unmapped tile reads zeros. GPU copies into title memory are seen (list_x's note_gpu_write for CopyMemoryToMemoryX / CopyBufferRegion) and DirectStorage writes through the CPU view, but shader reads are not seen. Is there a reason to expect the title to read its texture memory as buffer data (streaming, decompression, GPU copies into or out of it) that rules this out? If so, I'll leave it at the measurement.

AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the run and wrote this.

**@⁠3L1A5-1** on GitHub · 2026-11-24 23:21 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7147299760) Follow-up to my measurements above, on point 2 (textures with a PC copy keeping their sparse-window video memory): **on this title it applies to physical pages, not to the textures' own addresses, and it reaches ~0.8 GB in the world load.** Same machine, tree and settings as above, plus a local diagnostic (not for a PR) that every 30 s takes the active `title_textures` ranges (`by_va`, merged), looks up `kernelx::physical_pages` for each 64 KiB page under them, and checks whether that page's home is a mapped tile in `sparse` (`State::mapped`). One run, ended at 392 s on the `+0x72ac` stop. | s | active textures (on `vram` pages) | texture pages on a physical page / on plain title memory | homes of those physical pages on mapped sparse tiles | of those, the page lies inside one texture | |---|---|---|---|---| | 92 | 18.3k (17.1k) | 11.2k / 56.0k | 0 | 0 | | 153 | 25.1k (21.5k) | 32.8k / 71.5k | 0 | 0 | | 243 | 25.5k (21.3k) | 39.5k / 67.5k | 759 MB | 668 MB | | 334 | 26.0k (21.8k) | 40.0k / 71.7k | 933 MB | 821 MB | | 364 | 24.7k (20.0k) | 33.9k / 79.4k | 806 MB | 701 MB | - No texture's own address range overlapped a mapped sparse tile in any sample (up to 6.6 GB of texture ranges, 3.5 GB of sparse tiles). The title places textures over physical pages it maps there, or in plain title memory, which has no sparse tiles. - From ~180 s on, the **homes** of those physical pages are mapped sparse tiles: up to 933 MB, about a quarter of the 3.46 GB of sparse pools at that point. 700–820 MB of it are pages that lie entirely inside one texture kept in step, so as far as `title_textures` is concerned the GPU reads those bytes from the texture's PC copy. On this 8 GB card that is about half of what is demoted to system memory by the end (1.5 GB). **What I would try, if it is a direction you would take:** unmap a home tile while every page on it lies inside textures kept in step (the tile stays committed for the CPU view and is mapped again before the title's next submit once anything other than such a texture claims it), behind an opt-in switch first, to see whether anything reads the zeros. **The open question, which decides whether it is safe:** XCL cannot see a translated shader reading those bytes as a buffer through an SGPR address, and an unmapped tile reads zeros. GPU copies into title memory are seen (`list_x`'s `note_gpu_write` for `CopyMemoryToMemoryX` / `CopyBufferRegion`) and DirectStorage writes through the CPU view, but shader reads are not seen. Is there a reason to expect the title to read its texture memory as buffer data (streaming, decompression, GPU copies into or out of it) that rules this out? If so, I'll leave it at the measurement. **AI use:** Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the run and wrote this.
Author
Owner

@⁠rrrarrra9 on GitHub · 2026-11-25 00:14 UTC · original

Hi @⁠vladbondarenko97, thanks for investigating this and sharing the RTX 3080 Ti results. I’m the author of #1702, and I’d be happy to collaborate on the budget-aware policy in your 741cb5a commit.

I think the two changes fit together: keep the manual L0 override for controlled tests, and let an automatic mode choose the memory pool for each new title-texture heap based on the DXGI local budget and a configurable reserve. Keeping existing heaps in place also keeps the scope clear for review.

There’s independent evidence for the L0 path on an RTX 3090 (texture readback) and for lower local memory use on an RTX 4060 Ti and RTX 5060. The RTX 5060 runs still hit a device removal or a watchdog during world load, so I’d measure those separately from memory usage. I can help test on my GTX 1650 (4 GB), comparing default, forced L0, and automatic placement on the same base and settings.

Once your branch-only regression comparison is ready, would you prefer to build on #1702 in a separate follow-up or integrate the changes into #1702? I’m happy to go with whichever makes review easier, and your commits and authorship should be preserved either way.

AI use: OpenAI Codex assisted with reviewing the discussion and drafting this comment.

**@⁠rrrarrra9** on GitHub · 2026-11-25 00:14 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7148297223) Hi @⁠vladbondarenko97, thanks for investigating this and sharing the RTX 3080 Ti results. I’m the author of #1702, and I’d be happy to collaborate on the budget-aware policy in your `741cb5a` commit. I think the two changes fit together: keep the manual L0 override for controlled tests, and let an automatic mode choose the memory pool for each new title-texture heap based on the DXGI local budget and a configurable reserve. Keeping existing heaps in place also keeps the scope clear for review. There’s independent evidence for the L0 path on an RTX 3090 (texture readback) and for lower local memory use on an RTX 4060 Ti and RTX 5060. The RTX 5060 runs still hit a device removal or a watchdog during world load, so I’d measure those separately from memory usage. I can help test on my GTX 1650 (4 GB), comparing default, forced L0, and automatic placement on the same base and settings. Once your branch-only regression comparison is ready, would you prefer to build on #1702 in a separate follow-up or integrate the changes into #1702? I’m happy to go with whichever makes review easier, and your commits and authorship should be preserved either way. AI use: OpenAI Codex assisted with reviewing the discussion and drafting this comment.
Author
Owner

@⁠Fran-co-F on GitHub · 2026-11-25 00:20 UTC · original

Linux / RADV (16 GB card, 32 GB RAM): the overflow goes to GTT, which is RAM, so the system runs out of memory during world load. A data point next to the Windows ones above. Counts only.

Setup: RX 9070 XT 16 GB (RDNA4), Mesa 26.3.1 RADV, Ryzen 7 9800X3D, 32 GB RAM (zram swap only), CachyOS, Wine 11.17 + vkd3d-proton master ec20719. Tree: main 689f2db + the Wine fixes #871 and #684, release, retail 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1. The title runs in a systemd scope with a memory cap. The card's use is read from amdgpu's mem_info_vram_used / mem_info_gtt_used every 2 s, next to the title process's RSS and the scope's memory.current.

HLSL path, cold (24 GB cap; the run stalls on compiles, so this is the world load's start):

s process RSS scope VRAM used GTT used
10 (menus) 4.6 GB 6.7 GB 10.0 GB 0.6 GB
60 (world load starts) 9.3 GB 14.0 GB 15.9 GB (full) 3.1 GB
120 12.2 GB 17.6 GB 15.9 GB 3.7 GB
240 15.1 GB 16.5 GB 15.8 GB 3.7 GB

Direct path, warm (XCL_DIRECT_DXIL=all, same tree + #1273 / #1798, 26 GB cap), sampled the same way:

s process RSS scope VRAM used GTT used
30 6.6 GB 8.1 GB 12.4 GB 0.7 GB
60 10.2 GB 13.9 GB 15.9 GB (full) 3.0 GB
90 18.2 GB 18.4 GB 15.9 GB 3.7 GB
95 – 23.4 GB 15.9 GB 3.7 GB

OOM-killed at about 97 s, after 526 compute pipelines and 1 200 frames. XCL's own line at the end: video memory 18 180 MB local, target pages 9 745 MB, sparse pools 6 080 MB. With 16 GB of zram allowed on top, the run reached 1 800 frames and then a global OOM (scope peak 25.5 GB RAM + 16 GB swap). VRAM and GTT are the same on both paths. The direct path's process RSS is 6.6 GB higher at 90 s: it builds its pipelines much faster (driver compile memory in the same process) and gets further. I have not split the two.

What differs from Windows: past the card, the driver places the rest in GTT, which is system RAM, charged to the process's memory. Windows can back demoted video memory and commit with a page file on disk. Here, with only zram, there is nowhere else for it to go. So on a 32 GB Linux machine, what is a slow commit charge on Windows becomes an out-of-memory kill during world load. Anything that keeps the mirror out of local video memory, or under a budget (the copy-on-first-use / system-memory approach described above, or vladbondarenko97's budget), would apply here directly.

Not tested: Windows on this card, XCL_HEAP_WINDOWS=1, #640's page budget.

AI use: Claude Code (Claude Opus 5.5) ran the runs and the sampler on my machine and wrote this.

**@⁠Fran-co-F** on GitHub · 2026-11-25 00:20 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7148406524) **Linux / RADV (16 GB card, 32 GB RAM): the overflow goes to GTT, which is RAM, so the system runs out of memory during world load.** A data point next to the Windows ones above. Counts only. **Setup:** RX 9070 XT 16 GB (RDNA4), Mesa 26.3.1 RADV, Ryzen 7 9800X3D, 32 GB RAM (zram swap only), CachyOS, Wine 11.17 + vkd3d-proton `master` `ec20719`. Tree: `main` `689f2db` + the Wine fixes #871 and #684, release, retail 1.0.2.1, `XCL_NETWORK=0 XCL_ACTIVITY=1`. The title runs in a systemd scope with a memory cap. The card's use is read from amdgpu's `mem_info_vram_used` / `mem_info_gtt_used` every 2 s, next to the title process's RSS and the scope's `memory.current`. **HLSL path, cold** (24 GB cap; the run stalls on compiles, so this is the world load's start): | s | process RSS | scope | VRAM used | GTT used | |---:|---:|---:|---:|---:| | 10 (menus) | 4.6 GB | 6.7 GB | 10.0 GB | 0.6 GB | | 60 (world load starts) | 9.3 GB | 14.0 GB | **15.9 GB (full)** | 3.1 GB | | 120 | 12.2 GB | 17.6 GB | 15.9 GB | 3.7 GB | | 240 | 15.1 GB | 16.5 GB | 15.8 GB | 3.7 GB | **Direct path, warm** (`XCL_DIRECT_DXIL=all`, same tree + #1273 / #1798, 26 GB cap), sampled the same way: | s | process RSS | scope | VRAM used | GTT used | |---:|---:|---:|---:|---:| | 30 | 6.6 GB | 8.1 GB | 12.4 GB | 0.7 GB | | 60 | 10.2 GB | 13.9 GB | 15.9 GB (full) | 3.0 GB | | 90 | **18.2 GB** | 18.4 GB | 15.9 GB | 3.7 GB | | 95 | – | **23.4 GB** | 15.9 GB | 3.7 GB | OOM-killed at about 97 s, after 526 compute pipelines and 1 200 frames. XCL's own line at the end: `video memory 18 180 MB local`, `target pages 9 745 MB`, `sparse pools 6 080 MB`. With 16 GB of zram allowed on top, the run reached 1 800 frames and then a **global** OOM (scope peak 25.5 GB RAM + 16 GB swap). VRAM and GTT are the same on both paths. The direct path's process RSS is 6.6 GB higher at 90 s: it builds its pipelines much faster (driver compile memory in the same process) and gets further. I have not split the two. What differs from Windows: past the card, the driver places the rest in GTT, which is **system RAM**, charged to the process's memory. Windows can back demoted video memory and commit with a page file on disk. Here, with only zram, there is nowhere else for it to go. So on a 32 GB Linux machine, what is a slow commit charge on Windows becomes an out-of-memory kill during world load. Anything that keeps the mirror out of local video memory, or under a budget (the copy-on-first-use / system-memory approach described above, or vladbondarenko97's budget), would apply here directly. **Not tested:** Windows on this card, `XCL_HEAP_WINDOWS=1`, #640's page budget. **AI use:** Claude Code (Claude Opus 5.5) ran the runs and the sampler on my machine and wrote this.
Author
Owner

@⁠yinx080 on GitHub · 2026-11-25 00:44 UTC · original

Measurements on a small GPU, and a question before a PR series.

Setup: Windows 11 Pro 26200, RTX 3060 Laptop 6 GB (NVIDIA 610.91), 15.3 GB RAM (so ~13.6 GB the GPU can
address), retail title in Series S mode, XCL_ACTIVITY=1, base c160d86. Every run ends like #345 / #333: a
64 MB CreateHeap refused, then the title's assert at +0x193e00f, at ~12.9 GB of local + non-local.

  • Sparse tiles mostly unused. At the account prompt 4.6 GB of sparse tiles are mapped. The tiles ever written
    by the CPU (write-watch), under placed buffers, or given to the GPU by address (root arguments, buffer views,
    index/vertex buffers) come to 1.0 GB there and ~1.4 GB during loading.
  • Lazy tiles prototype. Behind XCL_LAZY_TILES=1: a commit maps no tile; held-back tiles stay write-watched
    and are mapped (zeroed) before the submit that needs them, for any of the reasons above. This kept sparse tiles
    at ~1.7 GB instead of ~3.6 GB at the same point of loading, with correct frames through the loading screen.
    Scanning CPU-written pages for pointers into the windows mapped ~2 GB more (the title's own data points all
    over them), so that is off.
  • Coherent window. It is committed at 4,095 MB but the title's allocations in it reach ~3.0 GB;
    XCL_COHERENT_MB=3100 saved ~1 GB of shared memory with no visible change.
  • What still runs it out. Target pages grow from 3.1 to 5.5 GB within seconds when the world streams in, and
    ~0.9-1.0 GB of them are tiles past the console's size.

#1916 defers tiles for DirectStorage-filled private homes. Would a broader version be welcome as a stacked series
(1: per-tile "needed" diagnostics in the activity line; 2: tracking addresses given to the GPU, no behaviour
change; 3: lazy tiles behind a switch), or should it build on #1916?

AI use: Claude Code (Claude Opus 5.5) wrote the prototype and these measurements.

**@⁠yinx080** on GitHub · 2026-11-25 00:44 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7148833928) Measurements on a small GPU, and a question before a PR series. Setup: Windows 11 Pro 26200, RTX 3060 Laptop **6 GB** (NVIDIA 610.91), 15.3 GB RAM (so ~13.6 GB the GPU can address), retail title in Series S mode, `XCL_ACTIVITY=1`, base `c160d86`. Every run ends like #345 / #333: a 64 MB `CreateHeap` refused, then the title's assert at `+0x193e00f`, at ~12.9 GB of local + non-local. - **Sparse tiles mostly unused.** At the account prompt 4.6 GB of sparse tiles are mapped. The tiles ever written by the CPU (write-watch), under placed buffers, or given to the GPU by address (root arguments, buffer views, index/vertex buffers) come to 1.0 GB there and ~1.4 GB during loading. - **Lazy tiles prototype.** Behind `XCL_LAZY_TILES=1`: a commit maps no tile; held-back tiles stay write-watched and are mapped (zeroed) before the submit that needs them, for any of the reasons above. This kept sparse tiles at ~1.7 GB instead of ~3.6 GB at the same point of loading, with correct frames through the loading screen. Scanning CPU-written pages for pointers into the windows mapped ~2 GB more (the title's own data points all over them), so that is off. - **Coherent window.** It is committed at 4,095 MB but the title's allocations in it reach ~3.0 GB; `XCL_COHERENT_MB=3100` saved ~1 GB of shared memory with no visible change. - **What still runs it out.** Target pages grow from 3.1 to 5.5 GB within seconds when the world streams in, and ~0.9-1.0 GB of them are tiles past the console's size. #1916 defers tiles for DirectStorage-filled private homes. Would a broader version be welcome as a stacked series (1: per-tile "needed" diagnostics in the activity line; 2: tracking addresses given to the GPU, no behaviour change; 3: lazy tiles behind a switch), or should it build on #1916? AI use: Claude Code (Claude Opus 5.5) wrote the prototype and these measurements.
Author
Owner

@⁠3L1A5-1 on GitHub · 2026-11-25 00:51 UTC · original

@⁠yinx080 The ~0.8 GB I measured above (home tiles of physical pages that lie entirely under textures with their own PC copy) should be a subset of what your lazy tiles leave unmapped: nothing gives those tiles to the GPU by address, the CPU writes reach them through the texture's own upload, and DirectStorage fills them. So I'm dropping the separate unmap idea from my comment above rather than build a second mechanism next to yours and #1916.

AI use: Claude Code (Claude Opus 5.5) wrote this.

**@⁠3L1A5-1** on GitHub · 2026-11-25 00:51 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7148967053) @⁠yinx080 The ~0.8 GB I measured above (home tiles of physical pages that lie entirely under textures with their own PC copy) should be a subset of what your lazy tiles leave unmapped: nothing gives those tiles to the GPU by address, the CPU writes reach them through the texture's own upload, and DirectStorage fills them. So I'm dropping the separate unmap idea from my comment above rather than build a second mechanism next to yours and #1916. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠brandostrong on GitHub · 2026-11-25 03:41 UTC · original

PR #2090 removes the buffer half of this for a title that commits most of its unified memory.

Measured on the same title, 180 s runs, RTX 4090, warm caches:

  • tiled (main): the sparse windows' own video-memory pools reach 7 445 MB on top of the title's
    pages, and the write-watch look over the mapped tiles costs 24 667 ms cumulative for 1 254 ms of
    upload at 3 578 820 dirty pages.
  • with XCL_SPARSE_DIRECT=1 (#2090): those pools are 0 MB and the look is 4 461 ms over
    4 096 looks
    (~1 ms each) — the windows are imported heaps, a buffer the title places in one is
    that memory at its own address, so there is nothing to scan, upload or read back.

What still mirrors after that: textures the title places in sparse windows (a detiled PC copy — that
is why the windows stay write-watched), and anything XCL copies into its own video memory.

Claude Code, Claude Opus 5.5 — the numbers are from runs made here.

**@⁠brandostrong** on GitHub · 2026-11-25 03:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7152153660) PR #2090 removes the buffer half of this for a title that commits most of its unified memory. Measured on the same title, 180 s runs, RTX 4090, warm caches: - tiled (`main`): the sparse windows' own video-memory pools reach **7 445 MB** on top of the title's pages, and the write-watch look over the mapped tiles costs **24 667 ms cumulative** for 1 254 ms of upload at 3 578 820 dirty pages. - with `XCL_SPARSE_DIRECT=1` (#2090): those pools are **0 MB** and the look is **4 461 ms over 4 096 looks** (~1 ms each) — the windows are imported heaps, a buffer the title places in one is that memory at its own address, so there is nothing to scan, upload or read back. What still mirrors after that: textures the title places in sparse windows (a detiled PC copy — that is why the windows stay write-watched), and anything XCL copies into its own video memory. Claude Code, Claude Opus 5.5 — the numbers are from runs made here.
Author
Owner

@⁠mgrein on GitHub · 2026-11-25 06:51 UTC · original · edited 2026-11-25 07:34 UTC

Measured on a 12 GB card: where video memory goes when the newer retail title (TitleID 7952987A, Series X profile) loads its world. Real runs, not code reading; one run per setting.

Setup: RTX 4070 12 GB, Ryzen 5 5600X, 32 GB RAM, Windows 11 26200, release builds. All 2,689 compute pipelines pre-built, A pressed through the menus. Tree: #2057 at 8ff4b02 plus local commits: #640 cherry-picked (ported onto TilePool), a T# index clamp, and a local counter in real.rs's creator! that adds up the bytes of every heap / committed / placed resource made through the device (releases not subtracted). XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, no XCL_UMA_SHADOW.

1. With XCL_PAGE_BUDGET_MB=4096 and XCL_COHERENT_HEAPS=sparse:1024: the menus run at 5–30 fps, world loading starts at ~240 s, and the run ends in E_OUTOFMEMORY:

time local video memory title-texture pages sparse pools committed default-heap resources made
202 s 9.8 GB 3.6 GB 4.5 GB 1.2 GB
226 s 10.3 GB 4.1 GB (at the budget) 4.5 GB 10.8 GB
256 s 20.6 GB 4.1 GB 5.2 GB –
  • The committed resources come from device_x::create_placed_resource_x's fallback: sampled textures that vram::place_pages declined at the budget become committed default resources. The budget evicted almost nothing: at world load every texture is younger than its minimum age, so it moves textures off the pages instead of capping them.
  • At ~22.4 GB local + 4.9 GB non-local – about everything Windows lets the GPU use on this machine – CreatePlacedResourceX fails with 0x8007000e by the hundred and the title stops on its int3 (+0x193e00f, rax = 0x8007000e; with a 2 GB budget +0xf7d415).

1b. With #782 ported on top as well (XCL_PAGE_BUDGET_MB=3072; #782's use signal from the T#s in the view heaps, adapted to the newer #640 – its test passes): no better. 48 textures evicted in the whole run, committed default-heap resources 2.2 GB at 204 s → 8.2 GB at 244 s, E_OUTOFMEMORY and the same int3 at 253 s. What limits the budget here: at the cap, when a round frees fewer tiles than a placement needs, bind gives up and create_placed_resource_x makes the texture a committed resource; for the next EVICT_IDLE no round runs, so every placement in that second does the same. Those resources are off the pages, so the budget can never evict them later – at world load it moves textures out of its reach instead of capping them. The textures that stay on the pages are uploaded and transitioned all through the load, so they always look recent.

2. Without a budget (same otherwise): title-texture pages 10.0 GB, sparse pools 6.1 GB, local 18.9 GB by 304 s; frames fall to 0–2 per 2 s from 250 s, GPU queue.Wait time-outs start at 331 s, title crash (write to 0, +0x23cf683) at 437 s.

2b. Without XCL_COHERENT_HEAPS as well (the title's two big GPU heaps, 1.2 + 2.2 GB, stay in the coherent window): local video memory stays lower (15.9 GB), but world loading at ~100 s stalls at once – GPU queue.Wait time-outs from 132 s (353 in the run), no frames after 140 s, device removed (0x887a0005) and the int3 at +0x2474606 at 575 s. So XCL_COHERENT_HEAPS=sparse:1024 is what avoids that stall here, and it is also what costs the video memory that then runs out.

2c. #1916 (XCL_DEFER_PRIVATE_HOME_TILES=1) cherry-picked on top, no budget: sparse pools held at 3.7 GB through the world load instead of 6.1 GB, peak local video memory 16.7 GB instead of 18.9 GB. Not enough on its own: title-texture pages still reach 10.1 GB, GPU queue.Wait time-outs from 342 s, title crash (write to 0, +0x23cf683) at 454 s.

2d. Same + XCL_PAGE_BUDGET_MB=4096 with the fallback turned off (a local switch: past the cap the pool heaps still grow when a round could not free enough, so the texture stays on the pages instead of becoming a committed resource): committed default-heap resources stay at 1.4 GB, and eviction now works – 7,203 textures evicted, 966 mapped again. But the title-texture pages stay at 9.7 GB: evicted tiles go back to the pool for reuse, and the 64 MB pool heaps behind them are never released (scattered tiles rarely leave a heap empty). So a budget that holds here needs both: no committed fallback, and pool heaps given back (#800's direction). End as in 2c (time-outs from 305 s, the same crash at 516 s).

3. #2090 (XCL_SPARSE_DIRECT=1), on a different local tree (main 6020a33 + #2090, #1599, #1405, #1663, #640 ported, #2009's XCL_COHERENT_HEAPS), same caches pre-built for it: UMA import check: ok, local video memory stays at 3.8–5.5 GB – the mirror is gone – but nothing is presented for 150 s, then ~6 fps with ~25 DirectStorage requests a second, and a title crash (write to 0) at 342 s. On this machine the title's memory read over PCIe is too slow for the world load.

4. Series S profile (lockhart, tree of 1, budget 4096): the title stops on an int3 (+0xb18de7) at 138 s, still in the menus, with black frames.

So on 12 GB, the Series X world load as XCL lays it out now – the title's memory mirrored (sparse pools 5–6 GB) plus a PC copy of every texture (~10 GB) – needs more GPU memory than the machine has, and neither the page budget (nothing evictable yet) nor direct windows (too slow here) gets it through.

Not tested: AMD; more than one run per setting; main + one PR at a time (all trees above carry several open PRs).

AI use: Claude Code (Claude Opus 5.5) made the builds and runs on the hardware above, read the logs and wrote this report. The numbers come from those runs.

**@⁠mgrein** on GitHub · 2026-11-25 06:51 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7155226080) · edited 2026-11-25 07:34 UTC **Measured on a 12 GB card: where video memory goes when the newer retail title (TitleID 7952987A, Series X profile) loads its world.** Real runs, not code reading; one run per setting. **Setup:** RTX 4070 12 GB, Ryzen 5 5600X, 32 GB RAM, Windows 11 26200, release builds. All 2,689 compute pipelines pre-built, A pressed through the menus. Tree: #2057 at `8ff4b02` plus local commits: #640 cherry-picked (ported onto `TilePool`), a T# index clamp, and a local counter in `real.rs`'s `creator!` that adds up the bytes of every heap / committed / placed resource made through the device (releases not subtracted). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1`, no `XCL_UMA_SHADOW`. **1. With `XCL_PAGE_BUDGET_MB=4096` and `XCL_COHERENT_HEAPS=sparse:1024`:** the menus run at 5–30 fps, world loading starts at ~240 s, and the run ends in `E_OUTOFMEMORY`: | time | local video memory | title-texture pages | sparse pools | committed default-heap resources made | |---|---|---|---|---| | 202 s | 9.8 GB | 3.6 GB | 4.5 GB | 1.2 GB | | 226 s | 10.3 GB | 4.1 GB (at the budget) | 4.5 GB | **10.8 GB** | | 256 s | 20.6 GB | 4.1 GB | 5.2 GB | – | - The committed resources come from `device_x::create_placed_resource_x`'s fallback: sampled textures that `vram::place_pages` declined at the budget become committed default resources. The budget evicted almost nothing: at world load every texture is younger than its minimum age, so it moves textures off the pages instead of capping them. - At ~22.4 GB local + 4.9 GB non-local – about everything Windows lets the GPU use on this machine – `CreatePlacedResourceX` fails with `0x8007000e` by the hundred and the title stops on its int3 (`+0x193e00f`, `rax = 0x8007000e`; with a 2 GB budget `+0xf7d415`). **1b. With #782 ported on top as well** (`XCL_PAGE_BUDGET_MB=3072`; #782's use signal from the T#s in the view heaps, adapted to the newer #640 – its test passes): no better. 48 textures evicted in the whole run, committed default-heap resources 2.2 GB at 204 s → 8.2 GB at 244 s, `E_OUTOFMEMORY` and the same int3 at 253 s. What limits the budget here: at the cap, when a round frees fewer tiles than a placement needs, `bind` gives up and `create_placed_resource_x` makes the texture a committed resource; for the next `EVICT_IDLE` no round runs, so every placement in that second does the same. Those resources are off the pages, so the budget can never evict them later – at world load it moves textures out of its reach instead of capping them. The textures that stay on the pages are uploaded and transitioned all through the load, so they always look recent. **2. Without a budget** (same otherwise): title-texture pages 10.0 GB, sparse pools 6.1 GB, local 18.9 GB by 304 s; frames fall to 0–2 per 2 s from 250 s, `GPU queue.Wait` time-outs start at 331 s, title crash (write to 0, `+0x23cf683`) at 437 s. **2b. Without `XCL_COHERENT_HEAPS` as well** (the title's two big GPU heaps, 1.2 + 2.2 GB, stay in the coherent window): local video memory stays lower (15.9 GB), but world loading at ~100 s stalls at once – `GPU queue.Wait` time-outs from 132 s (353 in the run), no frames after 140 s, device removed (`0x887a0005`) and the int3 at `+0x2474606` at 575 s. So `XCL_COHERENT_HEAPS=sparse:1024` is what avoids that stall here, and it is also what costs the video memory that then runs out. **2c. #1916 (`XCL_DEFER_PRIVATE_HOME_TILES=1`) cherry-picked on top, no budget:** sparse pools held at 3.7 GB through the world load instead of 6.1 GB, peak local video memory 16.7 GB instead of 18.9 GB. Not enough on its own: title-texture pages still reach 10.1 GB, `GPU queue.Wait` time-outs from 342 s, title crash (write to 0, `+0x23cf683`) at 454 s. **2d. Same + `XCL_PAGE_BUDGET_MB=4096` with the fallback turned off** (a local switch: past the cap the pool heaps still grow when a round could not free enough, so the texture stays on the pages instead of becoming a committed resource): committed default-heap resources stay at 1.4 GB, and eviction now works – 7,203 textures evicted, 966 mapped again. But the title-texture pages stay at 9.7 GB: evicted tiles go back to the pool for reuse, and the 64 MB pool heaps behind them are never released (scattered tiles rarely leave a heap empty). So a budget that holds here needs both: no committed fallback, and pool heaps given back (#800's direction). End as in 2c (time-outs from 305 s, the same crash at 516 s). **3. #2090 (`XCL_SPARSE_DIRECT=1`)**, on a different local tree (`main` `6020a33` + #2090, #1599, #1405, #1663, #640 ported, #2009's `XCL_COHERENT_HEAPS`), same caches pre-built for it: `UMA import check: ok`, local video memory stays at 3.8–5.5 GB – the mirror is gone – but nothing is presented for 150 s, then ~6 fps with ~25 DirectStorage requests a second, and a title crash (write to 0) at 342 s. On this machine the title's memory read over PCIe is too slow for the world load. **4. Series S profile** (`lockhart`, tree of 1, budget 4096): the title stops on an int3 (`+0xb18de7`) at 138 s, still in the menus, with black frames. So on 12 GB, the Series X world load as XCL lays it out now – the title's memory mirrored (sparse pools 5–6 GB) plus a PC copy of every texture (~10 GB) – needs more GPU memory than the machine has, and neither the page budget (nothing evictable yet) nor direct windows (too slow here) gets it through. **Not tested:** AMD; more than one run per setting; `main` + one PR at a time (all trees above carry several open PRs). AI use: Claude Code (Claude Opus 5.5) made the builds and runs on the hardware above, read the logs and wrote this report. The numbers come from those runs.
Author
Owner

@⁠shortside on GitHub · 2026-11-25 09:42 UTC · original

A measurement for point 2 (sampled textures): most of their video memory is for levels the title has not loaded, and backing only loaded levels removes it.

Measured on the newer retail title, Series S profile, on a 24 GB Apple silicon Mac (CrossOver, D3DMetal), where video memory is system memory, so this is the low end. Details and the before/after are in #258.

  • A census of the title textures kept in step while it loads: about 22,000 textures standing for 7.9 GB, of which 1.3 GB has memory behind it. The rest is levels the title has reserved but not mapped yet (it streams the small levels first).
  • A committed texture, and as far as I can read it a vram::place_pages texture too, takes video memory for every level.
  • title_memory_mb does not change this: at 5,120 the title still placed 7.7 GB of textures (one run).
  • A branch that makes such a texture a reserved resource of its own and maps a level's tiles when an upload first has texels for it: d3d12x/streamed-texture-level-tiles (one commit on the Mac port branch mac7, native hosts only for now). In the same run about 1 GB of tiles was mapped for the 10 GB the textures stood for, and loading went from about 2 frames per 30 s to 15–30 fps on that machine.

Not tested: Windows, a discrete card, the place_pages path. It is gated to native hosts because that is where I could test it; whether the same idea fits the shared-pages model on Windows is a question for those who know that code. @⁠yangzj0844 @⁠vitalityscripts, this may be relevant to the 7.1 GB of texture pages in #1337.

AI use: Claude Code with Claude Fable 5.2 ran the measurements and wrote the branch and this comment on my machine.

**@⁠shortside** on GitHub · 2026-11-25 09:42 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7158699740) **A measurement for point 2 (sampled textures): most of their video memory is for levels the title has not loaded, and backing only loaded levels removes it.** Measured on the newer retail title, Series S profile, on a 24 GB Apple silicon Mac (CrossOver, D3DMetal), where video memory is system memory, so this is the low end. Details and the before/after are in #258. - A census of the title textures kept in step while it loads: about 22,000 textures standing for 7.9 GB, of which 1.3 GB has memory behind it. The rest is levels the title has reserved but not mapped yet (it streams the small levels first). - A committed texture, and as far as I can read it a `vram::place_pages` texture too, takes video memory for every level. - `title_memory_mb` does not change this: at 5,120 the title still placed 7.7 GB of textures (one run). - A branch that makes such a texture a reserved resource of its own and maps a level's tiles when an upload first has texels for it: [`d3d12x/streamed-texture-level-tiles`](https://github.com/shortside/xcl/tree/d3d12x/streamed-texture-level-tiles) (one commit on the Mac port branch `mac7`, native hosts only for now). In the same run about 1 GB of tiles was mapped for the 10 GB the textures stood for, and loading went from about 2 frames per 30 s to 15–30 fps on that machine. **Not tested:** Windows, a discrete card, the `place_pages` path. It is gated to native hosts because that is where I could test it; whether the same idea fits the shared-pages model on Windows is a question for those who know that code. @⁠yangzj0844 @⁠vitalityscripts, this may be relevant to the 7.1 GB of texture pages in #1337. **AI use:** Claude Code with Claude Fable 5.2 ran the measurements and wrote the branch and this comment on my machine.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-25 09:44 UTC · original

RAM side of this issue on 32 GB: what is resident when #2057 reaches the world of the newer retail title, page by page. The NVIDIA driver's own shader cache file is the largest single part (4.9 GB). Without it RAM holds longer, and then local video memory ends the run.

Setup

  • RTX 5070 Ti 16 GB (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM (31.4 GB visible, ~21.5 GB available with no game), 64 GB page file, Windows 11 Pro 10.0.26300, release.
  • Tree: #2057 at f7e08e6 plus two local commits that are not published, both off unless set and both on in every run here:
    • XCL_EXP_WAIT_SUBMITTED=1: the GPU-wait watchdog does not release a wait whose Signal is already submitted (it never acted in these runs).
    • XCL_EXP_APU_MAP1=1: ApuMapVirtualAddress in its one-argument form.
  • Every run: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, A pressed at 30 s, no XCL_UMA_SHADOW, compute pipelines precompiled. A guard kills the process when available RAM drops below 1.0 GB.
  • Next to each run, a read-only sampler walks the process with VirtualQueryEx and QueryWorkingSetEx every 5 s (resident bytes per mapped file / private allocation; its sum matches the working set), plus the memory-list and GPU-memory counters every second.

Working set at the guard cut (default executable name, 2 runs, 86-91 s, world at 66-76 s)

part resident
NVIDIA DX cache file for xcl.exe (...c29925ed.nvph, 4 GB + 2 GB files, mapped from device creation) 4.9 GB
coherent window (the title's GPU heaps, read by the GPU from host memory; this is also the GPU "shared usage") 4.0 GB
title data: sparse windows' CPU view 1.5, 24 GB plain reservation 1.5-2.0, tile heap 0.9-1.3 3.9-4.4 GB, growing
other private (mostly 8-32 MB allocations that follow the pipelines built) 4.1 GB
game image and smaller blocks ~1 GB
the 64 MB private region next to each pool heap 0.1 GB of 10.8 GB committed
working set 17.8-18.6 GB
  • The working set is 90-93 % of the RAM the run takes; available RAM is the standby list by ~25 s (free pages ~0), the modified list stays under 0.1 GB, and nothing is written to the page file.
  • Private bytes (27-33 GB) overstate RAM by 10-16 GB: the 64 MB regions are commit only, as 3L1A5-1 found above on 8 GB / 16 GB, until local video memory passes the budget; then they become resident (0.8-1.6 GB) and GPU shared usage grows.
  • What grows in the world (+2.9 GB in 20 s, +4.3 GB over 90 s in a longer run) is the title's streamed data in its own memory (+2.0-2.1 GB; the same bytes also go to VRAM as sparse tiles or a PC texture copy), pipeline memory (+0.4-1.4 GB), and demoted video memory (+0.7 GB).

One change per run (GB; 7 runs)

run change end min available RAM in the world peak local video memory
1, 2 none guard at 91 / 95 s (0.86 / 0.67 GB) 1.1 / 0.7 12.7 / 13.7
3, 4 same exe under another name (the driver starts a new 0.5 GB cache file; working set −3.9 to −5.2 GB) 180 s exit 0 / device removed 0x887a0005 at 140 s 1.1 / 1.5 15.6 / 15.7
5 as 3 + XCL_PSO_PRELOAD=0 removed at 152 s 1.9 15.7
6, 7 as 3 + XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 removed at 148 / 116 s 2.9 / 3.6 16.3 / 16.1
  • XCL_PSO_PRELOAD=0 saves 1.2 GB in the menus only.
  • No nvlddmkm / Display event with any of the five removals.
  • So on 32 GB / 16 GB the RAM limit can be moved past the first minute of the world: without the driver's cache file and with the title's GPU heaps out of the coherent window, available RAM stays at 2.9-3.6 GB. Then local video memory (target pages ~10 GB) ends the run 35-68 s into the world. A budget on target pages (#640, 741cb5a, #1702) is the part left. On 32 GB, a budget that puts pages in system memory would turn this back into a RAM limit.
  • Eterst already reported this cache file resident for xcl.exe on #2057 (7.6 of 8 GB, RTX 4070 SUPER, 32 GB); what this adds is the rest of the working set and what happens without it.
  • The cache file is NVIDIA's, not XCL's: one file set per executable name, mapped whole. Capping NVIDIA's shader cache size, or clearing the files for xcl.exe, should do the same as the renamed exe. XCL's own driver blobs still supply the pipelines: 461 driver compile starts with the new cache file, 455 without.

Not tested: the tree without the two local switches; XCL_UMA_SHADOW=1; coherent window sizes between 512 and 4095 MB; any page-budget PR; NVIDIA's cache-size setting itself; who owns the 8-32 MB allocations; runs past 200 s; AMD; other cards.

AI use: Claude Code made the sampler and the runs on the machine above, read the logs and wrote this.

Run and written with Claude Code (Claude Fable 5.2 and Claude Opus 5.5).

**@⁠tiagonleal** on GitHub · 2026-11-25 09:44 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7158728219) **RAM side of this issue on 32 GB: what is resident when #2057 reaches the world of the newer retail title, page by page. The NVIDIA driver's own shader cache file is the largest single part (4.9 GB). Without it RAM holds longer, and then local video memory ends the run.** **Setup** - RTX 5070 Ti 16 GB (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM (31.4 GB visible, ~21.5 GB available with no game), 64 GB page file, Windows 11 Pro 10.0.26300, release. - Tree: #2057 at `f7e08e6` plus two local commits that are not published, both off unless set and both **on** in every run here: - `XCL_EXP_WAIT_SUBMITTED=1`: the GPU-wait watchdog does not release a wait whose `Signal` is already submitted (it never acted in these runs). - `XCL_EXP_APU_MAP1=1`: `ApuMapVirtualAddress` in its one-argument form. - Every run: `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, A pressed at 30 s, no `XCL_UMA_SHADOW`, compute pipelines precompiled. A guard kills the process when available RAM drops below 1.0 GB. - Next to each run, a read-only sampler walks the process with `VirtualQueryEx` and `QueryWorkingSetEx` every 5 s (resident bytes per mapped file / private allocation; its sum matches the working set), plus the memory-list and GPU-memory counters every second. **Working set at the guard cut (default executable name, 2 runs, 86-91 s, world at 66-76 s)** | part | resident | |---|---| | NVIDIA DX cache file for `xcl.exe` (`...c29925ed.nvph`, 4 GB + 2 GB files, mapped from device creation) | **4.9 GB** | | coherent window (the title's GPU heaps, read by the GPU from host memory; this is also the GPU "shared usage") | 4.0 GB | | title data: sparse windows' CPU view 1.5, 24 GB plain reservation 1.5-2.0, tile heap 0.9-1.3 | 3.9-4.4 GB, growing | | other private (mostly 8-32 MB allocations that follow the pipelines built) | 4.1 GB | | game image and smaller blocks | ~1 GB | | the 64 MB private region next to each pool heap | 0.1 GB of 10.8 GB committed | | **working set** | **17.8-18.6 GB** | - The working set is 90-93 % of the RAM the run takes; available RAM is the standby list by ~25 s (free pages ~0), the modified list stays under 0.1 GB, and nothing is written to the page file. - Private bytes (27-33 GB) overstate RAM by 10-16 GB: the 64 MB regions are commit only, as 3L1A5-1 found above on 8 GB / 16 GB, until local video memory passes the budget; then they become resident (0.8-1.6 GB) and GPU shared usage grows. - What grows in the world (+2.9 GB in 20 s, +4.3 GB over 90 s in a longer run) is the title's streamed data in its own memory (+2.0-2.1 GB; the same bytes also go to VRAM as sparse tiles or a PC texture copy), pipeline memory (+0.4-1.4 GB), and demoted video memory (+0.7 GB). **One change per run (GB; 7 runs)** | run | change | end | min available RAM in the world | peak local video memory | |---|---|---|---|---| | 1, 2 | none | guard at 91 / 95 s (0.86 / 0.67 GB) | 1.1 / 0.7 | 12.7 / 13.7 | | 3, 4 | same exe under another name (the driver starts a new 0.5 GB cache file; working set −3.9 to −5.2 GB) | 180 s exit 0 / device removed `0x887a0005` at 140 s | 1.1 / 1.5 | 15.6 / 15.7 | | 5 | as 3 + `XCL_PSO_PRELOAD=0` | removed at 152 s | 1.9 | 15.7 | | 6, 7 | as 3 + `XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512` | removed at 148 / 116 s | **2.9 / 3.6** | 16.3 / 16.1 | - `XCL_PSO_PRELOAD=0` saves 1.2 GB in the menus only. - No nvlddmkm / Display event with any of the five removals. - So on 32 GB / 16 GB the RAM limit can be moved past the first minute of the world: without the driver's cache file and with the title's GPU heaps out of the coherent window, available RAM stays at 2.9-3.6 GB. Then local video memory (target pages ~10 GB) ends the run 35-68 s into the world. A budget on target pages (#640, `741cb5a`, #1702) is the part left. On 32 GB, a budget that puts pages in system memory would turn this back into a RAM limit. - Eterst already reported this cache file resident for `xcl.exe` on #2057 (7.6 of 8 GB, RTX 4070 SUPER, 32 GB); what this adds is the rest of the working set and what happens without it. - The cache file is NVIDIA's, not XCL's: one file set per executable name, mapped whole. Capping NVIDIA's shader cache size, or clearing the files for `xcl.exe`, should do the same as the renamed exe. XCL's own driver blobs still supply the pipelines: 461 driver compile starts with the new cache file, 455 without. **Not tested:** the tree without the two local switches; `XCL_UMA_SHADOW=1`; coherent window sizes between 512 and 4095 MB; any page-budget PR; NVIDIA's cache-size setting itself; who owns the 8-32 MB allocations; runs past 200 s; AMD; other cards. **AI use:** Claude Code made the sampler and the runs on the machine above, read the logs and wrote this. Run and written with Claude Code (Claude Fable 5.2 and Claude Opus 5.5).
Author
Owner

@⁠joeypercia on GitHub · 2026-11-25 09:30 UTC · original · edited 2026-11-25 09:44 UTC

@⁠dhillonjagdeep650-boop a check on the first suspect for the CopyTextureRegion page fault in your B runs: with 741cb5a, a reserved texture can get tiles in L0 heaps (CUSTOM, NOT_AVAILABLE, L0) as well as in DEFAULT heaps. On its own, that doesn't make copies fault on NVIDIA here.

I used a synthetic probe outside the title: a 1024×512 RGBA8 reserved texture (64KB_UNDEFINED_SWIZZLE, 32 tiles), mapped as below and checked word by word. Each case writes from an upload buffer with CopyTextureRegion and reads back to a readback buffer. RTX 4070 Ti (Ada) on driver 621.40, Windows 11 26200, one process per case.

tiles copy queue direct queue
all in a DEFAULT heap right, no removal –
all in an L0 heap right, no removal right, no removal
16 DEFAULT + 16 L0 right, no removal right, no removal
16 DEFAULT + 16 NULL mapped half right, NULL half reads 0, no removal same
16 L0 + 16 NULL same –
all NULL, read only reads 0, no removal reads 0, no removal

Also, #2057's vram.rs never releases a pool heap, which fits your recently freed: []. So the faulting tile maps either to a live heap or to NULL, and neither faults in isolation.

What this leaves:

  • What's under the faulting address at the moment it faults:
    • a mapping made on the Pages queue that a queue other than the one before_execute waits on uses before it's done;
    • a GPU VA past the resource's own tiles (a footprint or subresource the copy computes differently from the console);
    • or residency of the L0 heaps when commit is at 30+ GB.
  • Your card: this was Ada, and yours is Ampere, so the same probe on the 3080 Ti would rule that difference out. The probe is one test file. I can push it to a branch if it helps.

Update: two runs of the title on the same 4070 Ti (12 GB, DXGI budget 11.0–11.2 GB). Base: #2057 f7e08e6 + 741cb5a (your tree B), release, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1, warm caches (0 compiles). Inputs were scripted A presses (XCL_PRESS_AT), one run per setting. No XCL_UMA_SHADOW. The copy page fault did not show up here in either run.

B B + XCL_COHERENT_HEAPS=sparse:512 (#2009, already in #2057)
first pool heap in system memory 86.8 s 22.7 s
removed 0x887a0005 at 304 s (#2057 alone on this card: ~171 s) 0x887a0005 at 184.6 s
DRED page fault at VA 0x0, no allocations, none freed the same
local / non-local video memory at the end 11.4 / 8.6 GB 11.1 / 12.8 GB
sparse pools / texture pools 2.2 / 10.0 GB 6.1 / 10.3 GB
peak commit 32.7 GB 41.5 GB
the 2 s before the end CS 1b5466f261a70cde (160×90 groups) 1,033 ms for one dispatch CS 24de2aef6c31d55e 483 ms × 8, CS b78fa10b425b8e54 470 ms
  • The budget moves the removal from ~171 s to 304 s here, but local use still ends past the budget (11.4 GB against 11.2 GB). Only pool heaps made after the limit go to system memory. Heaps made before it, the sparse pools and the arenas still grow in video memory.
  • On 12 GB, #2009's switch together with the budget is worse, not better. The 4.4 GB of heaps it moves fill video memory early, so nearly every texture pool after 23 s goes to system memory, and the world's compute passes slow to about 0.5 s per dispatch.

AI use

  • Claude Code (Claude Opus 5.5) wrote and ran the probe and wrote this comment.
**@⁠joeypercia** on GitHub · 2026-11-25 09:30 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7158420181) · edited 2026-11-25 09:44 UTC @⁠dhillonjagdeep650-boop a check on the first suspect for the `CopyTextureRegion` page fault in your B runs: with `741cb5a`, a reserved texture can get tiles in L0 heaps (`CUSTOM`, `NOT_AVAILABLE`, L0) as well as in `DEFAULT` heaps. **On its own, that doesn't make copies fault on NVIDIA here.** I used a synthetic probe outside the title: a 1024×512 RGBA8 reserved texture (`64KB_UNDEFINED_SWIZZLE`, 32 tiles), mapped as below and checked word by word. Each case writes from an upload buffer with `CopyTextureRegion` and reads back to a readback buffer. RTX 4070 Ti (Ada) on driver 621.40, Windows 11 26200, one process per case. | tiles | copy queue | direct queue | |---|---|---| | all in a `DEFAULT` heap | right, no removal | – | | all in an L0 heap | right, no removal | right, no removal | | 16 `DEFAULT` + 16 L0 | right, no removal | right, no removal | | 16 `DEFAULT` + 16 NULL | mapped half right, NULL half reads 0, no removal | same | | 16 L0 + 16 NULL | same | – | | all NULL, read only | reads 0, no removal | reads 0, no removal | Also, #2057's `vram.rs` never releases a pool heap, which fits your `recently freed: []`. So the faulting tile maps either to a live heap or to NULL, and neither faults in isolation. What this leaves: - **What's under the faulting address at the moment it faults:** - a mapping made on the `Pages` queue that a queue other than the one `before_execute` waits on uses before it's done; - a GPU VA past the resource's own tiles (a footprint or subresource the copy computes differently from the console); - or residency of the L0 heaps when commit is at 30+ GB. - **Your card:** this was Ada, and yours is Ampere, so the same probe on the 3080 Ti would rule that difference out. The probe is one test file. I can push it to a branch if it helps. **Update: two runs of the title on the same 4070 Ti (12 GB, DXGI budget 11.0–11.2 GB).** Base: #2057 `f7e08e6` + `741cb5a` (your tree B), release, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1`, warm caches (0 compiles). Inputs were scripted A presses (`XCL_PRESS_AT`), one run per setting. No `XCL_UMA_SHADOW`. The copy page fault did not show up here in either run. | | B | B + `XCL_COHERENT_HEAPS=sparse:512` (#2009, already in #2057) | |---|---|---| | first pool heap in system memory | 86.8 s | 22.7 s | | removed | `0x887a0005` at 304 s (#2057 alone on this card: ~171 s) | `0x887a0005` at 184.6 s | | DRED | page fault at VA `0x0`, no allocations, none freed | the same | | local / non-local video memory at the end | 11.4 / 8.6 GB | 11.1 / 12.8 GB | | sparse pools / texture pools | 2.2 / 10.0 GB | 6.1 / 10.3 GB | | peak commit | 32.7 GB | 41.5 GB | | the 2 s before the end | `CS 1b5466f261a70cde` (160×90 groups) 1,033 ms for one dispatch | `CS 24de2aef6c31d55e` 483 ms × 8, `CS b78fa10b425b8e54` 470 ms | - **The budget moves the removal from ~171 s to 304 s here, but local use still ends past the budget (11.4 GB against 11.2 GB).** Only pool heaps made after the limit go to system memory. Heaps made before it, the sparse pools and the arenas still grow in video memory. - **On 12 GB, #2009's switch together with the budget is worse, not better.** The 4.4 GB of heaps it moves fill video memory early, so nearly every texture pool after 23 s goes to system memory, and the world's compute passes slow to about 0.5 s per dispatch. **AI use** - Claude Code (Claude Opus 5.5) wrote and ran the probe and wrote this comment.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-25 10:17 UTC · original

Follow-up to my RAM comment above: two video-memory candidates on the same 16 GB / 32 GB setup, a DRED run, and a correction.

Correction first. I wrote that once RAM holds, "local video memory (target pages ~10 GB) ends the run". That was an inference from local use being at the card's size at the removal, not something I had shown. A DRED run now gives: GetDeviceRemovedReason 0x887a0005 (DEVICE_REMOVED, not DEVICE_HUNG), page fault at VA 0x0 with no allocation named, and no command list with unfinished operations. Presents kept coming until about 1 s before. Local use was 16.0-16.1 GB at every removal (16,389 MB in the last memory: line of the DRED run, 1.2 s before it), about 1 GB over the 15.1-15.2 GB DXGI budget. That fits video memory over-commit, but DRED does not name the cause, so read it as a hypothesis.

Setup (as before)

  • RTX 5070 Ti 16 GB (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 10.0.26300, release.
  • Base: #2057 f7e08e6 + my two local default-off commits, both on in every run (XCL_EXP_WAIT_SUBMITTED=1, XCL_EXP_APU_MAP1=1).
  • Env: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512, A at 30 s, compute pipelines precompiled. Each exe under its own name, so the driver's large shader cache file is not mapped.
  • XCL_GPU_PROFILE=1 in the first five runs. XCL_DRED=1 in the #1702 runs and in the DRED control.
  • Guard: kill at < 1.0 GB available RAM.
  • Candidates, each cherry-picked alone onto that base (no conflicts; only context lines differ):
    • 741cb5a (pool heaps past budget − 1 GB go to system memory), as a5adea6;
    • #1702 head 670a0f9 with XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1, as 41df377.
  • Tests on each branch, cargo test --release -p xcl --lib -- d3d12x::sparse d3d12x::list_x gpu::fence d3d12x::vram --test-threads=1: 59 / 0 / 1 (741cb5a) and 60 / 0 / 1 (#1702) passed / failed / ignored. #1702's vram tests with its switch on: 13 / 0 / 1, 0 skipped.

Runs

run world end local / non-local at the end min available RAM
base 68 s removed 0x887a0005 at 117 s 16.1 / 1.4 GB 3.9 GB
base + DRED 79 s removed 0x887a0005 at 117 s (DRED as above) 16.0 / 1.5 GB 3.9 GB
741cb5a 74 s removed at 191 s, after 11 s with no presents and no submits 16.1 / 1.9 GB 2.5 GB
741cb5a 80 s removed at 119 s 15.8 / 1.9 GB 3.7 GB
#1702 74 s guard, 0.61 GB available, 83 s 4.1 / 9.6 GB 0.8 GB
#1702 not reached guard, 0.58 GB available, 80 s 4.1 / 9.7 GB 0.6 GB
  • 741cb5a worked as written. Its first system-memory heap came at 78-82 s (14.1 of 15.1 GB). By then the target-page pools were almost all made (9.8-9.9 of 10.1 GB). Local use kept growing in other allocations, mostly sparse pools (+0.7-1.2 GB), and ended 0.9-1.3 GB over the budget anyway. With one run on each side, I can't say it delays the removal.
  • #1702 moves about 8.6 GB of pools to system memory. Local use stays near 4 GB, but the working set rises to 19.2-19.5 GB, so on 32 GB the run is cut for RAM in the first seconds of the world. That is the trade I expected earlier.
  • No nvlddmkm / Display event in any run. The four programs gefydev asked about do not appear in any profile table.

Not tested: either candidate on main without #2057, or without my two local switches; XCL_VRAM_HEADROOM_MB above 1024; #1702 with the driver's cache file mapped or with the default coherent window; DRED on the 741cb5a build; more than one DRED run; TdrDelay; a lower guard floor; the whole test suite; AMD; other cards.

Run and written with Claude Code (Claude Fable 5.2 and Claude Opus 5.5).

**@⁠tiagonleal** on GitHub · 2026-11-25 10:17 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7159489142) **Follow-up to my RAM comment above: two video-memory candidates on the same 16 GB / 32 GB setup, a DRED run, and a correction.** **Correction first.** I wrote that once RAM holds, "local video memory (target pages ~10 GB) ends the run". That was an inference from local use being at the card's size at the removal, not something I had shown. A DRED run now gives: `GetDeviceRemovedReason` 0x887a0005 (`DEVICE_REMOVED`, not `DEVICE_HUNG`), page fault at VA 0x0 with no allocation named, and no command list with unfinished operations. Presents kept coming until about 1 s before. Local use was 16.0-16.1 GB at every removal (16,389 MB in the last `memory:` line of the DRED run, 1.2 s before it), about 1 GB over the 15.1-15.2 GB DXGI budget. That fits video memory over-commit, but DRED does not name the cause, so read it as a hypothesis. **Setup** (as before) - RTX 5070 Ti 16 GB (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 10.0.26300, release. - Base: #2057 `f7e08e6` + my two local default-off commits, both on in every run (`XCL_EXP_WAIT_SUBMITTED=1`, `XCL_EXP_APU_MAP1=1`). - Env: `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512`, A at 30 s, compute pipelines precompiled. Each exe under its own name, so the driver's large shader cache file is not mapped. - `XCL_GPU_PROFILE=1` in the first five runs. `XCL_DRED=1` in the #1702 runs and in the DRED control. - Guard: kill at < 1.0 GB available RAM. - Candidates, each cherry-picked alone onto that base (no conflicts; only context lines differ): - `741cb5a` (pool heaps past budget − 1 GB go to system memory), as `a5adea6`; - #1702 head `670a0f9` with `XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1`, as `41df377`. - Tests on each branch, `cargo test --release -p xcl --lib -- d3d12x::sparse d3d12x::list_x gpu::fence d3d12x::vram --test-threads=1`: 59 / 0 / 1 (`741cb5a`) and 60 / 0 / 1 (#1702) passed / failed / ignored. #1702's vram tests with its switch on: 13 / 0 / 1, 0 skipped. **Runs** | run | world | end | local / non-local at the end | min available RAM | |---|---|---|---|---| | base | 68 s | removed `0x887a0005` at 117 s | 16.1 / 1.4 GB | 3.9 GB | | base + DRED | 79 s | removed `0x887a0005` at 117 s (DRED as above) | 16.0 / 1.5 GB | 3.9 GB | | `741cb5a` | 74 s | removed at 191 s, after 11 s with no presents and no submits | 16.1 / 1.9 GB | 2.5 GB | | `741cb5a` | 80 s | removed at 119 s | 15.8 / 1.9 GB | 3.7 GB | | #1702 | 74 s | guard, 0.61 GB available, 83 s | 4.1 / 9.6 GB | 0.8 GB | | #1702 | not reached | guard, 0.58 GB available, 80 s | 4.1 / 9.7 GB | 0.6 GB | - `741cb5a` worked as written. Its first system-memory heap came at 78-82 s (14.1 of 15.1 GB). By then the target-page pools were almost all made (9.8-9.9 of 10.1 GB). Local use kept growing in other allocations, mostly sparse pools (+0.7-1.2 GB), and ended 0.9-1.3 GB over the budget anyway. With one run on each side, I can't say it delays the removal. - #1702 moves about 8.6 GB of pools to system memory. Local use stays near 4 GB, but the working set rises to 19.2-19.5 GB, so on 32 GB the run is cut for RAM in the first seconds of the world. That is the trade I expected earlier. - No nvlddmkm / Display event in any run. The four programs gefydev asked about do not appear in any profile table. **Not tested:** either candidate on `main` without #2057, or without my two local switches; `XCL_VRAM_HEADROOM_MB` above 1024; #1702 with the driver's cache file mapped or with the default coherent window; DRED on the `741cb5a` build; more than one DRED run; `TdrDelay`; a lower guard floor; the whole test suite; AMD; other cards. Run and written with Claude Code (Claude Fable 5.2 and Claude Opus 5.5).
Author
Owner

@⁠imnicho on GitHub · 2026-11-25 13:06 UTC · original

Measured on Windows, a 16 GB NVIDIA card, Series X profile: when the world is set up about 92 % of the pages under the sampled textures on vram pages have nothing behind them, and giving a level its pages only with its texels takes the texture pages from 9.2 – 9.5 GB to 4.8 – 4.9 GB in the world. The world then gets through several times the draws, but the device is still lost: local video memory still reaches 19 GB, the rest of it other memory. This is @⁠shortside's finding (#1773) on the shared-pages path that comment left open. A plan for a PR is at the end.

Setup

  • RTX 5080 16 GB (driver 610.47, DXGI budget about 15.0 GB), i7-7700K, 16 GB RAM, Windows 10 22H2, release. The newer retail title (my own copy), XCL_NETWORK=0, scripted pad, runs of 300 s unless said.
  • Tree (local, not for upstream as it is): #2057 at 4df1e6e + main at 0f13d2a + #2067, #684, #266, #1515, #495, #1405, #751, #2092, #1803, #1887, #541, #2050, and two local commits: a census and the experiment (both below). XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1, compute pipelines built ahead.

1. The census (local diagnostic, every 30 s: the textures title_textures keeps in step that are on vram pages and CPU-filled, the 64 KiB pages under them where their bytes are read, and how many of those pages are committed, by VirtualQuery). One run without the experiment (it lost the device at 568 s, at 19.2 GB of local video memory); the world's set-up is at 130 s:

s textures they stand for pages under them of those committed
36 (menus) 502 422 MB 6 785 5 530 (345 MB)
97 (loading) 13 159 763 MB 12 342 6 429 (401 MB)
127 17 657 4 972 MB 80 690 6 809 (425 MB)
368 18 241 5 147 MB 83 692 5 854 (365 MB)
  • The title places about 4.2 GB of textures in the half minute before its world starts, with almost nothing behind them, and vram::place_pages gives every one of those pages video memory. In the menus there is next to nothing to save: those textures are loaded.
  • Two and a half minutes into the world (the two runs with the switch below) 10 313 of 84 482 and 11 258 of 90 830 pages are committed: 12 %.

2. With a level's pages mapped when an upload first has texels for it (local experiment XCL_TEXTURE_LEVEL_PAGES=1: a sampled 2D texture of one slice is placed with no tile mapped; a level's tiles – the packed levels as one group – get their pages before the first copy that has texels for them. The pages are the same ones by address as now, so textures at one address still share. GPU-written textures get all their pages.)

Two pairs of runs, alternating, the same binary and cache, graphics pipelines warm from earlier runs; texture pages and sparse pools from each run's last memory: line:

without with without with
texture pages (target pages) 9 227 MB 4 949 MB 9 483 MB 4 835 MB
sparse pools 2 432 MB 2 880 MB 2 816 MB 2 944 MB
local video memory, peak 20 382 MB 19 156 MB 22 003 MB 19 382 MB
draws / dispatches after the world's set-up 26 535 / 51 776 114 436 / 123 031 42 677 / 78 457 215 154 / 243 220
frames shown after it 32 51 350 458
end 300 s reached 0x887a0006 136 s after the set-up 0x887a0005 58 s after it 0x887a0006 160 s after it
  • With the switch 72 216 and 76 732 placed textures (those kept in step and the ones they shadow) had pages for 1 690 and 1 545 MB at the end (counted per texture: a page two of them share counts twice).
  • In the minute the world is set up, before it has much to draw, local video memory was 17.3 GB without and 12.9 GB with (one run each, while the graphics pipelines were still being built; the one with the switch then stood at 12.9 GB for the rest of its 1 200 s).
  • The logo and the loading artwork are right with the switch (frame captures). The world itself is grey on this tree with or without it (#697), so its textures could not be judged by eye. No upload failed in any run, and none of the five runs with the switch has a warning about a texture.
  • What is left: with the texture pages at 4.8 GB, local video memory still reaches 19 GB. About 4.1 GB would be the copy of the committed window (XCL_UMA_SHADOW, a 4 095 MB window) and 2.9 GB is the sparse pools; about 6 GB is none of the parts the memory: line names (about 1.3 GB in the menus). I have not taken that apart.

Not measured / limits

  • One card, one title, the Series X profile only. The runs differ in how far they get, so the totals of one column are not at the same point as the next one's; the texture pages are comparable.
  • Whether the device losses with the switch are the same ones as without it: the stalled wait before them is on the sparse windows' queue in both, not on the texture pages' queue, but I have no trace of the GPU's last work (the one run with XCL_DRED=1 and the switch ran its 300 s without losing the device).
  • A level the title unloads keeps its pages until the texture goes (not looked for).

Plan (CONTRIBUTING, "say what you are doing"): one PR for the place_pages path, behind the switch and off by default: vram.rs keeps a reserved texture's tiling as groups of tiles per level and maps a group when title_textures has texels for it; a texture the GPU writes gets all its pages. About 230 lines and two tests (the grouping; on the GPU: pages only for the levels with texels, the texels right, zeros where there are none, the largest level's pages when its texels come). It leaves arrays, volumes and the GPU-owned targets as they are and does not touch #1702 / #640. @⁠shortside, it is your idea on the other path: say if you see a reason the two should share code, or if you would rather it went another way.

AI use: Claude Code with Claude Fable 5.2 wrote the diagnostic and the experiment, ran the runs on the machine named and wrote this.

**@⁠imnicho** on GitHub · 2026-11-25 13:06 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7163300618) **Measured on Windows, a 16 GB NVIDIA card, Series X profile: when the world is set up about 92 % of the pages under the sampled textures on `vram` pages have nothing behind them, and giving a level its pages only with its texels takes the texture pages from 9.2 – 9.5 GB to 4.8 – 4.9 GB in the world. The world then gets through several times the draws, but the device is still lost: local video memory still reaches 19 GB, the rest of it other memory. This is @⁠shortside's finding (https://git.gtahub.st/github/xcl-dev--xcl/issues/1773) on the shared-pages path that comment left open. A plan for a PR is at the end.** **Setup** - RTX 5080 16 GB (driver 610.47, DXGI budget about 15.0 GB), i7-7700K, 16 GB RAM, Windows 10 22H2, release. The newer retail title (my own copy), `XCL_NETWORK=0`, scripted pad, runs of 300 s unless said. - Tree (local, not for upstream as it is): #2057 at `4df1e6e` + `main` at `0f13d2a` + #2067, #684, #266, #1515, #495, #1405, #751, #2092, #1803, #1887, #541, #2050, and two local commits: a census and the experiment (both below). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1`, compute pipelines built ahead. **1. The census** (local diagnostic, every 30 s: the textures `title_textures` keeps in step that are on `vram` pages and CPU-filled, the 64 KiB pages under them where their bytes are read, and how many of those pages are committed, by `VirtualQuery`). One run without the experiment (it lost the device at 568 s, at 19.2 GB of local video memory); the world's set-up is at 130 s: | s | textures | they stand for | pages under them | of those committed | |---|---|---|---|---| | 36 (menus) | 502 | 422 MB | 6 785 | 5 530 (345 MB) | | 97 (loading) | 13 159 | 763 MB | 12 342 | 6 429 (401 MB) | | 127 | 17 657 | 4 972 MB | 80 690 | 6 809 (425 MB) | | 368 | 18 241 | 5 147 MB | 83 692 | 5 854 (365 MB) | - The title places about 4.2 GB of textures in the half minute before its world starts, with almost nothing behind them, and `vram::place_pages` gives every one of those pages video memory. In the menus there is next to nothing to save: those textures are loaded. - Two and a half minutes into the world (the two runs with the switch below) 10 313 of 84 482 and 11 258 of 90 830 pages are committed: 12 %. **2. With a level's pages mapped when an upload first has texels for it** (local experiment `XCL_TEXTURE_LEVEL_PAGES=1`: a sampled 2D texture of one slice is placed with no tile mapped; a level's tiles – the packed levels as one group – get their pages before the first copy that has texels for them. The pages are the same ones by address as now, so textures at one address still share. GPU-written textures get all their pages.) Two pairs of runs, alternating, the same binary and cache, graphics pipelines warm from earlier runs; texture pages and sparse pools from each run's last `memory:` line: | | without | with | without | with | |---|---|---|---|---| | texture pages (`target pages`) | 9 227 MB | 4 949 MB | 9 483 MB | 4 835 MB | | sparse pools | 2 432 MB | 2 880 MB | 2 816 MB | 2 944 MB | | local video memory, peak | 20 382 MB | 19 156 MB | 22 003 MB | 19 382 MB | | draws / dispatches after the world's set-up | 26 535 / 51 776 | 114 436 / 123 031 | 42 677 / 78 457 | 215 154 / 243 220 | | frames shown after it | 32 | 51 | 350 | 458 | | end | 300 s reached | `0x887a0006` 136 s after the set-up | `0x887a0005` 58 s after it | `0x887a0006` 160 s after it | - With the switch 72 216 and 76 732 placed textures (those kept in step and the ones they shadow) had pages for 1 690 and 1 545 MB at the end (counted per texture: a page two of them share counts twice). - In the minute the world is set up, before it has much to draw, local video memory was 17.3 GB without and 12.9 GB with (one run each, while the graphics pipelines were still being built; the one with the switch then stood at 12.9 GB for the rest of its 1 200 s). - The logo and the loading artwork are right with the switch (frame captures). The world itself is grey on this tree with or without it (#697), so its textures could not be judged by eye. No upload failed in any run, and none of the five runs with the switch has a warning about a texture. - What is left: with the texture pages at 4.8 GB, local video memory still reaches 19 GB. About 4.1 GB would be the copy of the committed window (`XCL_UMA_SHADOW`, a 4 095 MB window) and 2.9 GB is the sparse pools; about 6 GB is none of the parts the `memory:` line names (about 1.3 GB in the menus). I have not taken that apart. **Not measured / limits** - One card, one title, the Series X profile only. The runs differ in how far they get, so the totals of one column are not at the same point as the next one's; the texture pages are comparable. - Whether the device losses with the switch are the same ones as without it: the stalled wait before them is on the sparse windows' queue in both, not on the texture pages' queue, but I have no trace of the GPU's last work (the one run with `XCL_DRED=1` and the switch ran its 300 s without losing the device). - A level the title unloads keeps its pages until the texture goes (not looked for). **Plan** (CONTRIBUTING, "say what you are doing"): one PR for the `place_pages` path, behind the switch and off by default: `vram.rs` keeps a reserved texture's tiling as groups of tiles per level and maps a group when `title_textures` has texels for it; a texture the GPU writes gets all its pages. About 230 lines and two tests (the grouping; on the GPU: pages only for the levels with texels, the texels right, zeros where there are none, the largest level's pages when its texels come). It leaves arrays, volumes and the GPU-owned targets as they are and does not touch #1702 / #640. @⁠shortside, it is your idea on the other path: say if you see a reason the two should share code, or if you would rather it went another way. **AI use:** Claude Code with Claude Fable 5.2 wrote the diagnostic and the experiment, ran the runs on the machine named and wrote this.
Author
Owner

@⁠shortside on GitHub · 2026-11-25 14:16 UTC · original

@⁠imnicho thanks for measuring it properly on Windows; the 12 % committed figure matches what I saw here (1.3 of 7.9 GB). Go ahead with the PR as you plan it, I see no reason to hold it for mine.

On sharing code: the two paths only meet in one place, so I would keep the rest apart.

  • Where they differ. Yours maps the title's own pages under a placed texture, so textures at one address still share. Mine (d3d12x/streamed-texture-level-tiles, on mac7) is for the case where vram::place_pages gives nothing, which on D3DMetal is every texture: each texture is a reserved resource with tiles of its own from pool heaps. The page bookkeeping has nothing in common.
  • Where they meet. The decision "this upload has texels for level N, map it first" in title_textures, and "the GPU writes this texture, map all of it". In my branch that is one call before texture::upload_batch (level_tiles::map_for(&queue, &batch)) and one in note_gpu_write (map_all). If yours hooks the same two places, a later change could make them one hook with two backends. I would not build that now; whichever lands second can fold it in.

Three things I ran into that may save you time:

  • The mapping has to go on the same queue as the copy and before it. With UpdateTileMappings on another queue the first copy can run against unmapped tiles.
  • The packed levels are one group, as you have it. I keep one slot per standard level plus one for the packed ones, taken from GetResourceTiling.
  • Tiles freed by a released texture: I do not hand them out again for 2 s, because work on the old texture may still be queued. On your path the pages belong to the title so this may not apply, but it is worth a look if a page can be unmapped while a copy is pending.

One limit we share: a level the title unloads keeps its memory until the texture goes. On a 24 GB Mac that has not mattered yet in loading, but it will in the world. If you find where the title tells us a level is gone, I would like to use the same signal.

I can run your PR on the Mac once it is up. place_pages gives nothing here, so it would only show that the switch does no harm on this host.

**@⁠shortside** on GitHub · 2026-11-25 14:16 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7165018291) @⁠imnicho thanks for measuring it properly on Windows; the 12 % committed figure matches what I saw here (1.3 of 7.9 GB). Go ahead with the PR as you plan it, I see no reason to hold it for mine. On sharing code: the two paths only meet in one place, so I would keep the rest apart. - **Where they differ.** Yours maps the title's own pages under a placed texture, so textures at one address still share. Mine ([`d3d12x/streamed-texture-level-tiles`](https://github.com/shortside/xcl/tree/d3d12x/streamed-texture-level-tiles), on `mac7`) is for the case where `vram::place_pages` gives nothing, which on D3DMetal is every texture: each texture is a reserved resource with tiles of its own from pool heaps. The page bookkeeping has nothing in common. - **Where they meet.** The decision "this upload has texels for level N, map it first" in `title_textures`, and "the GPU writes this texture, map all of it". In my branch that is one call before `texture::upload_batch` (`level_tiles::map_for(&queue, &batch)`) and one in `note_gpu_write` (`map_all`). If yours hooks the same two places, a later change could make them one hook with two backends. I would not build that now; whichever lands second can fold it in. Three things I ran into that may save you time: - The mapping has to go on the same queue as the copy and before it. With `UpdateTileMappings` on another queue the first copy can run against unmapped tiles. - The packed levels are one group, as you have it. I keep one slot per standard level plus one for the packed ones, taken from `GetResourceTiling`. - Tiles freed by a released texture: I do not hand them out again for 2 s, because work on the old texture may still be queued. On your path the pages belong to the title so this may not apply, but it is worth a look if a page can be unmapped while a copy is pending. One limit we share: a level the title unloads keeps its memory until the texture goes. On a 24 GB Mac that has not mattered yet in loading, but it will in the world. If you find where the title tells us a level is gone, I would like to use the same signal. I can run your PR on the Mac once it is up. `place_pages` gives nothing here, so it would only show that the switch does no harm on this host.
Author
Owner

@⁠crastinator on GitHub · 2026-11-25 16:15 UTC · original

Linux / RDNA2 data for the open VRAM PRs: an RX 6700 XT 12 GB with RADV under Wine, a retail title from a cold start into its world load (it starts at about 50 s). Each PR is merged onto main 06c9f55; release build, XCL_COHERENT_MB=512. My guard stops a run when the card reaches 11.5 GB.

local at 60 s texture pages (pools) sparse pools result
main 8693 MB 4626 (4800) 1152 card full at 87 s
main, XCL_VRAM_KEEP_SPARE_POOLS=0 8475 MB 4570 (4608) 1088 full at 89 s
#1182 6611 MB 2711 (2752) 1088 full at 90 s
#1916, XCL_DEFER_PRIVATE_HOME_TILES=1 8106 MB 4697 (4992) 320 full at 73 s
#1248 8009 MB 3963 (4032) 1216 full at 82 s
#2306, XCL_TEXTURE_LEVEL_PAGES=1 8250 MB 4390 (4416) 1088 fits: flat at about 9.4 GB from 90 s
#1182 + #1916 + #2306, both knobs 5750 MB 2379 (2624) 320 fits: 5.8 GB at 112 s
  • Only #2306 gets through on its own. #1182 (render targets) and #1916 (sparse pools) each take another 1–2 GB off, and their savings add up.
  • Everything outside XCL's own pools stays at about 2.4 GB in every run.
  • To stack #1182 and #2306 I had to resolve a conflict in Pages::bind: I passed #1182's phys through #2306's bind_range, and map_levels passes &[]. Lazy levels only apply to sampled textures and phys only to GPU-owned ones, so they don't overlap.
  • With VRAM out of the way, the next limit on a 16 GB Linux box is system RAM. With the Series X budget (13 824 MiB), the process reaches 11 GB plus swap within about 100–500 s, while the title builds its world compute pipelines (about one a second, no frames). Lowering title_memory_mb to 8192, or using the Series S profile, keeps RAM at 5.7 GB, but then the title never starts its world load: it sits at 60 fps with no storage reads. I don't know yet what it is waiting for.
  • I didn't check image quality.

AI use: Claude Code (Claude Opus 5.5) merged, built and ran these and wrote this; I checked the numbers.

**@⁠crastinator** on GitHub · 2026-11-25 16:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7167729046) Linux / RDNA2 data for the open VRAM PRs: an RX 6700 XT 12 GB with RADV under Wine, a retail title from a cold start into its world load (it starts at about 50 s). Each PR is merged onto `main` `06c9f55`; release build, `XCL_COHERENT_MB=512`. My guard stops a run when the card reaches 11.5 GB. | | local at 60 s | texture pages (pools) | sparse pools | result | |---|---|---|---|---| | `main` | 8693 MB | 4626 (4800) | 1152 | card full at 87 s | | `main`, `XCL_VRAM_KEEP_SPARE_POOLS=0` | 8475 MB | 4570 (4608) | 1088 | full at 89 s | | #1182 | 6611 MB | 2711 (2752) | 1088 | full at 90 s | | #1916, `XCL_DEFER_PRIVATE_HOME_TILES=1` | 8106 MB | 4697 (4992) | 320 | full at 73 s | | #1248 | 8009 MB | 3963 (4032) | 1216 | full at 82 s | | #2306, `XCL_TEXTURE_LEVEL_PAGES=1` | 8250 MB | 4390 (4416) | 1088 | **fits**: flat at about 9.4 GB from 90 s | | #1182 + #1916 + #2306, both knobs | 5750 MB | 2379 (2624) | 320 | **fits**: 5.8 GB at 112 s | - Only #2306 gets through on its own. #1182 (render targets) and #1916 (sparse pools) each take another 1–2 GB off, and their savings add up. - Everything outside XCL's own pools stays at about 2.4 GB in every run. - To stack #1182 and #2306 I had to resolve a conflict in `Pages::bind`: I passed #1182's `phys` through #2306's `bind_range`, and `map_levels` passes `&[]`. Lazy levels only apply to sampled textures and `phys` only to GPU-owned ones, so they don't overlap. - With VRAM out of the way, the next limit on a 16 GB Linux box is system RAM. With the Series X budget (13 824 MiB), the process reaches 11 GB plus swap within about 100–500 s, while the title builds its world compute pipelines (about one a second, no frames). Lowering `title_memory_mb` to 8192, or using the Series S profile, keeps RAM at 5.7 GB, but then the title never starts its world load: it sits at 60 fps with no storage reads. I don't know yet what it is waiting for. - I didn't check image quality. AI use: Claude Code (Claude Opus 5.5) merged, built and ran these and wrote this; I checked the numbers.
Author
Owner

@⁠yinx080 on GitHub · 2026-11-25 16:23 UTC · original

Same idea, Series S profile, 6 GB card: a data point for the PR plan above.

I have this running locally on the shared-pages path: a sampled texture placed by vram::place_pages gets no tile at placement. Before texture::upload_batch, each subresource with a non-zero byte gets its tiles (GetResourceTiling; the packed levels as one group, per slice). note_gpu_write maps all of it, and so does a texture title_textures::register refuses. An evicted texture (#640) comes back with nothing mapped.

  • RTX 3060 Laptop 6 GB, 15.3 GB RAM, Series S profile (device_type = "lockhart"), with #1182 / #1248 / #1663 / #640 (XCL_PAGE_BUDGET_MB=1536), runs of 300–600 s:
    • texture pages peak 3,183 MB → 969 MB;
    • video memory peak (local + non-local) 12.3 → 10.3 GB;
    • textures the budget evicted ~3,300 → 0.
  • A loading-screen panel that had drawn as flat silhouettes is right again. It was a budget eviction of a texture that is only ever sampled.
  • No crash in these runs. They stop presenting at FSR4 on compute compiles, not on memory.

I'm glad to run your PR on this laptop when it's up, as the small-card case.

AI use: Claude Code (Claude Opus 5.5) wrote the change and this comment; the runs are mine.

**@⁠yinx080** on GitHub · 2026-11-25 16:23 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7167898199) **Same idea, Series S profile, 6 GB card: a data point for the PR plan above.** I have this running locally on the shared-pages path: a sampled texture placed by `vram::place_pages` gets no tile at placement. Before `texture::upload_batch`, each subresource with a non-zero byte gets its tiles (`GetResourceTiling`; the packed levels as one group, per slice). `note_gpu_write` maps all of it, and so does a texture `title_textures::register` refuses. An evicted texture (#640) comes back with nothing mapped. - RTX 3060 Laptop 6 GB, 15.3 GB RAM, Series S profile (`device_type = "lockhart"`), with #1182 / #1248 / #1663 / #640 (`XCL_PAGE_BUDGET_MB=1536`), runs of 300–600 s: - texture pages peak **3,183 MB → 969 MB**; - video memory peak (local + non-local) **12.3 → 10.3 GB**; - textures the budget evicted ~3,300 → 0. - A loading-screen panel that had drawn as flat silhouettes is right again. It was a budget eviction of a texture that is only ever sampled. - No crash in these runs. They stop presenting at FSR4 on compute compiles, not on memory. I'm glad to run your PR on this laptop when it's up, as the small-card case. AI use: Claude Code (Claude Opus 5.5) wrote the change and this comment; the runs are mine.
Author
Owner

@⁠kole07139 on GitHub · 2026-11-25 18:21 UTC · original

8 GB data point for #2306 (XCL_TEXTURE_LEVEL_PAGES=1) on main, Windows. With it, local video memory peaks at 8.7 GB instead of 13.9 GB, and commit at 23.5–24.0 GB instead of 29.0 GB, so the title stays inside the RTX 3070's own memory for the first time here. The world load still stops at 96–110 s in all three runs, each time at the first mid-list Wait64 split, so on this card that stop is not video memory.

Setup

  • Hardware and software:
    • RTX 3070 8 GB (NVIDIA 617.42, 32-lane waves), i9-9900K, 32 GB RAM;
    • Windows 11 Pro N 26200, Rust 1.99.0, release.
  • main 55d64c2 unchanged; it has #2306, #1405 and #2080.
  • XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, no XCL_UMA_SHADOW.
  • 300 s runs, A pressed every 5 s from 15 s.
  • Every compute pipeline was precompiled first: xcl shaders --precompile --only cs --pipelines, 2 689 made, 0 refused, 63 min in one process.
  • The three runs came one after another on that cache.
run XCL_TEXTURE_LEVEL_PAGES peak local video memory (memory: line) peak process commit last presents first split command list (type 2) around mid-list Wait after Write64 (#1) end
1 1 8 680 MB 23 486 MB 110 s 112.7 s alive until 300 s, no present after the stop
2 unset 13 923 MB 28 957 MB 106 s 106.2 s the same
3 1 8 748 MB 23 988 MB 96 s 95.3 s the same
  • Run 1's own counters:
    • level pages: 6300 textures standing for 857 MB have pages for 224 MB (2048 levels given pages so far) at 49.7 s;
    • local video memory reached 8.58 GB and stayed at 8.68 GB from about 120 s on.
  • DirectStorage: 27–71 failed requests per 2 s window between 78 and 86 s in run 1, none in run 2. On 1a0bbe3, before #1405, there were hundreds in the same windows.
  • On screen (watched in run 2): when the prologue cutscene starts, a flat green frame, then black.
  • The stop: in all three runs presents end within ~3 s of the first mid-list split, the marker in #2057. That holds here on main, with and without the level pages.

Not tested

  • More runs; Series S; AMD.
  • XCL_UMA_SHADOW=1 together with level pages.
  • A run that gets past the stop: the memory picture in the world itself.

AI use: Claude Code (Claude Opus 5.5) built main, ran the precompile and the runs, read the logs and wrote this report. I watched run 2 and checked it before posting.

**@⁠kole07139** on GitHub · 2026-11-25 18:21 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7170788299) **8 GB data point for #2306 (`XCL_TEXTURE_LEVEL_PAGES=1`) on `main`, Windows. With it, local video memory peaks at 8.7 GB instead of 13.9 GB, and commit at 23.5–24.0 GB instead of 29.0 GB, so the title stays inside the RTX 3070's own memory for the first time here. The world load still stops at 96–110 s in all three runs, each time at the first mid-list `Wait64` split, so on this card that stop is not video memory.** **Setup** - Hardware and software: - RTX 3070 8 GB (NVIDIA 617.42, 32-lane waves), i9-9900K, 32 GB RAM; - Windows 11 Pro N 26200, Rust 1.99.0, release. - `main` `55d64c2` unchanged; it has #2306, #1405 and #2080. - `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, no `XCL_UMA_SHADOW`. - 300 s runs, A pressed every 5 s from 15 s. - Every compute pipeline was precompiled first: `xcl shaders --precompile --only cs --pipelines`, 2 689 made, 0 refused, 63 min in one process. - The three runs came one after another on that cache. | run | `XCL_TEXTURE_LEVEL_PAGES` | peak local video memory (`memory:` line) | peak process commit | last presents | first `split command list (type 2) around mid-list Wait after Write64 (#1)` | end | |---|---|---|---|---|---|---| | 1 | 1 | **8 680 MB** | **23 486 MB** | 110 s | 112.7 s | alive until 300 s, no present after the stop | | 2 | unset | 13 923 MB | 28 957 MB | 106 s | 106.2 s | the same | | 3 | 1 | **8 748 MB** | **23 988 MB** | 96 s | 95.3 s | the same | - **Run 1's own counters:** - `level pages: 6300 textures standing for 857 MB have pages for 224 MB (2048 levels given pages so far)` at 49.7 s; - local video memory reached 8.58 GB and stayed at 8.68 GB from about 120 s on. - **DirectStorage:** 27–71 failed requests per 2 s window between 78 and 86 s in run 1, none in run 2. On `1a0bbe3`, before #1405, there were hundreds in the same windows. - **On screen** (watched in run 2): when the prologue cutscene starts, a flat green frame, then black. - **The stop:** in all three runs presents end within ~3 s of the first mid-list split, the marker in https://git.gtahub.st/github/xcl-dev--xcl/pulls/2057. That holds here on `main`, with and without the level pages. **Not tested** - More runs; Series S; AMD. - `XCL_UMA_SHADOW=1` together with level pages. - A run that gets past the stop: the memory picture in the world itself. **AI use:** Claude Code (Claude Opus 5.5) built `main`, ran the precompile and the runs, read the logs and wrote this report. I watched run 2 and checked it before posting.
Author
Owner

@⁠razormontana on GitHub · 2026-11-25 19:09 UTC · original

I'm taking a small lazy texture follow-up to #2306. When a nonzero mip cannot get pages, I'll keep the texture eligible for a later upload of the same texels. I'll add regression coverage for a mapping failure followed by a retry.

Assisted by Codex (GPT-6.2 and GPT-6.2 Sol).

**@⁠razormontana** on GitHub · 2026-11-25 19:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7171895101) I'm taking a small lazy texture follow-up to #2306. When a nonzero mip cannot get pages, I'll keep the texture eligible for a later upload of the same texels. I'll add regression coverage for a mapping failure followed by a retry. Assisted by Codex (GPT-6.2 and GPT-6.2 Sol).
Author
Owner

@⁠voiceovarian1-max on GitHub · 2026-11-25 20:39 UTC · original

12 GB data point, Linux + NVIDIA: XCL's texture copies are the largest part of video memory, the title's heaps the next. With real textures the driver ran out of memory and crashed.

Setup: Proton Experimental's Wine + vkd3d-proton 3.1, RTX 4070 Ti 12 GB (NVIDIA 620.73.04), 31 GB RAM. Retail title, Series S profile, XCL_HEAP_WINDOWS=1, coherent window 3,072 MB (system RAM). Tree: #2057's head with other PRs merged locally.

at ~110 s (world load), no page budget MB
XCL's texture copies (page pools) ~6,800
the title's heaps in sparse windows ~4,800
render targets, arenas, other ~1,000
local / non-local (spilled) 10,500 / 3,300–9,100
  • With every texture kept (budget on, but nothing evictable) or textures off the page pools, 3 runs ended at 70–75 s in vkAllocateMemory Exception 0xc0000005 in Unix call, after NV_ERR_NO_MEMORY (system_mem.c) in the kernel log.
  • With CPU-filled textures given no memory (an experiment), the world loads and runs at 1–5 fps with 9.9 GB local + 3.4 GB non-local.

Not tested: Windows, AMD, cards with 16 GB or more.

AI use: measured and written with Claude Code (Claude Opus 5.5) from runs it made on this machine.

**@⁠voiceovarian1-max** on GitHub · 2026-11-25 20:39 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7173988913) **12 GB data point, Linux + NVIDIA: XCL's texture copies are the largest part of video memory, the title's heaps the next. With real textures the driver ran out of memory and crashed.** **Setup:** Proton Experimental's Wine + vkd3d-proton 3.1, RTX 4070 Ti 12 GB (NVIDIA 620.73.04), 31 GB RAM. Retail title, Series S profile, `XCL_HEAP_WINDOWS=1`, coherent window 3,072 MB (system RAM). Tree: #2057's head with other PRs merged locally. | at ~110 s (world load), no page budget | MB | |---|---| | XCL's texture copies (page pools) | ~6,800 | | the title's heaps in sparse windows | ~4,800 | | render targets, arenas, other | ~1,000 | | local / non-local (spilled) | 10,500 / 3,300–9,100 | - With every texture kept (budget on, but nothing evictable) or textures off the page pools, 3 runs ended at 70–75 s in `vkAllocateMemory Exception 0xc0000005 in Unix call`, after `NV_ERR_NO_MEMORY` (`system_mem.c`) in the kernel log. - With CPU-filled textures given no memory (an experiment), the world loads and runs at 1–5 fps with 9.9 GB local + 3.4 GB non-local. **Not tested:** Windows, AMD, cards with 16 GB or more. AI use: measured and written with Claude Code (Claude Opus 5.5) from runs it made on this machine.
Author
Owner

@⁠razormontana on GitHub · 2026-11-25 22:49 UTC · original

I’ll make lazy title texture uploads share one zero-filled staging span for zero mips. Each mip copy and its resource transitions stay in place. I’ll measure upload staging demand and check both zero and streamed texels with synthetic readback.

**@⁠razormontana** on GitHub · 2026-11-25 22:49 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7176824368) I’ll make lazy title texture uploads share one zero-filled staging span for zero mips. Each mip copy and its resource transitions stay in place. I’ll measure upload staging demand and check both zero and streamed texels with synthetic readback.
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 22:57 UTC · original

A data point from a card at the low end: on 4 GB of video memory the title reaches its profile selector and then runs out of video memory.

Setup: NVIDIA GeForce GTX 1650 (3,935 MiB VRAM, driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, a fixed 24 GB page file (commit limit 39.9 GB, ~34 GB free at start), Windows 11 26300, release build of main e1d84b7, DXC 1.9.2602.17, retail title, XCL_NETWORK=0 XCL_ACTIVITY=1, no input.

Series X profile (default), one 60 s run

  • The window is black until about 57 s, when the profile selector is drawn.
  • At 57.9 s: D3D12.X: command list … (type 0) Close → 0x8007000e, then the title stops on a breakpoint (0x80000003).
  • Last memory: line: 14,197 MB committed; video memory 6,147 MB local, 4,594 MB non-local; target pages 3,541 MB (pools 3,584); arenas 401 MB in use; sparse pools 896 MB (837 mapped).
  • Target pages went from 836 MB to 3,541 MB in the last 10 s.

Series S profile + XCL_TEXTURE_LEVEL_PAGES=1, one 90 s run

  • Black throughout; at 68.6 s CreateHeap(0x4000000 bytes, type 1, …) refused (0x8007000e), and the run ends the same way.
  • Peak: 17,182 MB committed; video memory 6,503 MB local; sparse pools 4,736 MB (4,706 mapped); target pages 1,209 MB.
  • So on this card the Series S profile was no help: fewer render targets, but much more of the title's memory in the sparse pools, which are video memory.

One run of each, so a pointer and not a rate. I looked at the window through screen captures; I did not compare against another card.

AI use: Claude Code (Claude Sonnet 5.5) ran these, read the logs and wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 22:57 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7176980474) A data point from a card at the low end: **on 4 GB of video memory the title reaches its profile selector and then runs out of video memory.** **Setup:** NVIDIA GeForce GTX 1650 (3,935 MiB VRAM, driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, a fixed 24 GB page file (commit limit 39.9 GB, ~34 GB free at start), Windows 11 26300, release build of `main` `e1d84b7`, DXC 1.9.2602.17, retail title, `XCL_NETWORK=0 XCL_ACTIVITY=1`, no input. **Series X profile (default), one 60 s run** - The window is black until about 57 s, when the profile selector is drawn. - At 57.9 s: `D3D12.X: command list … (type 0) Close → 0x8007000e`, then the title stops on a breakpoint (`0x80000003`). - Last `memory:` line: 14,197 MB committed; video memory **6,147 MB local**, 4,594 MB non-local; target pages 3,541 MB (pools 3,584); arenas 401 MB in use; sparse pools 896 MB (837 mapped). - Target pages went from 836 MB to 3,541 MB in the last 10 s. **Series S profile + `XCL_TEXTURE_LEVEL_PAGES=1`, one 90 s run** - Black throughout; at 68.6 s `CreateHeap(0x4000000 bytes, type 1, …) refused (0x8007000e)`, and the run ends the same way. - Peak: 17,182 MB committed; video memory 6,503 MB local; **sparse pools 4,736 MB (4,706 mapped)**; target pages 1,209 MB. - So on this card the Series S profile was no help: fewer render targets, but much more of the title's memory in the sparse pools, which are video memory. One run of each, so a pointer and not a rate. I looked at the window through screen captures; I did not compare against another card. AI use: Claude Code (Claude Sonnet 5.5) ran these, read the logs and wrote this comment for @⁠gefydev.
Author
Owner

@⁠philip-roy-jones on GitHub · 2026-11-26 00:49 UTC · original

I'm taking one piece of this: the title's display targets are 3840x2160 on any screen. XCL hands the title the PC's IDXGIOutput, so the console output's display-mode list (vtable slot 21) lands on a different PC method and returns DXGI_ERROR_INVALID_CALL; a trace on an RX 580 shows the count query fail just before the 4K targets are made. I'll answer it with the console modes that fit the PC display (1080p and below on a 1080p screen, as a Series X lists on a 1080p TV), with XCL_DISPLAY_MODE=WxH to force a size, and measure video memory and commit before and after. PR against main, stacked on #2038.

AI use: Claude Code (Claude Opus 5.5).

**@⁠philip-roy-jones** on GitHub · 2026-11-26 00:49 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7179156393) I'm taking one piece of this: the title's display targets are 3840x2160 on any screen. XCL hands the title the PC's IDXGIOutput, so the console output's display-mode list (vtable slot 21) lands on a different PC method and returns DXGI_ERROR_INVALID_CALL; a trace on an RX 580 shows the count query fail just before the 4K targets are made. I'll answer it with the console modes that fit the PC display (1080p and below on a 1080p screen, as a Series X lists on a 1080p TV), with `XCL_DISPLAY_MODE=WxH` to force a size, and measure video memory and commit before and after. PR against main, stacked on #2038. AI use: Claude Code (Claude Opus 5.5).
Author
Owner

@⁠dhillonjagdeep650-boop on GitHub · 2026-11-25 07:52 UTC · original · edited 2026-11-26 01:25 UTC

RTX 3080 Ti 12 GB: #2057 with the pool-heap budget of 741cb5a on top stays inside the DXGI budget at world load, and then the device is removed in a run of texture copies (3 of 3 runs). #2057 alone is not removed but takes 18.3 GB of local video memory and stops presenting. A combination I did not find reported here; @⁠vladbondarenko97 @⁠theaustinayers, since it is your two changes meeting.

Setup: RTX 3080 Ti 12 GB (driver 617.42), Ryzen 7 5800X, 48 GB RAM, Windows 11 Pro 26300.9974, DXC 1.8.2502.11, release builds. Retail 1.0.2.1, Series X profile, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0 XCL_ACTIVITY=1, all 2,689 compute pipelines pre-built for this tree (0 refused), fresh copy of the title data per run, a person plays from the menus into the world (first press at 16-26 s). scripts/smoke.ps1 -Seconds 300.

Trees: A = #2057 at f7e08e6. B = A + 741cb5a (fix/vram-budget) cherry-picked; one conflict, two tests added at the same place in vram.rs, both kept. The last B run also has #2131 and local SetName calls for the names below. Not pushed anywhere; say so if a branch would help.

B, run 1 B, run 2 (XCL_DRED=1) B, run 3 (XCL_DRED=1, names) A (XCL_DRED=1)
exit 0x887a0006 at 56.9 s 0x887a0006 at 75.2 s 0x887a0006 at 82.5 s 0x0 at 300 s
local video memory at the end 10.1 GB 10.7 GB 10.9 GB 18.3 GB (from 102 s)
non-local 2.7 GB 6.9 GB 7.8 GB 0.85 GB
title-texture pages (pools) 4.6 (4.9) GB 8.6 (9.0) GB 9.5 (9.9) GB 9.7 (10.0) GB
sparse pools 1.4 GB 1.9 GB 2.0 GB 2.0 GB
peak commit 24.3 GB 30.5 GB 32.8 GB 34.1 GB
presents per 2 s before the end 60, 56, 25 23, 41, 20 60, 32, 13 0 from ~96 s on
draws with translated pipelines 8 701 12 977 12 324 18 956
  • The budget does what it says on this tree. DXGI gives 10.0-10.5 GB here (less than the 11.3 GB reported above for the same card). With XCL_UMA_SHADOW=1 local use is already 9.5 GB in the menus (4.1 GB before any texture), so the first pool heap goes to system memory at 12.6-13.1 s, still in the menus; by the removal 32 to 64 heaps have. Local stays at 10.1-10.9 GB and the growth shows as non-local instead.
  • Then the device is removed, in texture copies. DRED, run 2: page fault at GPU VA 0x1046a00000; allocations there: [type 34], list 39 of 174 operations done, around: 8 8 8 >8 8 8. Run 3, with names: page fault at GPU VA 0x114ca1a000; allocations there: [type 34 xcl resource_at va=0xe8e094000 ...]; recently freed: [], list 11 of 38 operations done, around: 8 8 8 >8 8 8. Op 8 is CopyTextureRegion, type 34 a resource, and the name is #2131's for the texture real.rs's resource_at makes for a view by address. No fence time-out or watchdog line comes before it. The title's int3 at +0x2474606 follows.
  • A alone: no removal in 300 s, but 18.3 GB local against that 10.5 GB budget and no present after ~96 s, as in the 12 GB report above.

What this does not show: whether the faulting texture's tiles were on an L0 pool heap (the name does not say; #2131's name replaced my local one that had it), so "copies into tiles in system memory fault" is a guess. 741cb5a ran 600 s without a removal on a main-based tree, so the difference is somewhere in #2057's side: its partial texture uploads, XCL_UMA_SHADOW, or resource_at textures outliving what they were made over.

Not tested: B without XCL_UMA_SHADOW; XCL_COHERENT_HEAPS; more than one run of A; AMD; the same input in every run (a person played, so timings differ).

AI use: Claude Code with Claude Fable 5.2 built the trees, ran the scripts, read the logs and wrote this; a person played the runs.

Added 2026-11-25 08:06 UTC: B without XCL_UMA_SHADOW. Same tree as run 3 plus a second local diagnostic commit, same settings otherwise (XCL_DRED=1), one 300 s run, played:

  • exit 0x0, 0 device removals, 0 crashes, 1 641 frames, 14 155 draws, peak commit 30.0 GB. No removal in 300 s, against 3 of 3 with the shadow on.
  • The coherent window is back in non-local memory (4.1 GB at the start) and the menus use 6.2 GB local. The budget first acts at 54 s (8724 of 9805 MB budget), when the world streams in; 64 pool heaps are in system memory by 78 s. From 82 s to the end: 10.0 GB local, 9.2 GB non-local, title-texture pages 9.6 (10.0) GB, sparse pools 2.0 GB.
  • No present and no submit after 82 s (the last 218 s). In that time the log has only 13 huge graphics pipelines, each built when the title asks for it (wanted at once (no slot), driver blob absent): 2.6-5.9 s each, 47 s in all, 8 to 36 s apart. What the title waits on between them I do not know.
  • One run only. It fits "the removal needs XCL_UMA_SHADOW" but cannot rule out that it is only rarer without it.

Added 2026-11-25 (second addition): the stall of B without XCL_UMA_SHADOW in thread dumps, and XCL_PSO_WAIT_MS=50. For "What the title waits on between them I do not know" above; nothing new in kind: Anon64 showed the same wait in thread dumps of main on an RTX 3060 12 GB (#1798), and imnicho on #2057 (#2057). Same exe (0a8a692), no shadow, 300 s, XCL_PRESS_A_AT=16,20,24,28,32,36 instead of a person (A logged at 16.0 s, no controller), one run each:

control + XCL_PSO_WAIT_MS=50
exit, removals, crashes 0x0, 0, 0 0x0, 0, 0
last submit 78 s 297 s (the run's end)
frames shown, of them after 84 s 1574, 0 1589, 20
draws with translated pipelines (skipped) 13 387 (0) at the last count, 75 s 21 579 (5 302) at the last count, 207 s
dispatches (skipped) 8 192 (0) 82 990 (8 326)
huge graphics driver compiles after 84 s 21 76
GPU queue.Wait ... did not complete within lines 0 422, from 97 s
local / non-local at the end 10.2 / 9.1 GB 11.4 / 9.7 GB
peak commit 29.9 GB 35.0 GB
  • Control, XCL_THREAD_DUMP_AT=110,150,210: the same in 3 of 3 dumps. One title thread is in pso_async::resolve_wait under bind::execute_indirect; one xcl-pso worker is in translated_graphics_pso_once -> compile_console_shader -> dxc::compile; one dxc worker is in dxcompiler.dll and the other pso and dxc workers are idle. The 21 huge graphics driver compiles after 84 s never overlap and take 56 s, 26 % of that window; the log does not time the DXC part, so that it fills the rest is inferred from the three dumps. The prebuild I ran covers compute only.
  • With the wait limit the title does not stop, at about one frame per 10 s, with draws and dispatches skipped meanwhile. The one dump (150 s) has 13 pso workers waiting in dxc::compile, 5 dxc workers in dxcompiler.dll and 7 in dxc::wait_for_memory, whose gate asks for 6 GB of free commit plus 1 GB per running compile (this PC's commit limit is 61.4 GB).
  • My first addition says the no-shadow run was not removed in 300 s. frenziedcoder's no-shadow run of f7e08e6 was removed at 405.8 s (#2057), so 300 s was too short to say it is safe.
  • Not shown: whether the frames look right (nobody looked), how much of the frame time is the GPU (local memory is at the budget and 9.7 GB are read over the bus; GPU load was not sampled), and whether the first run's filled cache helped the second one. The order was control first, so the second run had 35 more driver blobs than the first began with.

AI use for this addition: Claude Code with Claude Opus 5.5 ran the scripts unattended, read the logs and dumps and wrote it.


Correction, added 2026-11-26 (@⁠joeypercia, thanks for the probe): my guess above that "copies into tiles in system memory fault" does not hold for later runs. On #2057 4df1e6e + the same additions, with a diagnostic that names how the faulting texture's tiles are held, 4 of 4 removals are in a resource_at texture that is unmapped (mapped=false, 0 tiles held in video memory, 0 in L0); #2270 is about that unmap. That agrees with your L0 cases not faulting; by your NULL cases an unmapped tile alone does not explain it either. I have not run your probe on the 3080 Ti. I did not repeat the earlier runs with that diagnostic, so what faulted in them is still not shown.

AI use for this addition: Claude Code with Claude Opus 5.5 ran the scripts unattended and wrote it.


Added 2026-11-26: RTX 3080 Ti 12 GB on main 2898511 + #2404 + #1182 + #1916 runs the retail title 420 s into the intro at a peak of 7.5-7.7 GB (two runs) of local video memory, presenting to the end. Without #1182 and #1916 it reaches 11.8 GB by 251 s. This confirms crastinator's numbers on an NVIDIA card; one run per row.

Setup: RTX 3080 Ti 12 GB (driver 617.42), Ryzen 7 5800X, 48 GB RAM, Windows 11 Pro 26300.9974, release; retail title 1.0.2.1, scripted A presses, XCL_NETWORK=0. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_MB=512 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_DRED=1. All compute pipelines prebuilt, graphics cold. One run per row; a guard of mine ends a run above 11.8 GB local.

run tree end local peak texture pages (pools) sparse pools peak commit
e7 main 240 s reached, 0x0 10.1 GB 4.7 (4.7) GB 2.6 GB 29.2 GB
e8 main 420 s reached, 0x0 9.8 GB 4.6 (4.7) GB 2.4 GB 28.4 GB
e9 + #2404 (and one barrier, see there) ended by the guard at 251 s 11.8 GB 5.0 (5.1) GB 3.2 GB 30.8 GB
e10 e9 + #1182 (d165e20) + #1916 (e2aa856, XCL_DEFER_PRIVATE_HOME_TILES=1) 420 s reached, 0x0 7.5 GB 3.3 (3.4) GB 0.4 GB 28.5 GB
e11 e10 with #1916's switch off access violation on an XCL thread at 297 s (see #751) 9.9 GB 3.2 (3.3) GB 3.1 GB 29.6 GB
e12 e10 + #751 (59f8e7c), #1916's switch on 420 s reached, 0x0 7.7 GB 3.3 (3.3) GB 0.4 GB 29.1 GB
  • No removal and no driver event in any of them; no crash but e11's.
  • e7 and e8 stop presenting at 142 and 122 s, in e8 with a title thread in dispatch_chain::Chain::whole (the stall #2404 removes), so their flat 10 GB is not the memory of a world that runs.
  • e9 keeps presenting (about one frame in 2 s) over black with credits. From 114 s to the end (251 s) local memory goes from 9.34 to 11.80 GB (+2.46): texture pools +0.64, sparse pools +1.09, the rest (+0.73) neither of the two. The split programs' scratch was 471 MiB then (most 879).
  • Earlier numbers from this card in this thread (12-15 GB) are #2057's tree with the shadow, so they are not a before/after for #2306.

Not tested: this card without XCL_TEXTURE_LEVEL_PAGES, a playable world (the 3D scene is not drawn in any run; with #1182 its place is mostly blue, see there).

AI use: Claude Code with Claude Opus 5.5 ran the scripts unattended, read the logs and wrote this.

**@⁠dhillonjagdeep650-boop** on GitHub · 2026-11-25 07:52 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7156349123) · edited 2026-11-26 01:25 UTC **RTX 3080 Ti 12 GB: #2057 with the pool-heap budget of `741cb5a` on top stays inside the DXGI budget at world load, and then the device is removed in a run of texture copies (3 of 3 runs). #2057 alone is not removed but takes 18.3 GB of local video memory and stops presenting.** A combination I did not find reported here; @⁠vladbondarenko97 @⁠theaustinayers, since it is your two changes meeting. **Setup:** RTX 3080 Ti 12 GB (driver 617.42), Ryzen 7 5800X, 48 GB RAM, Windows 11 Pro 26300.9974, DXC 1.8.2502.11, release builds. Retail 1.0.2.1, Series X profile, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, all 2,689 compute pipelines pre-built for this tree (0 refused), fresh copy of the title data per run, a person plays from the menus into the world (first press at 16-26 s). `scripts/smoke.ps1 -Seconds 300`. **Trees:** A = #2057 at `f7e08e6`. B = A + `741cb5a` (`fix/vram-budget`) cherry-picked; one conflict, two tests added at the same place in `vram.rs`, both kept. The last B run also has #2131 and local `SetName` calls for the names below. Not pushed anywhere; say so if a branch would help. | | B, run 1 | B, run 2 (`XCL_DRED=1`) | B, run 3 (`XCL_DRED=1`, names) | A (`XCL_DRED=1`) | |---|---|---|---|---| | exit | `0x887a0006` at 56.9 s | `0x887a0006` at 75.2 s | `0x887a0006` at 82.5 s | `0x0` at 300 s | | local video memory at the end | 10.1 GB | 10.7 GB | 10.9 GB | 18.3 GB (from 102 s) | | non-local | 2.7 GB | 6.9 GB | 7.8 GB | 0.85 GB | | title-texture pages (pools) | 4.6 (4.9) GB | 8.6 (9.0) GB | 9.5 (9.9) GB | 9.7 (10.0) GB | | sparse pools | 1.4 GB | 1.9 GB | 2.0 GB | 2.0 GB | | peak commit | 24.3 GB | 30.5 GB | 32.8 GB | 34.1 GB | | presents per 2 s before the end | 60, 56, 25 | 23, 41, 20 | 60, 32, 13 | 0 from ~96 s on | | draws with translated pipelines | 8 701 | 12 977 | 12 324 | 18 956 | - **The budget does what it says on this tree.** DXGI gives 10.0-10.5 GB here (less than the 11.3 GB reported above for the same card). With `XCL_UMA_SHADOW=1` local use is already 9.5 GB in the menus (4.1 GB before any texture), so the first pool heap goes to system memory at 12.6-13.1 s, still in the menus; by the removal 32 to 64 heaps have. Local stays at 10.1-10.9 GB and the growth shows as non-local instead. - **Then the device is removed, in texture copies.** DRED, run 2: `page fault at GPU VA 0x1046a00000; allocations there: [type 34]`, list `39 of 174 operations done, around: 8 8 8 >8 8 8`. Run 3, with names: `page fault at GPU VA 0x114ca1a000; allocations there: [type 34 xcl resource_at va=0xe8e094000 ...]; recently freed: []`, list `11 of 38 operations done, around: 8 8 8 >8 8 8`. Op 8 is CopyTextureRegion, type 34 a resource, and the name is #2131's for the texture `real.rs`'s `resource_at` makes for a view by address. No fence time-out or watchdog line comes before it. The title's int3 at `+0x2474606` follows. - **A alone:** no removal in 300 s, but 18.3 GB local against that 10.5 GB budget and no present after ~96 s, as in the 12 GB report above. **What this does not show:** whether the faulting texture's tiles were on an L0 pool heap (the name does not say; #2131's name replaced my local one that had it), so "copies into tiles in system memory fault" is a guess. `741cb5a` ran 600 s without a removal on a `main`-based tree, so the difference is somewhere in #2057's side: its partial texture uploads, `XCL_UMA_SHADOW`, or `resource_at` textures outliving what they were made over. **Not tested:** B without `XCL_UMA_SHADOW`; `XCL_COHERENT_HEAPS`; more than one run of A; AMD; the same input in every run (a person played, so timings differ). AI use: Claude Code with Claude Fable 5.2 built the trees, ran the scripts, read the logs and wrote this; a person played the runs. **Added 2026-11-25 08:06 UTC: B without `XCL_UMA_SHADOW`.** Same tree as run 3 plus a second local diagnostic commit, same settings otherwise (`XCL_DRED=1`), one 300 s run, played: - `exit 0x0`, 0 device removals, 0 crashes, 1 641 frames, 14 155 draws, peak commit 30.0 GB. No removal in 300 s, against 3 of 3 with the shadow on. - The coherent window is back in non-local memory (4.1 GB at the start) and the menus use 6.2 GB local. The budget first acts at 54 s (`8724 of 9805 MB budget`), when the world streams in; 64 pool heaps are in system memory by 78 s. From 82 s to the end: 10.0 GB local, 9.2 GB non-local, title-texture pages 9.6 (10.0) GB, sparse pools 2.0 GB. - No present and no submit after 82 s (the last 218 s). In that time the log has only 13 huge graphics pipelines, each built when the title asks for it (`wanted at once (no slot)`, `driver blob absent`): 2.6-5.9 s each, 47 s in all, 8 to 36 s apart. What the title waits on between them I do not know. - One run only. It fits "the removal needs `XCL_UMA_SHADOW`" but cannot rule out that it is only rarer without it. **Added 2026-11-25 (second addition): the stall of B without `XCL_UMA_SHADOW` in thread dumps, and `XCL_PSO_WAIT_MS=50`.** For "What the title waits on between them I do not know" above; nothing new in kind: Anon64 showed the same wait in thread dumps of `main` on an RTX 3060 12 GB (https://git.gtahub.st/github/xcl-dev--xcl/pulls/1798), and imnicho on #2057 (https://git.gtahub.st/github/xcl-dev--xcl/pulls/2057). Same exe (`0a8a692`), no shadow, 300 s, `XCL_PRESS_A_AT=16,20,24,28,32,36` instead of a person (A logged at 16.0 s, no controller), one run each: | | control | + `XCL_PSO_WAIT_MS=50` | |---|---|---| | exit, removals, crashes | `0x0`, 0, 0 | `0x0`, 0, 0 | | last submit | 78 s | 297 s (the run's end) | | frames shown, of them after 84 s | 1574, 0 | 1589, 20 | | draws with translated pipelines (skipped) | 13 387 (0) at the last count, 75 s | 21 579 (5 302) at the last count, 207 s | | dispatches (skipped) | 8 192 (0) | 82 990 (8 326) | | huge graphics driver compiles after 84 s | 21 | 76 | | `GPU queue.Wait ... did not complete within` lines | 0 | 422, from 97 s | | local / non-local at the end | 10.2 / 9.1 GB | 11.4 / 9.7 GB | | peak commit | 29.9 GB | 35.0 GB | - **Control, `XCL_THREAD_DUMP_AT=110,150,210`:** the same in 3 of 3 dumps. One title thread is in `pso_async::resolve_wait` under `bind::execute_indirect`; one `xcl-pso` worker is in `translated_graphics_pso_once` -> `compile_console_shader` -> `dxc::compile`; one dxc worker is in `dxcompiler.dll` and the other pso and dxc workers are idle. The 21 huge graphics driver compiles after 84 s never overlap and take 56 s, 26 % of that window; the log does not time the DXC part, so that it fills the rest is inferred from the three dumps. The prebuild I ran covers compute only. - **With the wait limit** the title does not stop, at about one frame per 10 s, with draws and dispatches skipped meanwhile. The one dump (150 s) has 13 pso workers waiting in `dxc::compile`, 5 dxc workers in `dxcompiler.dll` and 7 in `dxc::wait_for_memory`, whose gate asks for 6 GB of free commit plus 1 GB per running compile (this PC's commit limit is 61.4 GB). - My first addition says the no-shadow run was not removed in 300 s. frenziedcoder's no-shadow run of `f7e08e6` was removed at 405.8 s (https://git.gtahub.st/github/xcl-dev--xcl/pulls/2057), so 300 s was too short to say it is safe. - **Not shown:** whether the frames look right (nobody looked), how much of the frame time is the GPU (local memory is at the budget and 9.7 GB are read over the bus; GPU load was not sampled), and whether the first run's filled cache helped the second one. The order was control first, so the second run had 35 more driver blobs than the first began with. AI use for this addition: Claude Code with Claude Opus 5.5 ran the scripts unattended, read the logs and dumps and wrote it. --- **Correction, added 2026-11-26 (@⁠joeypercia, thanks for the probe):** my guess above that "copies into tiles in system memory fault" does not hold for later runs. On #2057 `4df1e6e` + the same additions, with a diagnostic that names how the faulting texture's tiles are held, 4 of 4 removals are in a `resource_at` texture that is unmapped (`mapped=false`, 0 tiles held in video memory, 0 in L0); #2270 is about that unmap. That agrees with your L0 cases not faulting; by your NULL cases an unmapped tile alone does not explain it either. I have not run your probe on the 3080 Ti. I did not repeat the earlier runs with that diagnostic, so what faulted in them is still not shown. AI use for this addition: Claude Code with Claude Opus 5.5 ran the scripts unattended and wrote it. --- **Added 2026-11-26: RTX 3080 Ti 12 GB on `main` `2898511` + #2404 + #1182 + #1916 runs the retail title 420 s into the intro at a peak of 7.5-7.7 GB (two runs) of local video memory, presenting to the end. Without #1182 and #1916 it reaches 11.8 GB by 251 s.** This confirms crastinator's numbers on an NVIDIA card; one run per row. **Setup:** RTX 3080 Ti 12 GB (driver 617.42), Ryzen 7 5800X, 48 GB RAM, Windows 11 Pro 26300.9974, release; retail title 1.0.2.1, scripted A presses, `XCL_NETWORK=0`. `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_MB=512 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_DRED=1`. All compute pipelines prebuilt, graphics cold. One run per row; a guard of mine ends a run above 11.8 GB local. | run | tree | end | local peak | texture pages (pools) | sparse pools | peak commit | |---|---|---|---|---|---|---| | e7 | `main` | 240 s reached, `0x0` | 10.1 GB | 4.7 (4.7) GB | 2.6 GB | 29.2 GB | | e8 | `main` | 420 s reached, `0x0` | 9.8 GB | 4.6 (4.7) GB | 2.4 GB | 28.4 GB | | e9 | + #2404 (and one barrier, see there) | ended by the guard at 251 s | 11.8 GB | 5.0 (5.1) GB | 3.2 GB | 30.8 GB | | e10 | e9 + #1182 (`d165e20`) + #1916 (`e2aa856`, `XCL_DEFER_PRIVATE_HOME_TILES=1`) | 420 s reached, `0x0` | **7.5 GB** | 3.3 (3.4) GB | 0.4 GB | 28.5 GB | | e11 | e10 with #1916's switch off | access violation on an XCL thread at 297 s (see #751) | 9.9 GB | 3.2 (3.3) GB | 3.1 GB | 29.6 GB | | e12 | e10 + #751 (`59f8e7c`), #1916's switch on | 420 s reached, `0x0` | **7.7 GB** | 3.3 (3.3) GB | 0.4 GB | 29.1 GB | - No removal and no driver event in any of them; no crash but e11's. - e7 and e8 stop presenting at 142 and 122 s, in e8 with a title thread in `dispatch_chain::Chain::whole` (the stall #2404 removes), so their flat 10 GB is not the memory of a world that runs. - e9 keeps presenting (about one frame in 2 s) over black with credits. From 114 s to the end (251 s) local memory goes from 9.34 to 11.80 GB (+2.46): texture pools +0.64, sparse pools +1.09, the rest (+0.73) neither of the two. The split programs' scratch was 471 MiB then (most 879). - Earlier numbers from this card in this thread (12-15 GB) are #2057's tree with the shadow, so they are not a before/after for #2306. **Not tested:** this card without `XCL_TEXTURE_LEVEL_PAGES`, a playable world (the 3D scene is not drawn in any run; with #1182 its place is mostly blue, see there). AI use: Claude Code with Claude Opus 5.5 ran the scripts unattended, read the logs and wrote this.
Author
Owner

@⁠gefydev on GitHub · 2026-11-26 01:42 UTC · original

4 GB card, 16 GB RAM: with a local mix of open work the retail title gets through its first settings, its loading art and into world loading, with no memory failure for 22 minutes. No world on screen yet.

Machine: NVIDIA GeForce GTX 1650 (3,935 MiB VRAM, driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, Windows 11 26300, DXC 1.9.2602.17. The title is on a hard disk. A fixed 24 GB page file on the SSD (commit limit 39.9 GB).

The build (local only, nothing of it pushed)
main e1d84b7, release, plus, applied in this order:

  1. @⁠vladbondarenko97's 741cb5a (title texture pages go to system memory once video memory is at its budget). Conflicts in vram.rs: Pages now uses push_heap, and both tests at the end are kept.
  2. #1916 (e2aa856, no GPU tiles for private physical page storage). README conflict only.
  3. #1182 (d165e20, render targets on one physical page share its video memory). One conflict in vram.rs: two test-only functions added at the same place, both kept.

I did not run the test suite on this mix, and these three have not been tested together by their authors as far as I know.

Switches: XCL_TEXTURE_LEVEL_PAGES=1, XCL_COHERENT_MB=2048, XCL_DEFER_PRIVATE_HOME_TILES=1 (#1916), XCL_NETWORK=0, XCL_ACTIVITY=1. Series X profile (default). Input by hand.

How it went, one run of each

build and switches furthest point end peak commit local / non-local video memory, peak
main, none profile selector Close → 0x8007000e at 51–58 s 14.1 GB 6.1 / 4.6 GB
main + 741cb5a, level pages, default coherent window (4095 MB) past the first settings, loading starts CreateHeap of a system memory heap refused at 134 s not recorded not recorded
same, XCL_COHERENT_MB=2048 into the loading of content Close → 0x8007000e at 392–397 s 19.1 GB 4.4 / 6.6 GB
+ #1916 + #1182 loading art, then a black screen while pipelines compile no failure in 1,318 s (closed by hand) 20.4 GB 3.3 / 5.0 GB

What #1916 and #1182 changed (near the same stage of two runs, so a comparison of two moments and not a controlled one)

without, at 170 s with, at 206 s
local video memory 3,521 MB 3,138 MB
non-local 5,586 MB 4,385 MB
sparse pools 960 MB 320 MB
target pages 3,436 MB 2,306 MB

The loading art drew correctly in a screen capture. I saw nothing broken up to there, which is little to judge #1182 by.

Where it stands now: compile time, not memory. The last frame was presented at 398 s. After that the screen stayed black with the title's audio running, while compute pipelines were built: 305 by 1,318 s, the big ones 12–33 s each in the driver and one at a time by default (gated, waits of up to 400 s). The GPU memory figures stayed flat. I closed the run and started xcl shaders --precompile --only cs --pipelines --used-only with the same build; a later run has not been made yet.

Other things tried on this card, which did not help

  • The Series S profile: more of the title's memory in the sparse pools (4.7 GB), out of video memory at about 70 s.
  • All texture pages in system memory (#1702's switch): the shared memory (about 8 GB here) filled up instead.
  • The nvidia-dev branch (c044dc6d) + 741cb5a: about the same as main + 741cb5a, so it was not needed to get to the settings screens.
  • XCL_TEXTURE_LEVEL_PAGES=1 alone: one run stayed up for 150 s, the next failed at 106 s.

With less than 17 GB of commit free at start (the usual case on this machine with the default page file), the log warns UMA: … commit free, under 17408 MB and the coherent window is only 512 MB.

Limits: few runs, one machine, no world drawn, no AMD or Intel, and the switches were not all taken out one by one in the last build.

AI use: Claude Code (Claude Sonnet 5.5) applied the commits, built, ran, read the logs and screen captures and wrote this for @⁠gefydev, who played the runs by hand.

**@⁠gefydev** on GitHub · 2026-11-26 01:42 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7180040446) **4 GB card, 16 GB RAM: with a local mix of open work the retail title gets through its first settings, its loading art and into world loading, with no memory failure for 22 minutes. No world on screen yet.** **Machine:** NVIDIA GeForce GTX 1650 (3,935 MiB VRAM, driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, Windows 11 26300, DXC 1.9.2602.17. The title is on a hard disk. A **fixed 24 GB page file** on the SSD (commit limit 39.9 GB). **The build (local only, nothing of it pushed)** `main` `e1d84b7`, release, plus, applied in this order: 1. @⁠vladbondarenko97's `741cb5a` (title texture pages go to system memory once video memory is at its budget). Conflicts in `vram.rs`: `Pages` now uses `push_heap`, and both tests at the end are kept. 2. #1916 (`e2aa856`, no GPU tiles for private physical page storage). README conflict only. 3. #1182 (`d165e20`, render targets on one physical page share its video memory). One conflict in `vram.rs`: two test-only functions added at the same place, both kept. I did not run the test suite on this mix, and these three have not been tested together by their authors as far as I know. **Switches:** `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_COHERENT_MB=2048`, `XCL_DEFER_PRIVATE_HOME_TILES=1` (#1916), `XCL_NETWORK=0`, `XCL_ACTIVITY=1`. Series X profile (default). Input by hand. **How it went, one run of each** | build and switches | furthest point | end | peak commit | local / non-local video memory, peak | |---|---|---|---|---| | `main`, none | profile selector | `Close → 0x8007000e` at 51–58 s | 14.1 GB | 6.1 / 4.6 GB | | `main` + `741cb5a`, level pages, default coherent window (4095 MB) | past the first settings, loading starts | `CreateHeap` of a system memory heap refused at 134 s | not recorded | not recorded | | same, `XCL_COHERENT_MB=2048` | into the loading of content | `Close → 0x8007000e` at 392–397 s | 19.1 GB | 4.4 / 6.6 GB | | **+ #1916 + #1182** | loading art, then a black screen while pipelines compile | **no failure in 1,318 s** (closed by hand) | 20.4 GB | **3.3 / 5.0 GB** | **What #1916 and #1182 changed** (near the same stage of two runs, so a comparison of two moments and not a controlled one) | | without, at 170 s | with, at 206 s | |---|---|---| | local video memory | 3,521 MB | 3,138 MB | | non-local | 5,586 MB | 4,385 MB | | sparse pools | 960 MB | 320 MB | | target pages | 3,436 MB | 2,306 MB | The loading art drew correctly in a screen capture. I saw nothing broken up to there, which is little to judge #1182 by. **Where it stands now: compile time, not memory.** The last frame was presented at 398 s. After that the screen stayed black with the title's audio running, while compute pipelines were built: 305 by 1,318 s, the big ones 12–33 s each in the driver and one at a time by default (`gated`, waits of up to 400 s). The GPU memory figures stayed flat. I closed the run and started `xcl shaders --precompile --only cs --pipelines --used-only` with the same build; a later run has not been made yet. **Other things tried on this card, which did not help** - The Series S profile: more of the title's memory in the sparse pools (4.7 GB), out of video memory at about 70 s. - All texture pages in system memory (#1702's switch): the shared memory (about 8 GB here) filled up instead. - The `nvidia-dev` branch (`c044dc6d`) + `741cb5a`: about the same as `main` + `741cb5a`, so it was not needed to get to the settings screens. - `XCL_TEXTURE_LEVEL_PAGES=1` alone: one run stayed up for 150 s, the next failed at 106 s. **With less than 17 GB of commit free** at start (the usual case on this machine with the default page file), the log warns `UMA: … commit free, under 17408 MB` and the coherent window is only 512 MB. **Limits:** few runs, one machine, no world drawn, no AMD or Intel, and the switches were not all taken out one by one in the last build. AI use: Claude Code (Claude Sonnet 5.5) applied the commits, built, ran, read the logs and screen captures and wrote this for @⁠gefydev, who played the runs by hand.
Author
Owner

@⁠imnicho on GitHub · 2026-11-26 01:49 UTC · original

Point 3, measured: the sparse windows' 64 MB pool heaps keep 1.5 – 2.0 GB of video memory (and commit) after the title has freed it, and most of that free space lies in wholly free 4 MB pieces. I am taking the pool heap size; a PR follows after an A/B.

Setup: RTX 5080 16 GB (driver 610.47), i7-7700K, 16 GB RAM, Windows 10 22H2, release, the retail title of #505 in the Series S profile, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1.

What the memory: line shows (main 6d12f58 + #2404, #2097, #684, #751; four runs of 390 – 476 s):

time sparse pools of them mapped free in live heaps
139 – 185 s (menus, loading) up to 4,992 MB (78 heaps) up to 4,603 MB 0.4 – 0.6 GB at the peak
after the world's set-up, to the end 4,608 – 4,800 MB (72 – 75 heaps) 2,734 – 3,243 MB 1.5 – 2.0 GB in three runs, up to 1.7 GB in the fourth

The world load unmaps 1.3 – 1.8 GB of tiles and 3 to 6 heaps of 78 go back: a heap is released only when all its 1,024 tiles are free (retire_free_pools), and the freed tiles are spread over nearly all heaps.

How the free tiles lie (a local counter over free and the cooling tiles, on nvidia-dev c044dc6d + #684, one run, every 20 s):

time heaps free tiles heaps wholly free in wholly free aligned blocks of 16 / 64 / 256 tiles
62 s 84 790 MB 0 571 / 452 / 224 MB
156 s 73 802 MB 0 729 / 672 / 464 MB
176 s 73 1,192 MB 0 1,113 / 1,036 / 736 MB
256 s (world load) 72 1,569 MB 0 1,046 / 932 / 608 MB

So with heaps of 64 tiles (4 MiB) 57 – 87 % of that free space would be in heaps that can go back (nine samples from 40 s to 256 s), with 16 MiB heaps 28 – 62 %, and 1 MiB heaps add little over 4 MiB.

What I will measure for the PR: main against POOL_TILES = 64, same title and settings: sparse pools against mapped, local video memory and process commit over the world load, the time of the tile-mapping and physical-page calls (more heaps mean more UpdateTileMappings calls and more CreateHeap calls), and the presents in the menus.

Not measured: cards other than this one; whether the driver minds ~1,200 small heaps behind one reserved buffer (the A/B will tell here).

AI use: Claude Code with Claude Fable 5.2 ran the runs and wrote this.

**@⁠imnicho** on GitHub · 2026-11-26 01:49 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7180167803) **Point 3, measured: the sparse windows' 64 MB pool heaps keep 1.5 – 2.0 GB of video memory (and commit) after the title has freed it, and most of that free space lies in wholly free 4 MB pieces. I am taking the pool heap size; a PR follows after an A/B.** **Setup:** RTX 5080 16 GB (driver 610.47), i7-7700K, 16 GB RAM, Windows 10 22H2, release, the retail title of #505 in the Series S profile, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1`. **What the `memory:` line shows** (`main` `6d12f58` + #2404, #2097, #684, #751; four runs of 390 – 476 s): | time | sparse pools | of them mapped | free in live heaps | |---|---:|---:|---:| | 139 – 185 s (menus, loading) | up to 4,992 MB (78 heaps) | up to 4,603 MB | 0.4 – 0.6 GB at the peak | | after the world's set-up, to the end | 4,608 – 4,800 MB (72 – 75 heaps) | 2,734 – 3,243 MB | **1.5 – 2.0 GB** in three runs, up to 1.7 GB in the fourth | The world load unmaps 1.3 – 1.8 GB of tiles and 3 to 6 heaps of 78 go back: a heap is released only when all its 1,024 tiles are free (`retire_free_pools`), and the freed tiles are spread over nearly all heaps. **How the free tiles lie** (a local counter over `free` and the cooling tiles, on `nvidia-dev` `c044dc6d` + #684, one run, every 20 s): | time | heaps | free tiles | heaps wholly free | in wholly free aligned blocks of 16 / 64 / 256 tiles | |---|---:|---:|---:|---| | 62 s | 84 | 790 MB | 0 | 571 / 452 / 224 MB | | 156 s | 73 | 802 MB | 0 | 729 / 672 / 464 MB | | 176 s | 73 | 1,192 MB | 0 | 1,113 / 1,036 / 736 MB | | 256 s (world load) | 72 | 1,569 MB | 0 | 1,046 / 932 / 608 MB | So with heaps of 64 tiles (4 MiB) 57 – 87 % of that free space would be in heaps that can go back (nine samples from 40 s to 256 s), with 16 MiB heaps 28 – 62 %, and 1 MiB heaps add little over 4 MiB. **What I will measure for the PR:** `main` against `POOL_TILES = 64`, same title and settings: sparse pools against mapped, local video memory and process commit over the world load, the time of the tile-mapping and physical-page calls (more heaps mean more `UpdateTileMappings` calls and more `CreateHeap` calls), and the presents in the menus. Not measured: cards other than this one; whether the driver minds ~1,200 small heaps behind one reserved buffer (the A/B will tell here). AI use: Claude Code with Claude Fable 5.2 ran the runs and wrote this.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-26 04:35 UTC · original

@/tmp/x1773c.md

**@⁠pickles976** on GitHub · 2026-11-26 04:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7182725778) @/tmp/x1773c.md
This discussion has been locked. Commenting is limited to contributors.
No description provided.