D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640

Open
github-bot wants to merge 1 commit from github-bot/gh-640 into main AGit
Owner

@⁠LeonardoS11 on GitHub · 2026-11-24 02:47 UTC · original
LeonardoS11:vram-page-budget → main · +507 −4 · 5 files · 1 commits · open

The title-texture pages in vram.rs (shared 64 KiB pages per title address, #248/#288) only ever grow: a page is kept while any live texture covers its address, and the pool heaps behind them are never released. A title that recycles texture memory inside its own allocator gives XCL no signal that the old textures are dead, so the pages cover every address the title ever used for textures, not what it uses now. On a retail title streaming its world after the menus, with XCL_ACTIVITY=1 and a temporary counter on a local build: the pages went from 3.6 GB in the menus to 9.7 GB (8.6 GB shared + 1.1 GB extra tiles, 62 k live targets) while the title's own crash context reported 3.6 of its 6.2 GB texture heap in use; local video memory reached 13.7 GB on a 12 GB card, frames dropped to 2–3 fps and the title's stall watchdog (+0x2215c35, #232) ended it. Related: #320, #345, #292 (a different approach: retiring overwritten placements).

This adds an opt-in budget, XCL_PAGE_BUDGET_MB. Unset or 0 keeps today's behaviour.

What is in it

  • crates/xcl/src/hle/d3d12x/vram.rs: pool_cap() turns the budget into a number of 64 MB pool heaps (kept per Pages as cap, so tests can set it). At the cap, take_tile takes the tiles the last eviction round gave back first; only when there are none does it call evict_lru, which unmaps the least recently touched evictable textures until 512 tiles came back. A round that finds nothing to evict is not repeated for a second (EVICT_IDLE), and the pools grow past the budget meanwhile. Evictable: only textures title_textures keeps in step with the title's memory (set_evictable from register), of 4 tiles or more, not placed, remapped, transitioned or uploaded in the last 5 s, and not written by the GPU (pin). Pages another mapped texture still shares stay. revive maps an evicted texture again and takes it out of the evicted set only when that worked. The budget needs late release (XCL_LATE_RELEASE=0 turns it off with a warning): evicting unmaps a texture from another thread, which is safe only while a texture's last Release reaches vram::forget before the object goes.
  • crates/xcl/src/hle/d3d12x/title_textures.rs: evicted textures are mapped again before the work that uses them. revive_listed runs before a submit, ahead of refresh, for the textures its lists transition (references taken under the TEXTURES lock), and marks them pending so this submit's refresh uploads them whole. A texture written again by the CPU is mapped again in refresh_once before its upload (if that fails it stays evicted and is not uploaded). A copy into an evicted texture maps it again when it is recorded (note_gpu_write), with no upload over what the GPU writes. Uploads and submitted transitions refresh the LRU time. forget_content drops the #486 content hash of a texture mapped again so the unchanged-upload skip does not leave its fresh tiles empty.
  • crates/xcl/src/hle/d3d12x/real.rs, list_x.rs: call revive_listed before refresh in ExecuteCommandLists and KickoffX (in KickoffX the refresh moved after reclaim_for_kickoff, which only does bookkeeping, so the segments split before it are covered).
  • crates/xcl/src/host.rs: one page budget: N textures evicted, M mapped again line next to the XCL_ACTIVITY memory line, only once something was evicted.

Changes since the review (thanks @⁠mastrr9, @⁠iggyvilla and the review above): eviction no longer repeats for every tile of a placement at the cap; textures are mapped again before the submit that uses them instead of after it; a failed remap keeps the texture evicted; no vram code dereferences a key of a texture that may be gone (late release required, references cloned under the lock in the revive path); uploads refresh the LRU time; textures title_textures refused are never evicted; a copy into an evicted texture maps it first; pin/touch return at once with the budget off.

Known limit: XCL does not see the title read a texture, only write, copy into or transition it. An evicted texture the title still samples without any of those reads as zero (tier-2 unmapped tiles) until one happens, and a draw already queued may read zero or, at the cap, the newer texels of a reused tile for a frame. That is why the budget is opt-in.

Tested

  • NVIDIA GeForce RTX 3080 Ti (12 GB, 32-lane waves), AMD Ryzen 9 5900X, 64 GB; Windows 11 Pro 26200; Rust stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100).
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug) on 5d6fac8: 744 passed, 0 failed, 41 ignored. The three tests, all GPU:
    • page_budget_evicts_the_least_recently_touched_cpu_filled_texture (vram.rs): the oldest evictable texture goes first, its pages go back, a GPU-written one stays, a round with nothing evictable returns 0, an evicted one maps again once.
    • page_budget_one_placement_at_the_cap_evicts_one_batch (vram.rs): 40 textures of 16 tiles, pools at the cap with no spare tile, one more texture placed: the 32 oldest (one batch of 512 tiles) are evicted and the rest stay. It fails without the take-the-batch-first change (40 evicted).
    • page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it (title_textures.rs): an evicted texture a list transitions is mapped again by revive_listed, pending, its content hash forgotten; a copy recorded into an evicted texture maps it again with no upload pending.
  • SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title with XCL_PAGE_BUDGET_MB=6144, XCL_NETWORK=0, XCL_ACTIVITY=1, walked through the menus into its first world load. These runs were on a local build that also carried other open PRs (#267, #533, #532, #348) and local diagnostics, not on this branch alone, so they show what the budget does, not this branch's numbers: pages held at 4.6–6.0 GB and local video memory at 10.1 GB (13.7 GB without the budget), 9,791 textures evicted and 1,094 mapped again over 456 s, 30 fps in the menus, the world's geometry drawn. The title still stops at the #232 watchdog later on this machine, for compile stalls this PR does not address.

Regression run

Same title, 60 s, no input, budget unset (the default this PR keeps).

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3080 Ti
title: Jogo
seconds: 60
exit: 0x0
frames shown: 1290 (PresentX 1290)
presents per 2 s (last 3): 60 41 4
device removals: 0
crashes: 0
peak commit: 16156 MB

this PR:

xcl-smoke v1
commit: 5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a
gpu: NVIDIA GeForce RTX 3080 Ti
title: Jogo
seconds: 60
exit: 0x0
frames shown: 1429 (PresentX 1429)
presents per 2 s (last 3): 60 60 36
device removals: 0
crashes: 0
peak commit: 18100 MB

Both runs drop presents in their last seconds, the main run more than this PR's, so the drop is not from this PR (on this main the recompiler output changed, and the title's shaders were compiling again).

Not tested

  • AMD and Intel GPUs; cards with less video memory.
  • This branch alone with the budget set on the retail title (only on the local build above). A 60 s run without input stays in the menus, where the pages (about 3.6 GB) never reach a budget, so the regression run does not exercise eviction.
  • Whether textures evicted and never rewritten, copied into or transitioned show up empty in a visible place: the runs above did not look for it.
  • The review fixes on the retail title with the budget set: only the unit tests and the regression run (budget unset) above ran on 5d6fac8.

AI use

  • Claude Code with Claude Opus 5.5: measured the growth, wrote the code, the two tests and this description, and ran the tests and the regression runs on the hardware above. Opened as a draft until I have reviewed the diff myself.

🤖 Generated with Claude Code

**@⁠LeonardoS11** on GitHub · 2026-11-24 02:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/640) `LeonardoS11:vram-page-budget` → `main` · +507 −4 · 5 files · 1 commits · open The title-texture pages in `vram.rs` (shared 64 KiB pages per title address, #248/#288) only ever grow: a page is kept while any live texture covers its address, and the pool heaps behind them are never released. A title that recycles texture memory inside its own allocator gives XCL no signal that the old textures are dead, so the pages cover every address the title ever used for textures, not what it uses now. On a retail title streaming its world after the menus, with `XCL_ACTIVITY=1` and a temporary counter on a local build: the pages went from 3.6 GB in the menus to 9.7 GB (8.6 GB shared + 1.1 GB extra tiles, 62 k live targets) while the title's own crash context reported 3.6 of its 6.2 GB texture heap in use; local video memory reached 13.7 GB on a 12 GB card, frames dropped to 2–3 fps and the title's stall watchdog (`+0x2215c35`, #232) ended it. Related: #320, #345, #292 (a different approach: retiring overwritten placements). This adds an opt-in budget, `XCL_PAGE_BUDGET_MB`. Unset or 0 keeps today's behaviour. **What is in it** - `crates/xcl/src/hle/d3d12x/vram.rs`: `pool_cap()` turns the budget into a number of 64 MB pool heaps (kept per `Pages` as `cap`, so tests can set it). At the cap, `take_tile` takes the tiles the last eviction round gave back first; only when there are none does it call `evict_lru`, which unmaps the least recently touched evictable textures until 512 tiles came back. A round that finds nothing to evict is not repeated for a second (`EVICT_IDLE`), and the pools grow past the budget meanwhile. Evictable: only textures `title_textures` keeps in step with the title's memory (`set_evictable` from `register`), of 4 tiles or more, not placed, remapped, transitioned or uploaded in the last 5 s, and not written by the GPU (`pin`). Pages another mapped texture still shares stay. `revive` maps an evicted texture again and takes it out of the evicted set only when that worked. The budget needs late release (`XCL_LATE_RELEASE=0` turns it off with a warning): evicting unmaps a texture from another thread, which is safe only while a texture's last `Release` reaches `vram::forget` before the object goes. - `crates/xcl/src/hle/d3d12x/title_textures.rs`: evicted textures are mapped again before the work that uses them. `revive_listed` runs before a submit, ahead of `refresh`, for the textures its lists transition (references taken under the `TEXTURES` lock), and marks them pending so this submit's refresh uploads them whole. A texture written again by the CPU is mapped again in `refresh_once` before its upload (if that fails it stays evicted and is not uploaded). A copy into an evicted texture maps it again when it is recorded (`note_gpu_write`), with no upload over what the GPU writes. Uploads and submitted transitions refresh the LRU time. `forget_content` drops the #486 content hash of a texture mapped again so the unchanged-upload skip does not leave its fresh tiles empty. - `crates/xcl/src/hle/d3d12x/real.rs`, `list_x.rs`: call `revive_listed` before `refresh` in `ExecuteCommandLists` and `KickoffX` (in `KickoffX` the refresh moved after `reclaim_for_kickoff`, which only does bookkeeping, so the segments split before it are covered). - `crates/xcl/src/host.rs`: one `page budget: N textures evicted, M mapped again` line next to the `XCL_ACTIVITY` memory line, only once something was evicted. Changes since the review (thanks @⁠mastrr9, @⁠iggyvilla and the review above): eviction no longer repeats for every tile of a placement at the cap; textures are mapped again before the submit that uses them instead of after it; a failed remap keeps the texture evicted; no `vram` code dereferences a key of a texture that may be gone (late release required, references cloned under the lock in the revive path); uploads refresh the LRU time; textures `title_textures` refused are never evicted; a copy into an evicted texture maps it first; `pin`/`touch` return at once with the budget off. Known limit: XCL does not see the title read a texture, only write, copy into or transition it. An evicted texture the title still samples without any of those reads as zero (tier-2 unmapped tiles) until one happens, and a draw already queued may read zero or, at the cap, the newer texels of a reused tile for a frame. That is why the budget is opt-in. **Tested** - NVIDIA GeForce RTX 3080 Ti (12 GB, 32-lane waves), AMD Ryzen 9 5900X, 64 GB; Windows 11 Pro 26200; Rust stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100). - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug) on `5d6fac8`: 744 passed, 0 failed, 41 ignored. The three tests, all GPU: - `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` (vram.rs): the oldest evictable texture goes first, its pages go back, a GPU-written one stays, a round with nothing evictable returns 0, an evicted one maps again once. - `page_budget_one_placement_at_the_cap_evicts_one_batch` (vram.rs): 40 textures of 16 tiles, pools at the cap with no spare tile, one more texture placed: the 32 oldest (one batch of 512 tiles) are evicted and the rest stay. It fails without the take-the-batch-first change (40 evicted). - `page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it` (title_textures.rs): an evicted texture a list transitions is mapped again by `revive_listed`, pending, its content hash forgotten; a copy recorded into an evicted texture maps it again with no upload pending. - SKIPPED on this adapter: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). - Retail title with `XCL_PAGE_BUDGET_MB=6144`, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, walked through the menus into its first world load. These runs were on a **local build that also carried other open PRs (#267, #533, #532, #348) and local diagnostics**, not on this branch alone, so they show what the budget does, not this branch's numbers: pages held at 4.6–6.0 GB and local video memory at 10.1 GB (13.7 GB without the budget), 9,791 textures evicted and 1,094 mapped again over 456 s, 30 fps in the menus, the world's geometry drawn. The title still stops at the #232 watchdog later on this machine, for compile stalls this PR does not address. **Regression run** Same title, 60 s, no input, budget unset (the default this PR keeps). main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3080 Ti title: Jogo seconds: 60 exit: 0x0 frames shown: 1290 (PresentX 1290) presents per 2 s (last 3): 60 41 4 device removals: 0 crashes: 0 peak commit: 16156 MB ``` this PR: ``` xcl-smoke v1 commit: 5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a gpu: NVIDIA GeForce RTX 3080 Ti title: Jogo seconds: 60 exit: 0x0 frames shown: 1429 (PresentX 1429) presents per 2 s (last 3): 60 60 36 device removals: 0 crashes: 0 peak commit: 18100 MB ``` Both runs drop presents in their last seconds, the `main` run more than this PR's, so the drop is not from this PR (on this `main` the recompiler output changed, and the title's shaders were compiling again). **Not tested** - AMD and Intel GPUs; cards with less video memory. - This branch alone with the budget set on the retail title (only on the local build above). A 60 s run without input stays in the menus, where the pages (about 3.6 GB) never reach a budget, so the regression run does not exercise eviction. - Whether textures evicted and never rewritten, copied into or transitioned show up empty in a visible place: the runs above did not look for it. - The review fixes on the retail title with the budget set: only the unit tests and the regression run (budget unset) above ran on `5d6fac8`. **AI use** - Claude Code with Claude Opus 5.5: measured the growth, wrote the code, the two tests and this description, and ran the tests and the regression runs on the hardware above. Opened as a draft until I have reviewed the diff myself. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title-texture pages (vram.rs) grow with every 64 KiB page of title
memory a texture has ever covered: pool heaps are never released, and a
title that recycles texture memory inside its own allocator gives no
signal that the old textures are dead. On a retail title that streams
its world this reached 9.7 GB of pages (13.7 GB of local video memory on
a 12 GB card) and the driver paging stalls set off the title's watchdog.

XCL_PAGE_BUDGET_MB caps the pool heaps. At the cap, take_tile first takes
the tiles the last eviction round gave back; only when there are none
does it evict the least recently touched textures title_textures keeps in
step with the title's memory (never GPU-owned targets, never textures the
GPU wrote, none under 4 tiles or touched in the last 5 s) until 512 tiles
came back. A round that finds nothing to evict is not repeated for a
second (EVICT_IDLE): the pools grow past the budget meanwhile. Without
that, every tile of a big texture walked all live targets (62 000 on the
retail title) and held the title's CreatePlacedResourceX thread long
enough for its stall watchdog.

An evicted texture is mapped again before the work that uses it: before
a submit whose lists transition it (revive_listed, ahead of refresh, so
that submit uploads it whole), when the CPU wrote it again (before its
upload), and when a copy into it is recorded (no upload over the GPU's
texels). A failed remap keeps it evicted. Its content hash is forgotten
so the unchanged-upload skip does not leave it out. Uploads and submitted
transitions refresh the LRU time.

Evicting unmaps a texture from another thread, which is safe only while a
texture's last Release reaches vram::forget before the object goes, so
the budget requires late release. Unset or 0 keeps the current behaviour.

Tests (GPU): page_budget_evicts_the_least_recently_touched_cpu_filled_texture
and page_budget_one_placement_at_the_cap_evicts_one_batch (vram.rs; the
second fails without the take-from-the-batch-first change: 40 textures
evicted instead of 32), and
page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it
(title_textures.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:28:10 +00:00
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 03:08 UTC · original

Tested on NVIDIA GeForce RTX 3060 Ti (8 GB, wave32).

Tested

  • Commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac (pr-640, clean tree)
  • Hardware / software: Windows 11 Home Build 26200, Ryzen 5 5500, 31.8 GB RAM, RTX 3060 Ti (8024 MiB VRAM, driver 32.0.16.2101), rustc 1.100.0 (x86_64-pc-windows-msvc, MSVC 14.44.35207), DXC 1.9.2602.17 (SDK 10.0.26100.0), --release
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4: 688 passed, 0 failed, 41 ignored, exit 0; 2 (no wave64) skipped (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware)

Regression run (scripts/smoke.ps1, 60 s, XCL_NETWORK=0, title folder name redacted)

main (dd2ae9a):

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1525 (PresentX 1525)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14720 MB

PR #640 (38bf6a3, XCL_PAGE_BUDGET_MB unset):

xcl-smoke v1
commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1573 (PresentX 1574)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14718 MB

PR #640 (38bf6a3, XCL_PAGE_BUDGET_MB=2048):

xcl-smoke v1
commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1540 (PresentX 1540)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14583 MB
  • With XCL_PAGE_BUDGET_MB=2048, xcl.log reported page budget: 92 textures evicted, 0 mapped again, target pages 3403 MB (pools 3456 MB) and 6016 MB local VRAM at 58 s (down from 3577 MB / pools 3584 MB and 6144 MB local on main).

Not tested: Walking past the start/menu screens into world streaming, debug build, XCL_SAMPLE_* tests on this branch, AMD / wave64.

AI use: Antigravity (Gemini 4 Hydrogen) ran the builds, tests, and smoke runs and drafted this report from the actual command outputs and logs.

**@⁠LocranKing** on GitHub · 2026-11-24 03:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7120811138) Tested on NVIDIA GeForce RTX 3060 Ti (8 GB, wave32). **Tested** - Commit: `38bf6a324ac3d11387b81592f3dd5fd6fe38ddac` (`pr-640`, clean tree) - Hardware / software: Windows 11 Home Build 26200, Ryzen 5 5500, 31.8 GB RAM, RTX 3060 Ti (`8024 MiB VRAM`, driver `32.0.16.2101`), `rustc 1.100.0` (`x86_64-pc-windows-msvc`, MSVC `14.44.35207`), DXC `1.9.2602.17` (SDK `10.0.26100.0`), `--release` - `cargo test --workspace --release --no-fail-fast -- --test-threads=4`: **688 passed, 0 failed, 41 ignored**, exit `0`; `2 (no wave64)` skipped (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`) **Regression run** (`scripts/smoke.ps1`, 60 s, `XCL_NETWORK=0`, title folder name redacted) main (`dd2ae9a`): ``` xcl-smoke v1 commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1525 (PresentX 1525) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14720 MB ``` PR #640 (`38bf6a3`, `XCL_PAGE_BUDGET_MB` unset): ``` xcl-smoke v1 commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1573 (PresentX 1574) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14718 MB ``` PR #640 (`38bf6a3`, `XCL_PAGE_BUDGET_MB=2048`): ``` xcl-smoke v1 commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1540 (PresentX 1540) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14583 MB ``` - With `XCL_PAGE_BUDGET_MB=2048`, `xcl.log` reported `page budget: 92 textures evicted, 0 mapped again`, `target pages 3403 MB (pools 3456 MB)` and `6016 MB local` VRAM at 58 s (down from `3577 MB` / `pools 3584 MB` and `6144 MB local` on `main`). **Not tested:** Walking past the start/menu screens into world streaming, debug build, `XCL_SAMPLE_*` tests on this branch, AMD / wave64. **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the builds, tests, and smoke runs and drafted this report from the actual command outputs and logs.
Author
Owner

@⁠thatirishguyyy on GitHub · 2026-11-24 03:14 UTC · original

Independent Windows Radeon comparison on 38bf6a3, RX 9070 XT (driver 32.0.32029.2010), release. Both focused regressions passed, including GPU eviction and re-upload after eviction.

I ran the same binary and saved profile with XCL_PAGE_BUDGET_MB=0 and 4608. Starting available system commit differed by about 78 MiB. At the final logged streaming sample, the texture pool was 5,184 MiB off / 4,672 MiB on, local video memory 8,653 / 8,212 MiB, and process commit 19,159 / 19,051 MiB. The budget run evicted 554 textures and remapped 11. Both runs ended at an external 5 GiB system-commit guard during world streaming. One pair does not establish a performance difference.

AI-assisted (Codex ran and summarized the measurements).

**@⁠thatirishguyyy** on GitHub · 2026-11-24 03:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7120911007) Independent Windows Radeon comparison on `38bf6a3`, RX 9070 XT (driver 32.0.32029.2010), release. Both focused regressions passed, including GPU eviction and re-upload after eviction. I ran the same binary and saved profile with `XCL_PAGE_BUDGET_MB=0` and `4608`. Starting available system commit differed by about 78 MiB. At the final logged streaming sample, the texture pool was 5,184 MiB off / 4,672 MiB on, local video memory 8,653 / 8,212 MiB, and process commit 19,159 / 19,051 MiB. The budget run evicted 554 textures and remapped 11. Both runs ended at an external 5 GiB system-commit guard during world streaming. One pair does not establish a performance difference. AI-assisted (Codex ran and summarized the measurements).
Author
Owner

@⁠albertoglvn on GitHub · 2026-11-24 03:55 UTC · original

8 GB data point with the budget set. Native Windows 11, RTX 4060 Laptop 8 GB (7956 MiB), driver 621.24, 15 GB RAM + 40 GB page file, release MSVC build. The newer retail title (TitleID 7952987A), Series X profile, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_PAGE_BUDGET_MB=4096. Build: #484 head (9783066) with #495 (3ae0841), #496 (409f40f) and this PR (38bf6a3) cherry-picked on top. They applied cleanly. cargo test --lib -p xcl -- title_textures:: vram:: passes (18 passed).

Compared with the same base without this PR (#333 comment, one run each):

without budget budget 4096 MB
ended at 277.5 s, #333 assert (+0x193e00f, E_OUTOFMEMORY) 320.9 s, +0x23cf683 write at 0 (watchdog, #232)
"no video memory for more pages" 9 0
target pages, peak 6623 MB 5306 MB
page pools, peak 6656 MB 5312 MB
sparse pools, peak 1792 MB 1984 MB
local video memory, peak 10207 MB 9207 MB

Evictions: 561 by 160 s, 8714 by 280 s (824 mapped again). None after 280 s.

Observations:

  • The cap is soft on this title. The pools went to 83 heaps against a cap of 64, because when evict_lru frees nothing, take_tile makes another pool. So most of what was added past 4 GB was not evictable (GPU-written, pinned, under 4 tiles, or touched within 5 s). Sparse pools grow outside the budget (+1 GB here).
  • Frame rate: from 160 s, when local video memory went past the card's size, it ran mostly at 0–5 presents per second until the end. I can't tell from one run how much of that is eviction, paging and streaming, and how much is compile stalls. From 294 s to the end there were no presents at all, while large compute PSOs were still being built (up to 390 KB of DXIL), then the watchdog fired. That matches the #232 stop described above.
  • Missing textures: some textures were visibly missing during play. That fits the known limit in the description: an evicted texture the title only samples reads as zero. I didn't check which textures they were.

So on 8 GB this takes the run past the out-of-memory stop to the same watchdog stop that larger cards reach. A budget taken from the adapter's QueryVideoMemoryInfo local budget, minus what XCL uses outside the pages, might keep the total under the card's size better than a fixed number. I haven't tried that.

AI use: the logs were analysed and this comment drafted with Claude Opus 5.5; I ran the game and checked the results.

**@⁠albertoglvn** on GitHub · 2026-11-24 03:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7121543278) 8 GB data point with the budget set. Native Windows 11, RTX 4060 Laptop 8 GB (7956 MiB), driver 621.24, 15 GB RAM + 40 GB page file, release MSVC build. The newer retail title (TitleID 7952987A), Series X profile, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_PAGE_BUDGET_MB=4096`. Build: #484 head (9783066) with #495 (3ae0841), #496 (409f40f) and this PR (38bf6a3) cherry-picked on top. They applied cleanly. `cargo test --lib -p xcl -- title_textures:: vram::` passes (18 passed). **Compared with the same base without this PR** (#333 comment, one run each): | | without budget | budget 4096 MB | |---|---|---| | ended at | 277.5 s, #333 assert (`+0x193e00f`, E_OUTOFMEMORY) | 320.9 s, `+0x23cf683` write at 0 (watchdog, #232) | | "no video memory for more pages" | 9 | 0 | | target pages, peak | 6623 MB | 5306 MB | | page pools, peak | 6656 MB | 5312 MB | | sparse pools, peak | 1792 MB | 1984 MB | | local video memory, peak | 10207 MB | 9207 MB | Evictions: 561 by 160 s, 8714 by 280 s (824 mapped again). None after 280 s. Observations: - **The cap is soft on this title.** The pools went to 83 heaps against a cap of 64, because when `evict_lru` frees nothing, `take_tile` makes another pool. So most of what was added past 4 GB was not evictable (GPU-written, pinned, under 4 tiles, or touched within 5 s). Sparse pools grow outside the budget (+1 GB here). - **Frame rate:** from 160 s, when local video memory went past the card's size, it ran mostly at 0–5 presents per second until the end. I can't tell from one run how much of that is eviction, paging and streaming, and how much is compile stalls. From 294 s to the end there were no presents at all, while large compute PSOs were still being built (up to 390 KB of DXIL), then the watchdog fired. That matches the #232 stop described above. - **Missing textures:** some textures were visibly missing during play. That fits the known limit in the description: an evicted texture the title only samples reads as zero. I didn't check which textures they were. So on 8 GB this takes the run past the out-of-memory stop to the same watchdog stop that larger cards reach. A budget taken from the adapter's `QueryVideoMemoryInfo` local budget, minus what XCL uses outside the pages, might keep the total under the card's size better than a fixed number. I haven't tried that. AI use: the logs were analysed and this comment drafted with Claude Opus 5.5; I ran the game and checked the results.
Author
Owner

@⁠albertoglvn on GitHub · 2026-11-24 04:01 UTC · original

Follow-up to my run above: the same build without XCL_PAGE_BUDGET_MB (#484 + #495 + #496 + this PR, so this PR's code is in but the budget is off). Same machine, same profile.

budget 4096 MB no budget
play starts (~60 presents / 2 s) ~140 s ~122 s
frames collapse (≤ 10 presents / 2 s) ~160 s, local 7.9 GB ~140 s, local 8.3 GB
ended at 320.9 s, watchdog (+0x23cf683) 160.1 s, #333 assert (+0x193e00f, 12× "no video memory")
target pages / sparse / local at the end 5306 / 1984 / 9207 MB 6638 / 1792 / 10204 MB

So the frame collapse is not caused by the eviction. Both runs drop to almost no frames about 20 s into play, once local video memory goes past the card's 7956 MiB. With the budget, the run then keeps going for another 160 s instead of failing CreateHeap within 20 s.

At the menus, local video memory outside the target pages and sparse pools is about 1.7 GB (6139 − 3577 − 896 MB). To stay under 8 GB, pages + sparse would have to stay below roughly 6 GB, but the run above had 5.3 + 2.0 GB, and about 3.6 GB of the pages are already in use at the menus. So on the Series X profile, an 8 GB card would need the cap enforced more strictly, which means more missing textures.

(One other run of this build crashed at 13 s inside the NVIDIA driver, nvwgf2umx.dll+0x85b227, read at 0x3c, the same place as in #345, while shaders were loading and before any eviction. The rerun was fine, so I'm treating it as intermittent.)

AI use: the logs were compared and this comment drafted with Claude Opus 5.5; I ran the game.

**@⁠albertoglvn** on GitHub · 2026-11-24 04:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7121635315) Follow-up to my run above: the same build without `XCL_PAGE_BUDGET_MB` (#484 + #495 + #496 + this PR, so this PR's code is in but the budget is off). Same machine, same profile. | | budget 4096 MB | no budget | |---|---|---| | play starts (~60 presents / 2 s) | ~140 s | ~122 s | | frames collapse (≤ 10 presents / 2 s) | ~160 s, local 7.9 GB | ~140 s, local 8.3 GB | | ended at | 320.9 s, watchdog (`+0x23cf683`) | 160.1 s, #333 assert (`+0x193e00f`, 12× "no video memory") | | target pages / sparse / local at the end | 5306 / 1984 / 9207 MB | 6638 / 1792 / 10204 MB | So the frame collapse is not caused by the eviction. Both runs drop to almost no frames about 20 s into play, once local video memory goes past the card's 7956 MiB. With the budget, the run then keeps going for another 160 s instead of failing `CreateHeap` within 20 s. At the menus, local video memory outside the target pages and sparse pools is about 1.7 GB (6139 − 3577 − 896 MB). To stay under 8 GB, pages + sparse would have to stay below roughly 6 GB, but the run above had 5.3 + 2.0 GB, and about 3.6 GB of the pages are already in use at the menus. So on the Series X profile, an 8 GB card would need the cap enforced more strictly, which means more missing textures. (One other run of this build crashed at 13 s inside the NVIDIA driver, `nvwgf2umx.dll+0x85b227`, read at `0x3c`, the same place as in #345, while shaders were loading and before any eviction. The rerun was fine, so I'm treating it as intermittent.) AI use: the logs were compared and this comment drafted with Claude Opus 5.5; I ran the game.
Author
Owner

@⁠crosettiremi on GitHub · 2026-11-24 04:04 UTC · original

Paired native Windows 11 runs on an RX 7900 XT (20 GB), retail 1.0.2.1, DXC 1.9.2602.17. I applied the budget change to a local integration build that also includes #690, bounded PSO waits and sparse-buffer release changes. Both runs used the same release executable, saved profile, A at 37 s, DRED, and separate copies of the same starting application caches (1,062 prior-use shader sets). The driver cache was shared. The 6 GiB run went first. CPU compilation overlapped parts of both runs, so I am reporting memory and outcomes only.

Activity sample near 148 s 6,144 MiB budget Budget off
Texture pools 6,336 MiB 10,112 MiB
Active target pages 5,453 MiB 9,737 MiB
Local video memory 10,225 MiB 14,069 MiB
Process commit 25,149 MiB 28,877 MiB

With the budget on, the last sample reported 8,175 textures evicted and 1,045 mapped again. The budget run ended at 159.855 s with an access violation in the title. The control ended at 157.917 s with an access violation in vcruntime140 on a thread processing audio. Both passed the account picker and streamed world assets. Neither reached verified playable frames. Zero device removals in both. These runs show a smaller memory footprint, but do not establish a cause for either crash or whether evicted textures rendered correctly.

Combined workspace suite: 724 passed, 0 failed, 41 ignored. Upstream change tested: 38bf6a3. Workspace command: cargo test --workspace --locked --offline -- --test-threads=4. Codex (GPT-6) ran the checks and summarized the local logs.

**@⁠crosettiremi** on GitHub · 2026-11-24 04:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7121686629) Paired native Windows 11 runs on an RX 7900 XT (20 GB), retail 1.0.2.1, DXC 1.9.2602.17. I applied the budget change to a local integration build that also includes #690, bounded PSO waits and sparse-buffer release changes. Both runs used the same release executable, saved profile, A at 37 s, DRED, and separate copies of the same starting application caches (1,062 prior-use shader sets). The driver cache was shared. The 6 GiB run went first. CPU compilation overlapped parts of both runs, so I am reporting memory and outcomes only. | Activity sample near 148 s | 6,144 MiB budget | Budget off | | --- | ---: | ---: | | Texture pools | 6,336 MiB | 10,112 MiB | | Active target pages | 5,453 MiB | 9,737 MiB | | Local video memory | 10,225 MiB | 14,069 MiB | | Process commit | 25,149 MiB | 28,877 MiB | With the budget on, the last sample reported 8,175 textures evicted and 1,045 mapped again. The budget run ended at 159.855 s with an access violation in the title. The control ended at 157.917 s with an access violation in vcruntime140 on a thread processing audio. Both passed the account picker and streamed world assets. Neither reached verified playable frames. Zero device removals in both. These runs show a smaller memory footprint, but do not establish a cause for either crash or whether evicted textures rendered correctly. Combined workspace suite: 724 passed, 0 failed, 41 ignored. Upstream change tested: 38bf6a3. Workspace command: `cargo test --workspace --locked --offline -- --test-threads=4`. Codex (GPT-6) ran the checks and summarized the local logs.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 04:10 UTC · original

Code audit + NVIDIA RTX 5080 test run on 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac:

Three bugs found in the revive path

  1. Use-after-free in title_textures::submitted (title_textures.rs:585-591):
    • revive collects raw usize resource addresses from notes (recorded when the command list was built) and calls ID3D12Resource::from_raw_borrowed(&p) -> vram::remap_if_unmapped(r) without holding TEXTURES.lock() or cloning a COM reference.
    • If another thread calls Release / forget(res) between recording/taking res and remap_if_unmapped(r), r.GetDevice(...) dereferences a freed COM object.
    • Fix: Clone live COM references under TEXTURES.lock() via clone_resources(&revive) (matching forget()) before calling remap_if_unmapped.
  2. Current submission still samples NULL tiles (real.rs:5028-5034 + title_textures.rs:573-599):
    • title_textures::submitted(&mapped) is called after ExecuteCommandLists has already submitted the command lists to the GPU, and only marks e.pending = true for the next submit. So the submission that actually transitions and draws with the revived texture still samples unmapped NULL tiles on that frame.
    • Reviving + uploading evicted textures referenced by lists before ExecuteCommandLists (inside refresh) would avoid the blank frame.
  3. take_evicted drops the entry even when remap_if_unmapped returns false (title_textures.rs:581, 799):
    • If remap_if_unmapped fails (returns false), res was already removed from EVICTED and REMAPS was already incremented, leaving the texture permanently unmapped and never retried.
    • (Minor perf note: any_evicted() acquires the EVICTED mutex and touch(res) acquires the global PAGES mutex per barrier note when XCL_PAGE_BUDGET_MB > 0; an AtomicUsize count for any_evicted() and batching touch calls under one PAGES lock would avoid lock churn.)

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 688 passed, 0 failed, 41 ignored.
  • New tests a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged and page_budget_evicts_the_least_recently_touched_cpu_filled_texture: both passed.
  • SKIPPED GPU/D3D12 tests: gpu_geometry_wave32_prefix_count_over_a_mask / gpu_wave32_program_in_wave64_hardware (no wave64), plus 2 D3D12 debug-layer tests (no d3d12SDKLayers.dll).

Not tested

  • Retail title / scripts/smoke.ps1 run (test suite only).
  • AMD / Intel GPUs.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

**@⁠mastrr9** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7121778065) Code audit + NVIDIA RTX 5080 test run on `38bf6a324ac3d11387b81592f3dd5fd6fe38ddac`: ### Three bugs found in the revive path 1. **Use-after-free in `title_textures::submitted` (`title_textures.rs:585-591`):** - `revive` collects raw `usize` resource addresses from `notes` (recorded when the command list was built) and calls `ID3D12Resource::from_raw_borrowed(&p)` -> `vram::remap_if_unmapped(r)` **without holding `TEXTURES.lock()` or cloning a COM reference**. - If another thread calls `Release` / `forget(res)` between recording/taking `res` and `remap_if_unmapped(r)`, `r.GetDevice(...)` dereferences a freed COM object. - **Fix:** Clone live COM references under `TEXTURES.lock()` via `clone_resources(&revive)` (matching `forget()`) before calling `remap_if_unmapped`. 2. **Current submission still samples NULL tiles (`real.rs:5028-5034` + `title_textures.rs:573-599`):** - `title_textures::submitted(&mapped)` is called **after** `ExecuteCommandLists` has already submitted the command lists to the GPU, and only marks `e.pending = true` for the *next* submit. So the submission that actually transitions and draws with the revived texture still samples unmapped NULL tiles on that frame. - Reviving + uploading evicted textures referenced by `lists` *before* `ExecuteCommandLists` (inside `refresh`) would avoid the blank frame. 3. **`take_evicted` drops the entry even when `remap_if_unmapped` returns `false` (`title_textures.rs:581, 799`):** - If `remap_if_unmapped` fails (returns `false`), `res` was already removed from `EVICTED` and `REMAPS` was already incremented, leaving the texture permanently unmapped and never retried. - *(Minor perf note: `any_evicted()` acquires the `EVICTED` mutex and `touch(res)` acquires the global `PAGES` mutex per barrier note when `XCL_PAGE_BUDGET_MB > 0`; an `AtomicUsize` count for `any_evicted()` and batching `touch` calls under one `PAGES` lock would avoid lock churn.)* ### Tested - Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), `rustc 1.100.0` (MSVC), debug build. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: **688 passed, 0 failed, 41 ignored**. - New tests `a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged` and `page_budget_evicts_the_least_recently_touched_cpu_filled_texture`: **both passed**. - `SKIPPED` GPU/D3D12 tests: `gpu_geometry_wave32_prefix_count_over_a_mask` / `gpu_wave32_program_in_wave64_hardware` (`no wave64`), plus 2 D3D12 debug-layer tests (`no d3d12SDKLayers.dll`). ### Not tested - Retail title / `scripts/smoke.ps1` run (test suite only). - AMD / Intel GPUs. *AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.*
Author
Owner

@⁠albertoglvn on GitHub · 2026-11-24 04:14 UTC · original

One more data point, about what the LRU order sees on this title. Same machine (RTX 4060 Laptop 8 GB). Build: main f4ce27c + #495 + #496 + this PR, budget off, plus a local measurement patch: touch() also runs without a budget and counts transitions per target; every 10 s it logs the mapped targets by evictable, EVICT_MIN_TILES, age of touched, and touches == 0. Tiles are summed per texture, so shared pages count twice.

At 62 s, just before #333's out-of-memory stop at 63.5 s:

textures on pages MB textures
GPU-written or GPU-owned (never evicted) 3339 917
under 4 tiles (never evicted) 942 14490
CPU-filled, touched < 5 s 2069 1419
CPU-filled, 5–30 s 1546 701
CPU-filled, 30–120 s 584 188
CPU-filled with no transition since placement 4200 2308

So on this title, every CPU-filled texture on the pages (the age rows add up to the same 2308 textures) has never appeared in a submitted transition. Their touched is only the placement time, so evict_lru evicts the textures placed longest ago, whether or not they are still sampled. Nothing maps them back either, since take_evicted is only reached from a transition or a CPU write. That fits the missing textures I saw with the budget. Some signal of use other than transitions seems to be needed here, such as descriptor creation for the resource, or its being referenced by a list that was submitted.

The same counts at 32 s (menus, before streaming) show that most of the floor is GPU-written: 3367 MB of 3598 MB of target pages. With 1.1 GB of committed resources (buffers 571 MB, UAV textures 419 MB, two 3840×2160 display targets), 465 MB of arenas and 1–1.8 GB of sparse pools, that leaves about 1 GB of an 8 GB card for CPU-filled textures on the Series X profile. The driver's share of the local count, outside heaps and committed resources, was only about 136 MB.

AI use: the measurement patch and this comment were written with Claude Opus 5.5; I ran the game.

**@⁠albertoglvn** on GitHub · 2026-11-24 04:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7121841224) One more data point, about what the LRU order sees on this title. Same machine (RTX 4060 Laptop 8 GB). Build: main `f4ce27c` + #495 + #496 + this PR, budget off, plus a local measurement patch: `touch()` also runs without a budget and counts transitions per target; every 10 s it logs the mapped targets by `evictable`, `EVICT_MIN_TILES`, age of `touched`, and `touches == 0`. Tiles are summed per texture, so shared pages count twice. At 62 s, just before #333's out-of-memory stop at 63.5 s: | textures on pages | MB | textures | |---|---|---| | GPU-written or GPU-owned (never evicted) | 3339 | 917 | | under 4 tiles (never evicted) | 942 | 14490 | | CPU-filled, `touched` < 5 s | 2069 | 1419 | | CPU-filled, 5–30 s | 1546 | 701 | | CPU-filled, 30–120 s | 584 | 188 | | **CPU-filled with no transition since placement** | **4200** | **2308** | So on this title, every CPU-filled texture on the pages (the age rows add up to the same 2308 textures) has never appeared in a submitted transition. Their `touched` is only the placement time, so `evict_lru` evicts the textures placed longest ago, whether or not they are still sampled. Nothing maps them back either, since `take_evicted` is only reached from a transition or a CPU write. That fits the missing textures I saw with the budget. Some signal of use other than transitions seems to be needed here, such as descriptor creation for the resource, or its being referenced by a list that was submitted. The same counts at 32 s (menus, before streaming) show that most of the floor is GPU-written: 3367 MB of 3598 MB of target pages. With 1.1 GB of committed resources (buffers 571 MB, UAV textures 419 MB, two 3840×2160 display targets), 465 MB of arenas and 1–1.8 GB of sparse pools, that leaves about 1 GB of an 8 GB card for CPU-filled textures on the Series X profile. The driver's share of the local count, outside heaps and committed resources, was only about 136 MB. AI use: the measurement patch and this comment were written with Claude Opus 5.5; I ran the game.
Author
Owner

@⁠burber on GitHub · 2026-11-24 04:27 UTC · original

Second 12 GB NVIDIA card with the retail title: the budget keeps local video memory under the card

Setup: RTX 4070 Ti 12 GB (driver 32.0.16.1062), i5-13600K, 32 GB RAM + 32 GB page file, Windows 11 26300, DXC 1.8.2502. Release build of main 9182f27 + #533 + #267 + #708 + this PR; it merged cleanly. Title 1.0.2.1, XCL_NETWORK=0, same scripted input each run, world loading from ~80 s.

Tests: cargo test --release --workspace gives 669 passed, 0 failed. That includes page_budget_evicts_the_least_recently_touched_cpu_filled_texture and a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged.

Retail runs:

without the budget (runs 13–14) XCL_PAGE_BUDGET_MB=6144 (runs 15–16)
local video memory at the end 14.2–14.6 GB 10.3–10.4 GB
target pages 9.7 GB 5.5–5.8 GB (pools 6.1–6.3 GB)
commit 28–30 GB 25.7–26.1 GB
evictions — 7316 textures evicted, 42 mapped again
  • I saw no visible corruption in the frame dumps before the stall. These are coarse quarter-size dumps of the loading screens only; no gameplay was reached.
  • Both budget runs still end at the title's watchdog (+0x23cf683, ~128 s). It follows 10–13 compute pipelines that are still building after 4 s on the NVIDIA driver, so the budget removes the video memory overrun but not that stall.

Investigated with AI assistance; all numbers are from runs on my machine.

**@⁠burber** on GitHub · 2026-11-24 04:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7122031920) **Second 12 GB NVIDIA card with the retail title: the budget keeps local video memory under the card** **Setup:** RTX 4070 Ti 12 GB (driver 32.0.16.1062), i5-13600K, 32 GB RAM + 32 GB page file, Windows 11 26300, DXC 1.8.2502. Release build of `main` 9182f27 + #533 + #267 + #708 + this PR; it merged cleanly. Title 1.0.2.1, `XCL_NETWORK=0`, same scripted input each run, world loading from ~80 s. **Tests:** `cargo test --release --workspace` gives 669 passed, 0 failed. That includes `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` and `a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged`. **Retail runs:** | | without the budget (runs 13–14) | `XCL_PAGE_BUDGET_MB=6144` (runs 15–16) | |---|---|---| | local video memory at the end | 14.2–14.6 GB | **10.3–10.4 GB** | | target pages | 9.7 GB | 5.5–5.8 GB (pools 6.1–6.3 GB) | | commit | 28–30 GB | 25.7–26.1 GB | | evictions | — | `7316 textures evicted, 42 mapped again` | - I saw no visible corruption in the frame dumps before the stall. These are coarse quarter-size dumps of the loading screens only; no gameplay was reached. - Both budget runs still end at the title's watchdog (`+0x23cf683`, ~128 s). It follows 10–13 compute pipelines that are still building after 4 s on the NVIDIA driver, so the budget removes the video memory overrun but not that stall. Investigated with AI assistance; all numbers are from runs on my machine.
Author
Owner

@⁠albertoglvn on GitHub · 2026-11-24 04:40 UTC · original

Following up on the census above. I tried a signal of use other than transitions, and measured what a page budget could free on this title at all. Same machine (RTX 4060 Laptop, 7956 MiB). Build: main f4ce27c + #495 + #496 + this PR, plus two local patches:

  1. Use by T#. dev_create_srv_x notes which shared-heap SRV index belongs to which placed texture. Once a second, xcl reads word 0 of every image T# in the console view heaps and maps it back to the texture. A texture whose T# is in a shader-visible heap gets touched = now, and an evicted one found there is mapped again and uploaded. A scan takes 2–9 ms.
  2. Eviction order. evict_lru takes textures whose T# is in no view heap first (any size, once 2 s old). It passes over a texture whose pages are all shared with other mapped textures, since unmapping it frees nothing.

With the first patch alone and XCL_PAGE_BUDGET_MB=4096, every round logged "0 MB back" and the title stopped at 62.8 s. Every candidate sat on pages another texture still used.

With both patches and the same budget:

  • Rounds freed 20, 32, 32 and 0 MB, all before 62 s. After that every candidate was passed over: 4162 MB of them in the last round.
  • 5547 textures were evicted and 1977 mapped again. Between 36 s and 58 s, while frames were still coming, I saw no missing or flickering textures. That's unlike my earlier budget runs, so the T# looks like a usable signal.
  • The out-of-memory stop moved from 63 s to 94 s, but presents fell to 0 at 62 s, so that's no more playable time.
  • Target pages still grew to 6400 MB. The GPU-written textures (3370 MB) and the small ones (about 800 MB) are already above the budget.
  • evict_lru walks the same shared textures again on every submit: the pass-over count reached 33 million. A real version would need to remember them.

Then, with the budget off, I counted each page once (no double counting of shared pages), by the strongest of its holders. At 62 s, just before the device was removed at 63 s:

pages held by MB
a GPU-written or GPU-owned texture 3200
else a CPU-filled texture whose T# is in a shader-visible heap 1737
only CPU-filled textures with their T# in no shader-visible heap 1091 (827 of it under 2 s old)
no user 0
all pages 6028

Everything else counted local at that point came to about 3950 MB: sparse pools 1856, committed 1158, arenas 465, system heaps 337, driver 136. That leaves about 4000 MB of the card for pages. The first two rows alone are 4937 MB. So even a page-level budget that gave back every page held only by textures with no T# would leave the Series X profile about 930 MB over on an 8 GB card, before the in-use textures it would have to drop. On this title, 8 GB looks out of reach for any eviction scheme. The T# signal may still help on cards with somewhat more memory.

If it's useful, I can open the T# signal as its own small PR on top of this one.

AI use: the patches, measurements and this comment were written with Claude Opus 5.5; I ran the game.

**@⁠albertoglvn** on GitHub · 2026-11-24 04:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7122239021) Following up on the census above. I tried a signal of use other than transitions, and measured what a page budget could free on this title at all. Same machine (RTX 4060 Laptop, 7956 MiB). Build: main `f4ce27c` + #495 + #496 + this PR, plus two local patches: 1. **Use by T#.** `dev_create_srv_x` notes which shared-heap SRV index belongs to which placed texture. Once a second, xcl reads word 0 of every image T# in the console view heaps and maps it back to the texture. A texture whose T# is in a shader-visible heap gets `touched = now`, and an evicted one found there is mapped again and uploaded. A scan takes 2–9 ms. 2. **Eviction order.** `evict_lru` takes textures whose T# is in no view heap first (any size, once 2 s old). It passes over a texture whose pages are all shared with other mapped textures, since unmapping it frees nothing. With the first patch alone and `XCL_PAGE_BUDGET_MB=4096`, every round logged "0 MB back" and the title stopped at 62.8 s. Every candidate sat on pages another texture still used. With both patches and the same budget: - Rounds freed 20, 32, 32 and 0 MB, all before 62 s. After that every candidate was passed over: 4162 MB of them in the last round. - 5547 textures were evicted and 1977 mapped again. Between 36 s and 58 s, while frames were still coming, I saw no missing or flickering textures. That's unlike my earlier budget runs, so the T# looks like a usable signal. - The out-of-memory stop moved from 63 s to 94 s, but presents fell to 0 at 62 s, so that's no more playable time. - Target pages still grew to 6400 MB. The GPU-written textures (3370 MB) and the small ones (about 800 MB) are already above the budget. - `evict_lru` walks the same shared textures again on every submit: the pass-over count reached 33 million. A real version would need to remember them. Then, with the budget off, I counted each page once (no double counting of shared pages), by the strongest of its holders. At 62 s, just before the device was removed at 63 s: | pages held by | MB | |---|---| | a GPU-written or GPU-owned texture | 3200 | | else a CPU-filled texture whose T# is in a shader-visible heap | 1737 | | only CPU-filled textures with their T# in no shader-visible heap | 1091 (827 of it under 2 s old) | | no user | 0 | | **all pages** | **6028** | Everything else counted local at that point came to about 3950 MB: sparse pools 1856, committed 1158, arenas 465, system heaps 337, driver 136. That leaves about 4000 MB of the card for pages. The first two rows alone are 4937 MB. So even a page-level budget that gave back every page held only by textures with no T# would leave the Series X profile about 930 MB over on an 8 GB card, before the in-use textures it would have to drop. On this title, 8 GB looks out of reach for any eviction scheme. The T# signal may still help on cards with somewhat more memory. If it's useful, I can open the T# signal as its own small PR on top of this one. AI use: the patches, measurements and this comment were written with Claude Opus 5.5; I ran the game.
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 05:25 UTC · original

Test report on an 8 GB card, which Not tested lists.

Tested

  • NVIDIA GeForce RTX 3060 8 GB (driver 610.88, 32-lane waves) · Intel i9-14900K · 32 GB · Windows 11 (26200) · release build.
  • Tree: main f4ce27c + #214, #267, #456, #468, #503, #572 + this PR (38bf6a3), merged locally (conflicts only in #214 / #267, none with this PR).
  • cargo test --release -p xcl --lib -- --test-threads=4 on that tree, twice: 675 passed, 0 failed, 21 ignored, both times. page_budget_evicts_the_least_recently_touched_cpu_filled_texture passes. With the default thread count (32 on this CPU), 5 GPU tests failed in one run (placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory, this PR's test, and one more); all of them pass with --test-threads=1. I read that as GPU tests crowding an 8 GB card, not this PR, but I did not run the same count without this PR.
  • The newer retail title from the README, 1.0.2.1, XCL_NETWORK=0, XCL_PSO_WAIT_MS=150, XCL_ACTIVITY=1.
budget unset (same tree without this PR) XCL_PAGE_BUDGET_MB=3072
target pages, menus 3578 MB at 14 s → 4554 MB at 38 s 3488–3497 MB from 12 s to 226 s
local video memory 6204 MB at 14 s → 7297 MB at 38 s 6078 MB from 16 s to 226 s
process commit 14543 MB at 14 s → 16310 MB at 38 s 14491 MB from 22 s to 226 s
fps 30 in the menus 30.0 in every sample from 185 s to 255 s
run ended 60–80 s (my commit watcher, < 3 GB free system commit) 271 s (same watcher)
  • With the budget, after the first button press at 229 s the title starts loading and the pages grow past the budget: 4212 MB at 250 s, 4268 MB at 264 s (pools 4288 MB). page budget: 250 textures evicted, 24 mapped again by 264 s. So on this title most of what is placed after the menus is not evictable here (GPU-written or recent), and the budget slows the growth rather than capping it.
  • No crash or device removal in the run; it was ended by my watcher, not by XCL (this machine's commit limit is 43 GB, see #542).

Not tested

  • Whether evicted textures show up empty on screen: nobody looked for it in this run.
  • This PR alone on main; other budgets than 3072; scripts/smoke.ps1; AMD.

AI use

  • Claude Code with Claude Opus 5.5: merged the branches, ran the tests and the title, read the logs and wrote this report from those runs.
**@⁠woreksami** on GitHub · 2026-11-24 05:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7122926631) Test report on an **8 GB card**, which **Not tested** lists. **Tested** - NVIDIA GeForce RTX 3060 8 GB (driver 610.88, 32-lane waves) · Intel i9-14900K · 32 GB · Windows 11 (26200) · release build. - Tree: `main` f4ce27c + #214, #267, #456, #468, #503, #572 + this PR (38bf6a3), merged locally (conflicts only in #214 / #267, none with this PR). - `cargo test --release -p xcl --lib -- --test-threads=4` on that tree, twice: 675 passed, 0 failed, 21 ignored, both times. `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` passes. With the default thread count (32 on this CPU), 5 GPU tests failed in one run (`placed_title_textures_share_vram_and_preserve_pixels`, `transitions_apply_when_their_list_is_submitted`, `d32s8_targets_take_their_own_size_of_video_memory`, this PR's test, and one more); all of them pass with `--test-threads=1`. I read that as GPU tests crowding an 8 GB card, not this PR, but I did not run the same count without this PR. - The newer retail title from the README, 1.0.2.1, `XCL_NETWORK=0`, `XCL_PSO_WAIT_MS=150`, `XCL_ACTIVITY=1`. | | budget unset (same tree without this PR) | `XCL_PAGE_BUDGET_MB=3072` | |---|---|---| | target pages, menus | 3578 MB at 14 s → 4554 MB at 38 s | 3488–3497 MB from 12 s to 226 s | | local video memory | 6204 MB at 14 s → 7297 MB at 38 s | 6078 MB from 16 s to 226 s | | process commit | 14543 MB at 14 s → 16310 MB at 38 s | 14491 MB from 22 s to 226 s | | fps | 30 in the menus | 30.0 in every sample from 185 s to 255 s | | run ended | 60–80 s (my commit watcher, < 3 GB free system commit) | 271 s (same watcher) | - With the budget, after the first button press at 229 s the title starts loading and the pages grow past the budget: 4212 MB at 250 s, 4268 MB at 264 s (pools 4288 MB). `page budget: 250 textures evicted, 24 mapped again` by 264 s. So on this title most of what is placed after the menus is not evictable here (GPU-written or recent), and the budget slows the growth rather than capping it. - No crash or device removal in the run; it was ended by my watcher, not by XCL (this machine's commit limit is 43 GB, see #542). **Not tested** - Whether evicted textures show up empty on screen: nobody looked for it in this run. - This PR alone on `main`; other budgets than 3072; `scripts/smoke.ps1`; AMD. **AI use** - Claude Code with Claude Opus 5.5: merged the branches, ran the tests and the title, read the logs and wrote this report from those runs.
Author
Owner

@⁠thatirishguyyy on GitHub · 2026-11-24 07:18 UTC · original

Follow-up on the RX 9070 XT. I cherry-picked 808a8a4 onto beaa245 (7c4f641 locally), built once in release, and ran two pairs with the same profile and a 5 GiB Windows commit-headroom guard. I reversed the order for the repeat. Starting system commit headroom was within 100 MiB inside each pair.

Measurement Budget off XCL_PAGE_BUDGET_MB=4096
First BCPack refusal to process exit, original pair 20.0 s 30.6 s
First BCPack refusal to process exit, repeat pair 19.9 s 30.1 s
Last logged frame checkpoint, both pairs 900 1,200
Last sampled texture-page heap pool, both pairs 4,672 MiB 4,224 MiB
Last sampled local video memory, original pair 7,429 MiB 7,107 MiB
Last sampled local video memory, repeat pair 7,429 MiB 6,979 MiB

The budget runs logged 329 evictions each, with 3 and 2 remaps. Both settings still reached the commit guard. The first BCPack refusal is a repeatable log marker for comparing the streaming interval after manual menu navigation. At 128 refusals, all four runs reported the same breakdown: 100 BC5, 20 BC7, and 8 BC1. The focused page_budget_evicts_the_least_recently_touched_cpu_filled_texture GPU test also passed.

AI-assisted with Codex for the runs, log analysis, and report.

**@⁠thatirishguyyy** on GitHub · 2026-11-24 07:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7124850797) Follow-up on the RX 9070 XT. I cherry-picked `808a8a4` onto `beaa245` (`7c4f641` locally), built once in release, and ran two pairs with the same profile and a 5 GiB Windows commit-headroom guard. I reversed the order for the repeat. Starting system commit headroom was within 100 MiB inside each pair. | Measurement | Budget off | `XCL_PAGE_BUDGET_MB=4096` | | --- | ---: | ---: | | First BCPack refusal to process exit, original pair | 20.0 s | 30.6 s | | First BCPack refusal to process exit, repeat pair | 19.9 s | 30.1 s | | Last logged frame checkpoint, both pairs | 900 | 1,200 | | Last sampled texture-page heap pool, both pairs | 4,672 MiB | 4,224 MiB | | Last sampled local video memory, original pair | 7,429 MiB | 7,107 MiB | | Last sampled local video memory, repeat pair | 7,429 MiB | 6,979 MiB | The budget runs logged 329 evictions each, with 3 and 2 remaps. Both settings still reached the commit guard. The first BCPack refusal is a repeatable log marker for comparing the streaming interval after manual menu navigation. At 128 refusals, all four runs reported the same breakdown: 100 BC5, 20 BC7, and 8 BC1. The focused `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` GPU test also passed. AI-assisted with Codex for the runs, log analysis, and report.
Author
Owner

@⁠iggyvilla on GitHub · 2026-11-24 07:34 UTC · original

Code read of 808a8a4 (current head); nothing built or run. Two points that are still in this head:

  1. A failed remap is forgotten. title_textures.rs:810-812 (refresh_once) and :581-590 (submitted) call take_evicted(res), which removes the key from EVICTED, then ignore the bool from remap_if_unmapped and call forget_content. remap_if_unmapped returns false when bind finds no tile (vram.rs:650-672), which is the case the budget creates. The texture then stays unmapped, nothing retries it, and the upload goes into NULL tiles. Peek first and remove only after a successful remap, or put the key back on failure, and skip forget_content/upload when it failed. (Same as point 3 of @⁠ethandepstein-del's comment on 38bf6a3; it was not changed by the force-push.)
  2. evict_lru dereferences a bare address. vram.rs:469-472 does from_raw_borrowed on a key from targets, holding no reference. res_release (real.rs:1547-1565) calls the real Release first and calls vram::forget only when the count is 0, so for a short time the key names a destroyed object, and evict_lru can call unmap on it from another thread. Before this PR no vram code dereferenced a map key. Keeping a cloned ID3D12Resource in Target would close it; the same applies to the submitted revive loop.

Smaller: pin (vram.rs:709) still locks PAGES on every CopyTextureRegion/CopyResource even with the budget off (touch has the pool_cap() == 0 early return); @⁠pvfreis raised it on the earlier head. The tile reuse at the cap (vram.rs:341-343) is documented in a code comment as possibly showing newer texels for a frame; it would help to say that, and that an evicted texture can read as zero for a draw already queued, in the PR body.

AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above and drafted this; a person checked it before posting.

**@⁠iggyvilla** on GitHub · 2026-11-24 07:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7125135653) Code read of `808a8a4` (current head); nothing built or run. Two points that are still in this head: 1. **A failed remap is forgotten.** `title_textures.rs:810-812` (`refresh_once`) and `:581-590` (`submitted`) call `take_evicted(res)`, which removes the key from `EVICTED`, then ignore the `bool` from `remap_if_unmapped` and call `forget_content`. `remap_if_unmapped` returns false when `bind` finds no tile (`vram.rs:650-672`), which is the case the budget creates. The texture then stays unmapped, nothing retries it, and the upload goes into NULL tiles. Peek first and remove only after a successful remap, or put the key back on failure, and skip `forget_content`/upload when it failed. (Same as point 3 of @⁠ethandepstein-del's comment on `38bf6a3`; it was not changed by the force-push.) 2. **`evict_lru` dereferences a bare address.** `vram.rs:469-472` does `from_raw_borrowed` on a key from `targets`, holding no reference. `res_release` (`real.rs:1547-1565`) calls the real `Release` first and calls `vram::forget` only when the count is 0, so for a short time the key names a destroyed object, and `evict_lru` can call `unmap` on it from another thread. Before this PR no `vram` code dereferenced a map key. Keeping a cloned `ID3D12Resource` in `Target` would close it; the same applies to the `submitted` revive loop. Smaller: `pin` (`vram.rs:709`) still locks `PAGES` on every `CopyTextureRegion`/`CopyResource` even with the budget off (`touch` has the `pool_cap() == 0` early return); @⁠pvfreis raised it on the earlier head. The tile reuse at the cap (`vram.rs:341-343`) is documented in a code comment as possibly showing newer texels for a frame; it would help to say that, and that an evicted texture can read as zero for a draw already queued, in the PR body. AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above and drafted this; a person checked it before posting.
Author
Owner

@⁠EgoraWyn on GitHub · 2026-11-24 08:53 UTC · original

Test report from a 6 GB card, on the current head merged into current main, budget unset and set. No report above is on a card this small, or on 808a8a4 alone with the budget set.

Tested

  • Commit: 808a8a4 merged locally into main 1c87b1d (no conflicts; the merge is not published). Release builds, cargo build --release --workspace.
  • RTX 3060 Laptop 6 GB (5994 MiB, wave32), driver 596.21 (32.0.15.9621); i5-12450H; 32 GB RAM; Windows 11 Pro 26H2 26300.9974; Rust 1.100.0 MSVC; DXC 1.9.2602.17.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4: 718 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64). Both new tests pass. On this laptop page_budget_evicts_the_least_recently_touched_cpu_filled_texture ran on the Intel iGPU (tiled-resources tier 3), because it takes EnumAdapters1(0).
  • The retail title of the description, Series X profile, 3840×2160, 4095 MB coherent window, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_DXC_THREADS=4, 4 logical CPUs. The same scripted presses (XCL_PRESS_AT) through the first-run setup into the first world load in every run, saves removed before each run. A watchdog of mine ends a run at 25 GB of private bytes.

Local video memory / page pools (MB), compared at equal loading progress (DirectStorage requests made so far), because the timing of the streaming varies from run to run:

build 25 000 requests 40 000 50 000 55 000 how it ended
main 1c87b1d 7686 / 4800 8858 / 5312 11 534 / 7936 12 349 / 8640 my watchdog at 161 s (25.3 GB private, 12.8 GB local)
merge, budget unset 7750 / 4864 9429 / 5952 10 723 / 7168 11 319 / 7744 device hung 0x887a0006 at 143 s (12.5 GB local)
merge, XCL_PAGE_BUDGET_MB=4096 7303 / 4416 8348 / 4800 9613 / 6016 10 082 / 6464 device hung 0x887a0006 at 137 s (10.1 GB local)
  • Budget unset: as main. Same 6341 MB local and 3648 MB of pools at the last menu, same 7366 / 4608 MB after the first load step, 60 presents per 2 s through the menus.
  • Budget 4096: less local video memory at equal progress, 0.4 GB at 25 000 requests and 1.1 to 2.3 GB at 50 000 and 55 000, and the process commit lower by about as much (20.8 against 21.9 and 22.8 GB at 50 000 requests). The two runs without a budget differ from each other by up to 1.0 GB at the same marks, so one run each gives the direction, not a precise figure.
  • The budget is not held here either: the pools reach 4096 MB in the first load step and pass it there (4224 MB at 98 s), and when the streaming starts they go from 4416 MB at 118 s to 6464 MB 17 s later. By the end of the run 3303 textures were evicted and 16 mapped again. That agrees with the census in https://github.com/ivall/xcl/pull/640#issuecomment-7121841224: the pools are at 3648 MB before loading starts, and what is never evicted is already near the budget.
  • It does not make a 6 GB card fit: local video memory is 6.3 GB at the last menu, before any streaming, and 10 GB and growing at the end of the budget run.
  • The device hang is not from the budget: it also ended the run without one. In the budget run the first lines are CreatePlacedResourceX … (0x887a0005) and title texture: upload failed: texture copy: D3D12 device removed (0x887a0006…), as in #499. Windows logged an nvlddmkm event 153 ("Error occurred on GPUID: 100") in the same second, both times. No 0x8007000e and no "no video memory" line in any of the three runs.
  • The picture could not be judged: all three runs end on the dark loading screen.

Not tested: a second run of each build; other budget values; #782; anything past the loading screen; AMD; the debug layer (not installed).

AI use: Claude Code (Claude Fable 5.2) merged the branch locally, ran the builds, tests and runs, read XCL's logs and wrote this report; the numbers are from the runs above on this machine.

**@⁠EgoraWyn** on GitHub · 2026-11-24 08:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7126685328) Test report from a 6 GB card, on the current head merged into current `main`, budget unset and set. No report above is on a card this small, or on `808a8a4` alone with the budget set. **Tested** - Commit: `808a8a4` merged locally into `main` `1c87b1d` (no conflicts; the merge is not published). Release builds, `cargo build --release --workspace`. - RTX 3060 Laptop 6 GB (5994 MiB, wave32), driver 596.21 (32.0.15.9621); i5-12450H; 32 GB RAM; Windows 11 Pro 26H2 26300.9974; Rust 1.100.0 MSVC; DXC 1.9.2602.17. - `cargo test --release --workspace --no-fail-fast -- --test-threads=4`: **718 passed, 0 failed, 41 ignored**. `SKIPPED`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). Both new tests pass. On this laptop `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` ran on the Intel iGPU (tiled-resources tier 3), because it takes `EnumAdapters1(0)`. - The retail title of the description, Series X profile, 3840×2160, 4095 MB coherent window, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_DXC_THREADS=4`, 4 logical CPUs. The same scripted presses (`XCL_PRESS_AT`) through the first-run setup into the first world load in every run, saves removed before each run. A watchdog of mine ends a run at 25 GB of private bytes. Local video memory / page pools (MB), compared at equal loading progress (DirectStorage requests made so far), because the timing of the streaming varies from run to run: | build | 25 000 requests | 40 000 | 50 000 | 55 000 | how it ended | |---|---|---|---|---|---| | `main` 1c87b1d | 7686 / 4800 | 8858 / 5312 | 11 534 / 7936 | 12 349 / 8640 | my watchdog at 161 s (25.3 GB private, 12.8 GB local) | | merge, budget unset | 7750 / 4864 | 9429 / 5952 | 10 723 / 7168 | 11 319 / 7744 | device hung `0x887a0006` at 143 s (12.5 GB local) | | merge, `XCL_PAGE_BUDGET_MB=4096` | 7303 / 4416 | 8348 / 4800 | 9613 / 6016 | 10 082 / 6464 | device hung `0x887a0006` at 137 s (10.1 GB local) | - **Budget unset:** as `main`. Same 6341 MB local and 3648 MB of pools at the last menu, same 7366 / 4608 MB after the first load step, 60 presents per 2 s through the menus. - **Budget 4096:** less local video memory at equal progress, 0.4 GB at 25 000 requests and 1.1 to 2.3 GB at 50 000 and 55 000, and the process commit lower by about as much (20.8 against 21.9 and 22.8 GB at 50 000 requests). The two runs without a budget differ from each other by up to 1.0 GB at the same marks, so one run each gives the direction, not a precise figure. - **The budget is not held here either:** the pools reach 4096 MB in the first load step and pass it there (4224 MB at 98 s), and when the streaming starts they go from 4416 MB at 118 s to 6464 MB 17 s later. By the end of the run 3303 textures were evicted and 16 mapped again. That agrees with the census in https://github.com/ivall/xcl/pull/640#issuecomment-7121841224: the pools are at 3648 MB before loading starts, and what is never evicted is already near the budget. - **It does not make a 6 GB card fit:** local video memory is 6.3 GB at the last menu, before any streaming, and 10 GB and growing at the end of the budget run. - **The device hang is not from the budget:** it also ended the run without one. In the budget run the first lines are `CreatePlacedResourceX … (0x887a0005)` and `title texture: upload failed: texture copy: D3D12 device removed (0x887a0006…)`, as in #499. Windows logged an `nvlddmkm` event 153 ("Error occurred on GPUID: 100") in the same second, both times. No `0x8007000e` and no "no video memory" line in any of the three runs. - The picture could not be judged: all three runs end on the dark loading screen. **Not tested:** a second run of each build; other budget values; #782; anything past the loading screen; AMD; the debug layer (not installed). **AI use:** Claude Code (Claude Fable 5.2) merged the branch locally, ran the builds, tests and runs, read XCL's logs and wrote this report; the numbers are from the runs above on this machine.
Author
Owner

@⁠milas6669 on GitHub · 2026-11-24 09:20 UTC · original · edited 2026-11-24 09:54 UTC

Correction to the setup line (added later): these runs were not entirely without input. The log of each run has GameInput: gamepad buttons 0x4 pressed for the first time (an A press from the PC's keyboard or pad, pressed by hand, not scripted) at 19–166 s depending on the run, and the first call of #101 (the start of world loading) came 70–89 s after that press in 16 of the 17 runs I checked (one run with a 2048 MB coherent window: 106.6 s). So where a comment says the world-load start varies between runs, it follows when A was pressed. The stalls, crashes and the other numbers are as measured.

One run of this PR with XCL_PAGE_BUDGET_MB=5000 on an 8 GB NVIDIA card, with a crash in the texture detiling path at 208 s. Not a regression run (no xcl-smoke blocks).

Setup: RTX 3070 8 GB (32-lane waves), i9-10900KF, 31.9 GB RAM (46.9 GB commit limit, system-managed page file), Windows 11 Pro 10.0.26200, rustc 1.100.0, release. Build: main 077ce40 + #891 (XCL_PSO_WAIT_MS=50, so the title gets past the 106 s watchdog stop) + this PR's head 808a8a4, clean merges. XCL_NETWORK=0, XCL_ACTIVITY=1, retail title, 4095 MB coherent window, warm caches, no scripted input. A sampler logged the system's free commit once a second.

What the log shows

  • the log's budget line: page budget 5000 MB (79 pools of 64 MB); evictions start at 118.7 s (77 textures), 5930 by 206 s, 33 mapped again;
  • target pages: 4552 MB at 102 s, 6137 MB at 152 s, 6741 MB at 202 s. Without the budget the same title (and #891) had 9.6 GB of target pages at 112–130 s in my earlier runs, so the cap works as described;
  • but process commit was still 28.3 GB at 152 s and 30.3 GB at 206 s (18.3 GB at 102 s), and local video memory 10.9–11.7 GB on the 8 GB card; the system's free commit was 0.3–1.8 GB for the whole world-loading part of the run. So on this machine the budget lowered the texture pages by about 3 GB but not the commit that matters;
  • the title entered world loading at 136.5 s; presents then fell to 0–1 per 2 s with zero-present stretches 152–176 s, 180–186 s, 190–192 s, 196–198 s (the picture is nearly frozen while the audio goes on);
  • crash at 208.1 s: 0xc0000005 in VCRUNTIME140.dll+0x1cc66 (read at address 0x1efa8f10000), rdx = that address, rbx = 0x10000 (a 64 KiB copy). Symbolised against the matching PDB, the stack is xcl::gpu::tiling::Chain::detile_level (tiling.rs:438) called from title_textures::subresources (title_textures.rs:1218) on a worker thread of subresources_on.
  • after the fault the process did not exit: it stayed at "not responding" for 4 minutes (no process ends line) until I killed it.

What I do not know

  • whether the read at 0x1efa8f10000 is a page that this PR's eviction had unmapped: I did not check what that address is (it is not in the title's 0x70… range), and I have one run. The run without this PR (same build, no budget) ended at 242 s with the title's own +0x23cf683 exit, not this fault, but that is also one run.

Not tested: other budgets; AMD; the PR's own test suite on this head.

AI use: Claude Code, Claude Sonnet 5.5, ran the commands and wrote this comment.

**@⁠milas6669** on GitHub · 2026-11-24 09:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7127271681) · edited 2026-11-24 09:54 UTC > **Correction to the setup line (added later):** these runs were not entirely without input. The log of each run has `GameInput: gamepad buttons 0x4 pressed for the first time` (an A press from the PC's keyboard or pad, pressed by hand, not scripted) at 19–166 s depending on the run, and the first call of `#101` (the start of world loading) came 70–89 s after that press in 16 of the 17 runs I checked (one run with a 2048 MB coherent window: 106.6 s). So where a comment says the world-load start varies between runs, it follows when A was pressed. The stalls, crashes and the other numbers are as measured. One run of this PR with `XCL_PAGE_BUDGET_MB=5000` on an 8 GB NVIDIA card, with a crash in the texture detiling path at 208 s. Not a regression run (no `xcl-smoke` blocks). **Setup:** RTX 3070 8 GB (32-lane waves), i9-10900KF, 31.9 GB RAM (46.9 GB commit limit, system-managed page file), Windows 11 Pro 10.0.26200, rustc 1.100.0, release. Build: `main` 077ce40 + #891 (`XCL_PSO_WAIT_MS=50`, so the title gets past the 106 s watchdog stop) + this PR's head `808a8a4`, clean merges. `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, retail title, 4095 MB coherent window, warm caches, no scripted input. A sampler logged the system's free commit once a second. **What the log shows** - the log's budget line: `page budget 5000 MB (79 pools of 64 MB)`; evictions start at 118.7 s (77 textures), 5930 by 206 s, 33 mapped again; - target pages: 4552 MB at 102 s, 6137 MB at 152 s, **6741 MB at 202 s**. Without the budget the same title (and #891) had 9.6 GB of target pages at 112–130 s in my earlier runs, so the cap works as described; - but process commit was still **28.3 GB at 152 s and 30.3 GB at 206 s** (18.3 GB at 102 s), and local video memory 10.9–11.7 GB on the 8 GB card; the system's **free commit was 0.3–1.8 GB** for the whole world-loading part of the run. So on this machine the budget lowered the texture pages by about 3 GB but not the commit that matters; - the title entered world loading at 136.5 s; presents then fell to 0–1 per 2 s with zero-present stretches 152–176 s, 180–186 s, 190–192 s, 196–198 s (the picture is nearly frozen while the audio goes on); - **crash at 208.1 s:** `0xc0000005 in VCRUNTIME140.dll+0x1cc66 (read at address 0x1efa8f10000)`, rdx = that address, rbx = 0x10000 (a 64 KiB copy). Symbolised against the matching PDB, the stack is `xcl::gpu::tiling::Chain::detile_level (tiling.rs:438)` called from `title_textures::subresources (title_textures.rs:1218)` on a worker thread of `subresources_on`. - after the fault the process did not exit: it stayed at "not responding" for 4 minutes (no `process ends` line) until I killed it. **What I do not know** - whether the read at `0x1efa8f10000` is a page that this PR's eviction had unmapped: I did not check what that address is (it is not in the title's `0x70…` range), and I have one run. The run without this PR (same build, no budget) ended at 242 s with the title's own `+0x23cf683` exit, not this fault, but that is also one run. **Not tested:** other budgets; AMD; the PR's own test suite on this head. **AI use:** Claude Code, Claude Sonnet 5.5, ran the commands and wrote this comment.
Author
Owner

@⁠throny on GitHub · 2026-11-24 11:24 UTC · original

Two world-loading runs of 808a8a4 on a 16 GB NVIDIA card with the budget set and XCL_PSO_WAIT_MS=50 (on main since #891), against two runs of main without the budget. The budget holds video memory down as intended; it does not stop the GPU waits from timing out.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 16 GB (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 stable-x86_64-pc-windows-msvc; release. 808a8a4 merged onto main 47efa2e (clean merge); the runs without the budget are main 384f7f7.
  • xcl run <folder> with XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_PSO_WAIT_MS=50, XCL_PRESS_AT for the profile prompt, 420 s limit, warm DXIL and driver-blob caches. With the budget: XCL_PAGE_BUDGET_MB=6144.
budget 6144, run 1 budget 6144, run 2 no budget, run 1 no budget, run 2
video memory, local (peak) 12.8 GB 12.6 GB 15.7 GB 15.6 GB
target pages (peak) 7.1 GB 7.3 GB 9.8 GB 9.8 GB
peak commit 31.5 GB 29.3 GB 33.9 GB 32.7 GB
last present 206 s 112 s 132 s 114 s
presents after 82 s 55 13 24 20
end watchdog at 235.0 s watchdog at 144.0 s my memory guard at ~134 s watchdog at 170.0 s
GPU queue.Wait … did not complete within 5000 ms 175, from 121.1 s 0 78, from 122.3 s 29, from 112.4 s
  • The budget line appears at start (page budget 6144 MB (96 pools of 64 MB)); run 1 ends with 9592 textures evicted, 210 mapped again. No device removal in any run, and the process exited normally after the watchdog in run 2 (run 1 did not exit and was killed by my runner's timeout, as I have seen on main builds too).
  • Video memory stays about 3 GB lower with the budget, and commit 1.5–3 GB lower.
  • The GPU waits still time out with video memory at 12.8 GB of 16 GB (run 1), so on this card a full video memory is not what makes them time out. Run 2 ended in the watchdog without a single timed-out wait, 32 s after its last present.
  • Run 1 with the budget is the longest world load I have had on this machine (presents until 206 s); with two runs each I cannot say the budget is the reason.

Not tested

  • Other budgets; the points iggyvilla raised about a failed remap (no failed remap line in these logs); the test suite on this head; AMD.

AI use

  • Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the title and wrote this report. Counts and XCL's own log text only.
**@⁠throny** on GitHub · 2026-11-24 11:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7130055598) Two world-loading runs of `808a8a4` on a 16 GB NVIDIA card with the budget set and `XCL_PSO_WAIT_MS=50` (on `main` since #891), against two runs of `main` without the budget. The budget holds video memory down as intended; it does not stop the GPU waits from timing out. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 16 GB (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`; release. `808a8a4` merged onto `main` `47efa2e` (clean merge); the runs without the budget are `main` `384f7f7`. - `xcl run <folder>` with `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_PSO_WAIT_MS=50`, `XCL_PRESS_AT` for the profile prompt, 420 s limit, warm DXIL and driver-blob caches. With the budget: `XCL_PAGE_BUDGET_MB=6144`. | | budget 6144, run 1 | budget 6144, run 2 | no budget, run 1 | no budget, run 2 | |---|---|---|---|---| | video memory, local (peak) | 12.8 GB | 12.6 GB | 15.7 GB | 15.6 GB | | `target pages` (peak) | 7.1 GB | 7.3 GB | 9.8 GB | 9.8 GB | | peak commit | 31.5 GB | 29.3 GB | 33.9 GB | 32.7 GB | | last present | 206 s | 112 s | 132 s | 114 s | | presents after 82 s | 55 | 13 | 24 | 20 | | end | watchdog at 235.0 s | watchdog at 144.0 s | my memory guard at ~134 s | watchdog at 170.0 s | | `GPU queue.Wait … did not complete within 5000 ms` | 175, from 121.1 s | 0 | 78, from 122.3 s | 29, from 112.4 s | - The budget line appears at start (`page budget 6144 MB (96 pools of 64 MB)`); run 1 ends with `9592 textures evicted, 210 mapped again`. No device removal in any run, and the process exited normally after the watchdog in run 2 (run 1 did not exit and was killed by my runner's timeout, as I have seen on `main` builds too). - Video memory stays about 3 GB lower with the budget, and commit 1.5–3 GB lower. - The GPU waits still time out with video memory at 12.8 GB of 16 GB (run 1), so on this card a full video memory is not what makes them time out. Run 2 ended in the watchdog without a single timed-out wait, 32 s after its last present. - Run 1 with the budget is the longest world load I have had on this machine (presents until 206 s); with two runs each I cannot say the budget is the reason. **Not tested** - Other budgets; the points iggyvilla raised about a failed remap (no failed remap line in these logs); the test suite on this head; AMD. **AI use** - Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the title and wrote this report. Counts and XCL's own log text only.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-24 11:16 UTC · original · edited 2026-11-24 11:35 UTC

RTX 5060 Laptop GPU (8 GiB), NVIDIA 615.78.08, Bazzite 44 and Proton Experimental. I tested XCL main 384f7f7 with this PR, #793 and #820 locally, plus vkd3d-proton 3.1 with #257’s compatibility patch and #775’s dxil-spirv pin. Series X, XCL_PAGE_BUDGET_MB=3072, XCL_COHERENT_MB=512 and XCL_PSO_WAIT_MS=50.

The final image briefly showed unlit foliage, road signs and streetlights. The budget path logged 1,098 evictions and 17 remaps. Pools nevertheless reached 6,080 MB, with 6,750 MB local and 4,030 MB non-local video memory in the last sample. The run then exited with a vkAllocateMemory access violation. This is consistent with the cap being best-effort. I had no single-variable comparison on this stack, so I can’t attribute that loading milestone or the subsequent crash to this PR alone.

AI use: OpenAI Codex (GPT-6.2-Sol high) assisted with the build, measurements and report.

Visual follow-up: a later run rendered the full loading artwork. The earlier silhouette frames did not establish entry into the playable world.

**@⁠Filip722** on GitHub · 2026-11-24 11:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7129886803) · edited 2026-11-24 11:35 UTC RTX 5060 Laptop GPU (8 GiB), NVIDIA 615.78.08, Bazzite 44 and Proton Experimental. I tested XCL main `384f7f7` with this PR, #793 and #820 locally, plus vkd3d-proton 3.1 with #257’s compatibility patch and #775’s dxil-spirv pin. Series X, `XCL_PAGE_BUDGET_MB=3072`, `XCL_COHERENT_MB=512` and `XCL_PSO_WAIT_MS=50`. The final image briefly showed unlit foliage, road signs and streetlights. The budget path logged 1,098 evictions and 17 remaps. Pools nevertheless reached 6,080 MB, with 6,750 MB local and 4,030 MB non-local video memory in the last sample. The run then exited with a `vkAllocateMemory` access violation. This is consistent with the cap being best-effort. I had no single-variable comparison on this stack, so I can’t attribute that loading milestone or the subsequent crash to this PR alone. AI use: OpenAI Codex (GPT-6.2-Sol high) assisted with the build, measurements and report. Visual follow-up: a later run rendered the full loading artwork. The earlier silhouette frames did not establish entry into the playable world.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-24 13:49 UTC · original

Thanks. Read at 5d6fac8 (nothing built or run here); the five points of my review are fixed:

  1. At the cap, take_tile evicts only when cooling is empty and takes the tiles a round gave back first (vram.rs:332-355); page_budget_one_placement_at_the_cap_evicts_one_batch (:1312) drives it with a cap set per Pages.
  2. Uploads refresh the LRU time (title_textures.rs:850).
  3. A copy into an evicted texture maps it again before the copy (note_gpu_write, title_textures.rs:461-481), the revive loop leaves GPU-written textures alone (:629), and a placement starts not evictable (vram.rs:667) until register accepts it (title_textures.rs:397).
  4. The cap test above covers the path at the cap.
  5. pin returns at once with the budget off (set_evictable_to, vram.rs:780-783).

Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.

**@⁠pvfreis** on GitHub · 2026-11-24 13:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7133392995) Thanks. Read at `5d6fac8` (nothing built or run here); the five points of my review are fixed: 1. At the cap, `take_tile` evicts only when `cooling` is empty and takes the tiles a round gave back first (`vram.rs:332-355`); `page_budget_one_placement_at_the_cap_evicts_one_batch` (`:1312`) drives it with a cap set per `Pages`. 2. Uploads refresh the LRU time (`title_textures.rs:850`). 3. A copy into an evicted texture maps it again before the copy (`note_gpu_write`, `title_textures.rs:461-481`), the revive loop leaves GPU-written textures alone (`:629`), and a placement starts not evictable (`vram.rs:667`) until `register` accepts it (`title_textures.rs:397`). 4. The cap test above covers the path at the cap. 5. `pin` returns at once with the budget off (`set_evictable_to`, `vram.rs:780-783`). Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
Author
Owner

@⁠Aruku448 on GitHub · 2026-11-24 13:56 UTC · original

Same title (TitleID 7952987A), AMD side, and one more data point: on a 16 GB card the
process's local video memory reaches 20,415 MB, and the run then ends with
0x887a0006 (device hung), not +0x23cf683.

Setup: RX 7800 XT (16,176 MiB), Ryzen 7 5700X3D, 32 GB RAM, Windows 11, xcl 47efa2e
(MSVC release, DXC 1.9.2607), XCL_NETWORK=0, title 1.0.2.1.

Runs

  1. No input, 180 s, XCL_PSO_WAIT_MS=50: exit 0x0, 4219 presents, stays on the title
    screen (flat dark frame), never reaches the world.

  2. With XCL_PRESS_A_AT=25,40,55,70,85,100 + XCL_PSO_WAIT_MS=50 on 47efa2e (BCPack
    merged): dies at 80 s in the detile path, not in read_committed:
    0xc0000005 (memcpy, read at 0xc3de10000) xcl::gpu::tiling::Chain::detile_level+0x56d <- xcl::hle::d3d12x::title_textures::subresources+0x302 <- title_textures::subresources_on::closure (worker thread)

  3. Same presses, plus #640 (XCL_PAGE_BUDGET_MB=8192), XCL_ACTIVITY=1: the budget
    works (page budget: 3195 textures evicted, 25 mapped again), but local video memory
    keeps growing and the device is removed at 144 s:
    memory: 36985 MB committed by the process; video memory 20415 MB local, 4805 MB non-local; target pages 7941 MB (pools 8192 MB); arenas 312 MB in use; sparse pools 2240 MB (2240 MB mapped) -> 0x887a0006 (GPU does not respond to more commands) – the title is stopped

Earlier in the same run: coherent 3998/4095 MB, sparse 7445 MB.

What I read from this

  • The page budget only caps target pages (7.9 GB of the 20.4 GB). The rest is the
    ~4 GB coherent/UMA window, the sparse windows (7.4 GB) and the title's own D3D12
    resources, which no knob seems to bound.
  • The two crashes look like one root cause: pages that are not resident / a backend that
    is already gone. detile_level copies from title memory without the tolerance that
    #484 gave read_committed (binary-split ReadProcessMemory, zeros for unreadable
    pages), so it faults instead of zero-filling.

Questions

  • Is there a supported way to shrink the UMA/coherent window and the sparse pools
    (XCL_UMA_MB, XCL_COHERENT_MB exist in config.rs/uma.rs — are those meant to be
    lowered, or do they break the title's expectations)?
  • Would a read_committed-style tolerant copy in title_textures::subresources_on be
    the right fix for the detile fault, or is #992 (CopyFromSubresource checks the source
    range first) the direction you want?

BCPack is confirmed not the cause on my side too: bcpack_refused: {} and
bcpack_unpacked BC1 1284 / BC5 108 / BC7 138 / BC6H 1, 0 failed.

**@⁠Aruku448** on GitHub · 2026-11-24 13:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7133572399) Same title (TitleID 7952987A), AMD side, and one more data point: on a 16 GB card the process's **local video memory reaches 20,415 MB**, and the run then ends with `0x887a0006` (device hung), not `+0x23cf683`. **Setup**: RX 7800 XT (16,176 MiB), Ryzen 7 5700X3D, 32 GB RAM, Windows 11, xcl `47efa2e` (MSVC release, DXC 1.9.2607), `XCL_NETWORK=0`, title 1.0.2.1. **Runs** 1. No input, 180 s, `XCL_PSO_WAIT_MS=50`: `exit 0x0`, 4219 presents, stays on the title screen (flat dark frame), never reaches the world. 2. With `XCL_PRESS_A_AT=25,40,55,70,85,100` + `XCL_PSO_WAIT_MS=50` on `47efa2e` (BCPack merged): dies at 80 s in the **detile** path, not in `read_committed`: 0xc0000005 (memcpy, read at 0xc3de10000) xcl::gpu::tiling::Chain::detile_level+0x56d <- xcl::hle::d3d12x::title_textures::subresources+0x302 <- title_textures::subresources_on::closure (worker thread) 3. Same presses, plus **#640** (`XCL_PAGE_BUDGET_MB=8192`), `XCL_ACTIVITY=1`: the budget works (`page budget: 3195 textures evicted, 25 mapped again`), but local video memory keeps growing and the device is removed at **144 s**: memory: 36985 MB committed by the process; video memory 20415 MB local, 4805 MB non-local; target pages 7941 MB (pools 8192 MB); arenas 312 MB in use; sparse pools 2240 MB (2240 MB mapped) -> 0x887a0006 (GPU does not respond to more commands) – the title is stopped Earlier in the same run: `coherent 3998/4095 MB`, `sparse 7445 MB`. **What I read from this** - The page budget only caps target pages (7.9 GB of the 20.4 GB). The rest is the ~4 GB coherent/UMA window, the sparse windows (7.4 GB) and the title's own D3D12 resources, which no knob seems to bound. - The two crashes look like one root cause: pages that are not resident / a backend that is already gone. `detile_level` copies from title memory without the tolerance that #484 gave `read_committed` (binary-split `ReadProcessMemory`, zeros for unreadable pages), so it faults instead of zero-filling. **Questions** - Is there a supported way to shrink the UMA/coherent window and the sparse pools (`XCL_UMA_MB`, `XCL_COHERENT_MB` exist in `config.rs`/`uma.rs` — are those meant to be lowered, or do they break the title's expectations)? - Would a `read_committed`-style tolerant copy in `title_textures::subresources_on` be the right fix for the detile fault, or is #992 (`CopyFromSubresource` checks the source range first) the direction you want? BCPack is confirmed not the cause on my side too: `bcpack_refused: {}` and `bcpack_unpacked` BC1 1284 / BC5 108 / BC7 138 / BC6H 1, 0 failed.
Author
Owner

@⁠requiemsnkrp on GitHub · 2026-11-24 14:08 UTC · original

Test report: a 12 GB card where the device was removed at every world load without the budget; with XCL_PAGE_BUDGET_MB=6144 it is not.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 621.24, 32-lane waves), Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro 26200, Rust 1.100.0 MSVC, release.
  • Tree: main 930e8b4 + this PR (5d6fac8) + #1248 (7877001) and other open PRs (#605, #495, #433, #789, #968, #759, #820, #684), merged locally, plus a local change of mine that is not in any PR: a new pool heap goes to system memory once the process is within 512 MB of its local budget. The conflict with that change in take_tile was resolved by keeping this PR's eviction first, then the heap. So these runs show what the budget does on this card, not this branch alone.
  • cargo test --release -p xcl --lib d3d12x::vram d3d12x::title_textures d3d12x::sparse on that tree: 43 passed, 0 failed, 1 ignored.
  • Retail title 1.0.2.1, Series X profile, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50, menus by hand into the world load. One run with the budget. For comparison, earlier runs on this machine without this PR.
without this PR (6 runs) with this PR, budget 6144 MB
local video memory at the end 13.7–14.1 GB (budget 11.26 GB) 10.18 GB
target pages 9.7 GB (in a seventh run, with my system-memory change: 6.5 GB of it sampled textures) 6.33 GB (3.07 GB sampled)
end device removed (0x887a0005 / 0x887a0007) at 98–131 s; Aftermath: DeviceRemovedNoGpuFault no device removal; the #505 watchdog at 119.7 s
eviction – 4,419 textures evicted, 6 mapped again
  • The run with the budget then stops on the compute-pipeline backlog of #505 (513 binds went on without their pipeline, 130 compute builds after the first ListX #101, up to 19 s each). That stop is not this PR's.
  • The "sampled" share is a local counter of mine (pages made by place_pages vs place), not in this PR. The seventh run (system-memory change, no budget) kept local at 10.95 GB by putting 2.8 GB of pools in system memory, ran past the non-local budget (7.7 of 7.49 GB) and was removed at 157.9 s.

Not tested

  • This PR alone, or without my system-memory change (in the run above no pool went to system memory, local stayed under the budget, so that change did nothing there).
  • Whether evicted textures show up empty or wrong on screen: the world was not drawn yet when the title stopped.
  • More than one run with the budget.

AI use: Claude Code (Claude Opus 5.5) merged and built the tree, ran the tests, read the logs and wrote this report. The title runs were made by hand on my PC.

**@⁠requiemsnkrp** on GitHub · 2026-11-24 14:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7133914941) **Test report: a 12 GB card where the device was removed at every world load without the budget; with `XCL_PAGE_BUDGET_MB=6144` it is not.** **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 621.24, 32-lane waves), Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro 26200, Rust 1.100.0 MSVC, release. - Tree: `main` `930e8b4` + this PR (`5d6fac8`) + #1248 (`7877001`) and other open PRs (#605, #495, #433, #789, #968, #759, #820, #684), merged locally, plus a local change of mine that is not in any PR: a new pool heap goes to system memory once the process is within 512 MB of its local budget. The conflict with that change in `take_tile` was resolved by keeping this PR's eviction first, then the heap. So these runs show what the budget does on this card, not this branch alone. - `cargo test --release -p xcl --lib d3d12x::vram d3d12x::title_textures d3d12x::sparse` on that tree: 43 passed, 0 failed, 1 ignored. - Retail title 1.0.2.1, Series X profile, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50`, menus by hand into the world load. One run with the budget. For comparison, earlier runs on this machine without this PR. | | without this PR (6 runs) | with this PR, budget 6144 MB | |---|---|---| | local video memory at the end | 13.7–14.1 GB (budget 11.26 GB) | **10.18 GB** | | target pages | 9.7 GB (in a seventh run, with my system-memory change: 6.5 GB of it sampled textures) | **6.33 GB** (3.07 GB sampled) | | end | device removed (`0x887a0005` / `0x887a0007`) at 98–131 s; Aftermath: `DeviceRemovedNoGpuFault` | **no device removal**; the #505 watchdog at 119.7 s | | eviction | – | 4,419 textures evicted, 6 mapped again | - The run with the budget then stops on the compute-pipeline backlog of #505 (513 binds went on without their pipeline, 130 compute builds after the first `ListX #101`, up to 19 s each). That stop is not this PR's. - The "sampled" share is a local counter of mine (pages made by `place_pages` vs `place`), not in this PR. The seventh run (system-memory change, no budget) kept local at 10.95 GB by putting 2.8 GB of pools in system memory, ran past the non-local budget (7.7 of 7.49 GB) and was removed at 157.9 s. **Not tested** - This PR alone, or without my system-memory change (in the run above no pool went to system memory, local stayed under the budget, so that change did nothing there). - Whether evicted textures show up empty or wrong on screen: the world was not drawn yet when the title stopped. - More than one run with the budget. **AI use:** Claude Code (Claude Opus 5.5) merged and built the tree, ran the tests, read the logs and wrote this report. The title runs were made by hand on my PC.
Author
Owner

@⁠Aruku448 on GitHub · 2026-11-24 14:58 UTC · original

The budget works, but it does not bound the whole picture. On a 16,176 MiB RX 7800 XT, main 47efa2e + this PR, XCL_PAGE_BUDGET_MB=8192, retail 1.0.2.1, XCL_ACTIVITY=1:

page budget: 3195 textures evicted, 25 mapped again
memory: 36985 MB committed by the process; video memory 20415 MB local, 4805 MB non-local;
        target pages 7941 MB (pools 8192 MB); arenas 312 MB in use;
        sparse pools 2240 MB (2240 MB mapped)
-> 144 s, 0x887a0006 (device removed)

So the budget holds target pages at 7.9 GB while local video memory still reaches 20,415 MB on a 16,176 MiB card. Earlier lines in the same run: coherent 3998/4095 MB, sparse 7445 MB — the ~4 GB coherent/UMA window and the sparse windows are outside the budget, and so are the title's own resources.

For contrast, on current main (930e8b4) the same run peaks at 14,221 MB without any budget: the copy-scratch work (#993 / 392dc0c) already took most of the growth away, and the device is then removed with 0x887a0006 for a different reason (see #505: the draw stream runs for one 2 s interval, then the GPU stops responding).

So the observation that might be worth keeping: a page budget alone is not a VRAM bound. If the intent is to let a 12 GB card run this title, the UMA window and the sparse pools need their own caps (XCL_UMA_MB / XCL_COHERENT_MB exist in config.rs/uma.rs — are those meant to be lowered by users, or do they break the title's expectations?).

**@⁠Aruku448** on GitHub · 2026-11-24 14:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7135241254) The budget works, but it does not bound the whole picture. On a 16,176 MiB RX 7800 XT, main `47efa2e` + this PR, `XCL_PAGE_BUDGET_MB=8192`, retail 1.0.2.1, `XCL_ACTIVITY=1`: ``` page budget: 3195 textures evicted, 25 mapped again memory: 36985 MB committed by the process; video memory 20415 MB local, 4805 MB non-local; target pages 7941 MB (pools 8192 MB); arenas 312 MB in use; sparse pools 2240 MB (2240 MB mapped) -> 144 s, 0x887a0006 (device removed) ``` So the budget holds target pages at 7.9 GB while local video memory still reaches **20,415 MB on a 16,176 MiB card**. Earlier lines in the same run: `coherent 3998/4095 MB`, `sparse 7445 MB` — the ~4 GB coherent/UMA window and the sparse windows are outside the budget, and so are the title's own resources. For contrast, on current main (`930e8b4`) the same run peaks at **14,221 MB without any budget**: the copy-scratch work (#993 / 392dc0c) already took most of the growth away, and the device is then removed with `0x887a0006` for a different reason (see #505: the draw stream runs for one 2 s interval, then the GPU stops responding). So the observation that might be worth keeping: a page budget alone is not a VRAM bound. If the intent is to let a 12 GB card run this title, the UMA window and the sparse pools need their own caps (`XCL_UMA_MB` / `XCL_COHERENT_MB` exist in `config.rs`/`uma.rs` — are those meant to be lowered by users, or do they break the title's expectations?).
Author
Owner

@⁠crosettiremi on GitHub · 2026-11-24 15:32 UTC · original

RX 7900 XT, Windows, Series X profile. I compared main 930e8b4 plus #789/#968 with the same build plus #1248 (7877001) and #640 (5d6fac8). Both runs started with matching application caches, shared the driver cache, ran with DRED enabled and had a 28 GiB whole-job commit cap. Both selected Player1 at 33 s and displayed loading artwork.

At 96.5 s the comparison build reported 28,129 MB of process commit, 8,351 MB in target pages and 8,704 MB in pools. At 96.2 s the combined build reported 23,038 / 5,766 / 5,776 MB respectively. Its log confirmed the 4,096 MB page budget was active and recorded 5,819 evictions and 10 remaps by 110.2 s. Both processes eventually exited with Windows status 0xc0000409. Neither game log reported device removal.

This is one run per configuration. The memory measurements cover both PRs together. Gameplay and the cause of the exit are still under investigation.

**@⁠crosettiremi** on GitHub · 2026-11-24 15:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7136200211) RX 7900 XT, Windows, Series X profile. I compared main 930e8b4 plus #789/#968 with the same build plus #1248 (7877001) and #640 (5d6fac8). Both runs started with matching application caches, shared the driver cache, ran with DRED enabled and had a 28 GiB whole-job commit cap. Both selected Player1 at 33 s and displayed loading artwork. At 96.5 s the comparison build reported 28,129 MB of process commit, 8,351 MB in target pages and 8,704 MB in pools. At 96.2 s the combined build reported 23,038 / 5,766 / 5,776 MB respectively. Its log confirmed the 4,096 MB page budget was active and recorded 5,819 evictions and 10 remaps by 110.2 s. Both processes eventually exited with Windows status 0xc0000409. Neither game log reported device removal. This is one run per configuration. The memory measurements cover both PRs together. Gameplay and the cause of the exit are still under investigation.
Author
Owner

@⁠ofc0urse on GitHub · 2026-11-24 14:04 UTC · original · edited 2026-11-24 15:58 UTC

Test report on 5d6fac8 (cherry-picked): RTX 4060 Ti 8 GB, retail title. The budget holds through the menus and the start of the world load, and this card shows world geometry for the first time. Between 150 and 180 s the pools pass the cap anyway, and the device is lost about 40 s later.

Tested

  • NVIDIA GeForce RTX 4060 Ti 8 GB (driver 32.0.16.2124, 32-lane waves), Intel Core i5-14400F (no SSE4a / CLZERO), 32 GB RAM, Windows 11 Pro 26300, rustc 1.100.0, release.
  • Build: main 47efa2e + this PR (clean cherry-pick) + #1252 + #1099 + #1124 + #751 + #1123 + #1195, plus two local patches that are not for upstream (compute programs of 768 KB of DXIL or more get the fallback CS instead of a 60-97 s driver compile; the title's watchdog thread is parked). Not a regression run.
  • Retail 1.0.2.1, Series X profile, XCL_PAGE_BUDGET_MB=3072, XCL_PSO_WAIT_MS=50, XCL_NETWORK=0, XCL_ACTIVITY=1, the A press scripted with XCL_PRESS_A_AT. Two runs; the second had a warm shader cache.

What the budget did (run 1, from the memory: and page budget: lines):

time process commit local video memory target pages (pools)
60 s 16.7 GB 6.1 GB 3.5 GB (3.5 GB)
120 s 16.7 GB 6.1 GB 3.5 GB (3.5 GB)
150 s 18.2 GB 7.0 GB 4.2 GB (4.3 GB)
180 s 25.7 GB 11.0 GB 7.2 GB (7.2 GB)
229 s 33.2 GB 12.2 GB 7.2 GB (7.2 GB)
  • Evictions: 23 at 16 s, 74 by 126 s, 4,009 by 200 s, 4,147 at the end; 19 textures mapped again.
  • For comparison, a run of the same build without this PR (on a cold shader cache) had 13.8 GB of local video memory and 29.5 GB of commit at 128 s.
  • With the budget, the first story scene drew world geometry on this card: flat-shaded, unlit foliage, street lights and a sign gantry, up to 17 fps in the warm run. Earlier runs today without the budget lost the device before any geometry showed.

Where it ends: between 150 and 180 s the pools go from 48 to 113 heaps of 64 MB while eviction keeps running, local video memory reaches 11 GB, and the device is lost with DXGI_ERROR_DEVICE_HUNG at 229 s (run 1) and 218 s (run 2), after a stretch of cross-queue cycle breaks (#505). Reading the PR, only CPU-filled textures can be evicted, so I take the growth past the cap to be GPU-written textures, which the budget cannot touch. That is my reading of the numbers, not something I traced to single textures.

Edit: what grows in that window, from the same log: the count in a texture at ... lies in a GPU view of the title's CPU memory: kept in step with ... went 256 (11 s), 512 (119 s), 8,192 (137 s), 16,384 (153 s), 32,768 (163 s), 65,536 (214 s). The jump from 136 to 163 s lines up with the pools passing the cap and local video memory going from 7 to 11 GB, so these GPU-view textures look like the part the budget does not cover. I have not checked whether each of them takes its own pages.

Edit 2: rerun with a per-holder breakdown. It corrects my reading above: the growth past the cap is not GPU-written textures.

I added a local log line (not for upstream) that splits the pool tiles by what holds them, every 2 s. Build: main 930e8b4 + this PR + the same PRs and local patches as above, with b8b1f49 reverted locally (on this card the first run with it had one DXC compile take ~64 GB of commit in the menus). Same settings, one run, warm shader cache.

time pools GPU-owned (render targets, depth, UAVs) CPU-filled, evictable CPU-filled, younger than 5 s GPU-written local video memory
72 s 3.5 GB 3,375 MB (920) 413 MB (91) 57 MB 0 6.2 GB
102 s 7.3 GB 3,380 MB (925) 849 MB (560) 8,041 MB 5 MB (2) 10.9 GB
132 s 7.5 GB 3,303 MB (921) 5,592 MB (4,141) 0 120 MB (41) 11.5 GB
167 s 7.5 GB 3,304 MB (922) 5,866 MB (4,434) 0 120 MB (39) 12.3 GB

The MB columns count a page once for every mapped texture on it, so they add up to more than the pools. Texture counts are in brackets.

  • GPU-owned targets alone hold 3.3 GB from 22 s on. That is more than a 3072 MB budget, so on this card the budget is used up before the first CPU-filled texture arrives.
  • The pools pass the cap at about 80 s and jump from 4.4 to 7.3 GB between 92 and 102 s, when CPU-filled textures younger than EVICT_MIN_AGE arrive at once. They cannot be evicted yet, so new heaps are made. The heaps stay: the pools hold at 7.5 GB to the end.
  • After that, eviction frees almost nothing. At 107 s: page budget: 2307 textures evicted (5 MB back) this round; 41,748 textures evicted by the end. Most evicted textures share their pages with another mapped texture, so the pages stay mapped.
  • GPU-written textures peak at 120 MB. My guess above was wrong.
  • Outside the pools, sparse pools grow from 1.0 to 2.6 GB in the same run, which fits @⁠Aruku448's point that the page budget alone does not bound video memory.

Device lost (DXGI_ERROR_DEVICE_HUNG) at 168 s, about 65 s after the pools jumped, as in the two runs above.

Not checked in this rerun: which mapped textures the evicted ones share pages with (aliases at the same address, or a GPU-owned target over the same memory).

Edit 3: trying to give the pools back, and why it barely works on this title.

Two local changes on top of the build in Edit 2, not for upstream as they are: past the budget, once a second, empty one pool heap whose pages only old CPU-filled textures hold (evicted as evict_lru would) and release it; and give GPU-owned textures and ones under EVICT_MIN_TILES tiles of heaps of their own, so they do not pin a heap of evictable ones. cargo test -p xcl --lib: 718 passed, 0 failed (two new GPU tests for these).

run pools at the peak → at the end heaps released local video memory at the end device lost
Edit 2 build 7.3 → 7.3 GB 0 11.7 GB 147 s
+ releasing emptied heaps 7.36 → 7.04 GB 5 11.6 GB 135 s
+ separate heaps for textures that stay 7.30 → 6.98 GB 8 (4 of them before the world load) 11.9 GB 188 s

The device is still lost 65 to 75 s after local video memory passes 8 GB in all three; the later end of the last run is a later world load, not a longer life.

At the end of the last run, counting each page once: 2.2 GB of pages are held only by evictable textures, 3.1 GB by GPU-owned targets, 1.2 GB by textures too small to evict, 0.1 GB by GPU-written ones, and 1.8 GB of pages are shared by two or more textures. Pages are keyed by the title's address, so a texture placed over another one's memory shares its tiles whatever kind of heap they came from. That puts a texture that is never evicted on nearly every heap, and no further heap empties.

So on this title an 8 GB card has about 7 GB taken before any CPU-filled texture: 3.1 GB of GPU-owned targets, 1.2 GB of small textures and sparse pools that grow to 2.7 GB in the same run, outside the page budget (as @⁠Aruku448 found on 16 GB). I don't think a page budget alone can keep it under 8 GB here, so I am not proposing these two changes as a PR. If someone wants them for a 10–12 GB card, the branch is local and I can push it.

Not tested

  • Other budget values, the budget without #1252, AMD GPUs.

AI use

  • Claude Code (Claude Opus 5.5) built the tree, ran the title, read the logs and wrote this report. I watched the runs and took the screenshots.
**@⁠ofc0urse** on GitHub · 2026-11-24 14:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7133785882) · edited 2026-11-24 15:58 UTC **Test report on `5d6fac8` (cherry-picked): RTX 4060 Ti 8 GB, retail title. The budget holds through the menus and the start of the world load, and this card shows world geometry for the first time. Between 150 and 180 s the pools pass the cap anyway, and the device is lost about 40 s later.** **Tested** - NVIDIA GeForce RTX 4060 Ti 8 GB (driver 32.0.16.2124, 32-lane waves), Intel Core i5-14400F (no SSE4a / CLZERO), 32 GB RAM, Windows 11 Pro 26300, rustc 1.100.0, release. - Build: `main` `47efa2e` + this PR (clean cherry-pick) + #1252 + #1099 + #1124 + #751 + #1123 + #1195, plus two local patches that are not for upstream (compute programs of 768 KB of DXIL or more get the fallback CS instead of a 60-97 s driver compile; the title's watchdog thread is parked). Not a regression run. - Retail 1.0.2.1, Series X profile, `XCL_PAGE_BUDGET_MB=3072`, `XCL_PSO_WAIT_MS=50`, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, the A press scripted with `XCL_PRESS_A_AT`. Two runs; the second had a warm shader cache. **What the budget did** (run 1, from the `memory:` and `page budget:` lines): | time | process commit | local video memory | target pages (pools) | |---|---|---|---| | 60 s | 16.7 GB | 6.1 GB | 3.5 GB (3.5 GB) | | 120 s | 16.7 GB | 6.1 GB | 3.5 GB (3.5 GB) | | 150 s | 18.2 GB | 7.0 GB | 4.2 GB (4.3 GB) | | 180 s | 25.7 GB | 11.0 GB | 7.2 GB (7.2 GB) | | 229 s | 33.2 GB | 12.2 GB | 7.2 GB (7.2 GB) | - Evictions: 23 at 16 s, 74 by 126 s, 4,009 by 200 s, 4,147 at the end; 19 textures mapped again. - For comparison, a run of the same build without this PR (on a cold shader cache) had 13.8 GB of local video memory and 29.5 GB of commit at 128 s. - With the budget, the first story scene drew world geometry on this card: flat-shaded, unlit foliage, street lights and a sign gantry, up to 17 fps in the warm run. Earlier runs today without the budget lost the device before any geometry showed. **Where it ends:** between 150 and 180 s the pools go from 48 to 113 heaps of 64 MB while eviction keeps running, local video memory reaches 11 GB, and the device is lost with DXGI_ERROR_DEVICE_HUNG at 229 s (run 1) and 218 s (run 2), after a stretch of cross-queue cycle breaks (#505). Reading the PR, only CPU-filled textures can be evicted, so I take the growth past the cap to be GPU-written textures, which the budget cannot touch. That is my reading of the numbers, not something I traced to single textures. **Edit:** what grows in that window, from the same log: the count in `a texture at ... lies in a GPU view of the title's CPU memory: kept in step with ...` went 256 (11 s), 512 (119 s), 8,192 (137 s), 16,384 (153 s), 32,768 (163 s), 65,536 (214 s). The jump from 136 to 163 s lines up with the pools passing the cap and local video memory going from 7 to 11 GB, so these GPU-view textures look like the part the budget does not cover. I have not checked whether each of them takes its own pages. **Edit 2: rerun with a per-holder breakdown. It corrects my reading above: the growth past the cap is not GPU-written textures.** I added a local log line (not for upstream) that splits the pool tiles by what holds them, every 2 s. Build: `main` `930e8b4` + this PR + the same PRs and local patches as above, with `b8b1f49` reverted locally (on this card the first run with it had one DXC compile take ~64 GB of commit in the menus). Same settings, one run, warm shader cache. | time | pools | GPU-owned (render targets, depth, UAVs) | CPU-filled, evictable | CPU-filled, younger than 5 s | GPU-written | local video memory | |---|---|---|---|---|---|---| | 72 s | 3.5 GB | 3,375 MB (920) | 413 MB (91) | 57 MB | 0 | 6.2 GB | | 102 s | 7.3 GB | 3,380 MB (925) | 849 MB (560) | 8,041 MB | 5 MB (2) | 10.9 GB | | 132 s | 7.5 GB | 3,303 MB (921) | 5,592 MB (4,141) | 0 | 120 MB (41) | 11.5 GB | | 167 s | 7.5 GB | 3,304 MB (922) | 5,866 MB (4,434) | 0 | 120 MB (39) | 12.3 GB | The MB columns count a page once for every mapped texture on it, so they add up to more than the pools. Texture counts are in brackets. - GPU-owned targets alone hold 3.3 GB from 22 s on. That is more than a 3072 MB budget, so on this card the budget is used up before the first CPU-filled texture arrives. - The pools pass the cap at about 80 s and jump from 4.4 to 7.3 GB between 92 and 102 s, when CPU-filled textures younger than `EVICT_MIN_AGE` arrive at once. They cannot be evicted yet, so new heaps are made. The heaps stay: the pools hold at 7.5 GB to the end. - After that, eviction frees almost nothing. At 107 s: `page budget: 2307 textures evicted (5 MB back) this round`; 41,748 textures evicted by the end. Most evicted textures share their pages with another mapped texture, so the pages stay mapped. - GPU-written textures peak at 120 MB. My guess above was wrong. - Outside the pools, sparse pools grow from 1.0 to 2.6 GB in the same run, which fits @⁠Aruku448's point that the page budget alone does not bound video memory. Device lost (`DXGI_ERROR_DEVICE_HUNG`) at 168 s, about 65 s after the pools jumped, as in the two runs above. Not checked in this rerun: which mapped textures the evicted ones share pages with (aliases at the same address, or a GPU-owned target over the same memory). **Edit 3: trying to give the pools back, and why it barely works on this title.** Two local changes on top of the build in Edit 2, not for upstream as they are: past the budget, once a second, empty one pool heap whose pages only old CPU-filled textures hold (evicted as `evict_lru` would) and release it; and give GPU-owned textures and ones under `EVICT_MIN_TILES` tiles of heaps of their own, so they do not pin a heap of evictable ones. `cargo test -p xcl --lib`: 718 passed, 0 failed (two new GPU tests for these). | run | pools at the peak → at the end | heaps released | local video memory at the end | device lost | |---|---|---|---|---| | Edit 2 build | 7.3 → 7.3 GB | 0 | 11.7 GB | 147 s | | + releasing emptied heaps | 7.36 → 7.04 GB | 5 | 11.6 GB | 135 s | | + separate heaps for textures that stay | 7.30 → 6.98 GB | 8 (4 of them before the world load) | 11.9 GB | 188 s | The device is still lost 65 to 75 s after local video memory passes 8 GB in all three; the later end of the last run is a later world load, not a longer life. At the end of the last run, counting each page once: 2.2 GB of pages are held only by evictable textures, 3.1 GB by GPU-owned targets, 1.2 GB by textures too small to evict, 0.1 GB by GPU-written ones, and 1.8 GB of pages are shared by two or more textures. Pages are keyed by the title's address, so a texture placed over another one's memory shares its tiles whatever kind of heap they came from. That puts a texture that is never evicted on nearly every heap, and no further heap empties. So on this title an 8 GB card has about 7 GB taken before any CPU-filled texture: 3.1 GB of GPU-owned targets, 1.2 GB of small textures and sparse pools that grow to 2.7 GB in the same run, outside the page budget (as @⁠Aruku448 found on 16 GB). I don't think a page budget alone can keep it under 8 GB here, so I am not proposing these two changes as a PR. If someone wants them for a 10–12 GB card, the branch is local and I can push it. **Not tested** - Other budget values, the budget without #1252, AMD GPUs. **AI use** - Claude Code (Claude Opus 5.5) built the tree, ran the title, read the logs and wrote this report. I watched the runs and took the screenshots.
Author
Owner

@⁠AgneyaK on GitHub · 2026-11-24 16:37 UTC · original

Machine: Windows 11 26300, NVIDIA RTX 3050 6 GB Laptop (driver 32.0.16.2124, 32-lane waves), i7-13700H,
16 GB RAM, rustc 1.98.1 MSVC, release. Title 1.0.2.1, Series X profile (device_type = "anaconda").
All runs: XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=20; first-run setup and legal screens done once
by hand, then saved, so the later runs go from Player1 (one A) straight into the story load.

Test report: on a 6 GB card, main runs out of video memory in the story load every time; with this
PR and XCL_PAGE_BUDGET_MB=3072 it doesn't, and the title reaches the +0x23cf683 stop instead.

Tested

  • Machine as above. main 930e8b4, and main 930e8b4 + this PR (5d6fac8) merged locally (clean
    merge), this PR alone: no other open PRs, no local changes.
  • cargo test --release -p xcl --lib on the merge, RTX 3050: d3d12x::vram 11 passed, 0 failed (both
    page_budget_* tests included), d3d12x::title_textures 14 passed, 0 failed.
  • Retail title, four runs:
run build end time peak local video memory target pages (pools) at the end
1 main device removed (0x887a0007) during CreatePlacedResourceX, then title assert 0x80000003 at +0x2474606 449 s (first-run setup walked by hand first) not logged (no XCL_ACTIVITY) –
2 main title assert 0x80000003 at +0x193e00f with rax=0x8007000e (#333) 192 s 11.76 GB 7.59 GB (7.74 GB)
3 this PR, budget 3072 no device removal, no E_OUTOFMEMORY; 0xc0000005 write at 0x0 at +0x23cf683 (#846) 305.8 s 10.56 GB 6.11 GB (6.14 GB)
4 this PR, budget 3072 (repeat) same: +0x23cf683 290.6 s 10.94 GB 6.50 GB (6.53 GB)
  • Run 2 on main: the target pages went from 4.86 GB to 7.22 GB between 166 s and 188 s, as the world
    load started. Committed memory reached 23.8 GB (16 GB RAM + page file).
  • Runs 3 and 4: 4,357 and 3,415 textures evicted, 32 and 55 mapped again.
  • The +0x23cf683 stop at 290–306 s is the one 12–16 GB cards report in #846, so on this card the budget
    turns a memory failure into the same stop everyone else has.

Observation: the pools ended at about twice the budget. With 3072 MB (48 pools) the pools reached
96 pools (6144 MB) in run 3 and 102 (6528 MB) in run 4. There is one D3D12 device (PAGES has one
entry), so this is the "pools grow past the budget meanwhile" path in take_tile. During the world load
almost every texture is uploaded or transitioned within EVICT_MIN_AGE (5 s), so rounds find nothing to
evict and new pools are made. That is as the description says, and I'm not calling it a bug. On a small
card, though, the number a user sets is not the number they get. A line when the pools first pass the
budget (or the pool count in the page budget: line) would make that visible.

Not tested

  • Whether evicted textures show up empty or wrong on screen: the world was never drawn before the stop.
  • Other budget values, and XCL_PSO_WAIT_MS.
  • AMD GPUs.

AI use: Claude Code (Claude Opus 5.5) merged and built the tree, ran the tests and the title, read the
logs and wrote this report.

**@⁠AgneyaK** on GitHub · 2026-11-24 16:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7137960989) Machine: Windows 11 26300, NVIDIA RTX 3050 6 GB Laptop (driver 32.0.16.2124, 32-lane waves), i7-13700H, 16 GB RAM, rustc 1.98.1 MSVC, release. Title 1.0.2.1, Series X profile (`device_type = "anaconda"`). All runs: `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=20`; first-run setup and legal screens done once by hand, then saved, so the later runs go from Player1 (one A) straight into the story load. **Test report: on a 6 GB card, `main` runs out of video memory in the story load every time; with this PR and `XCL_PAGE_BUDGET_MB=3072` it doesn't, and the title reaches the `+0x23cf683` stop instead.** **Tested** - Machine as above. `main` `930e8b4`, and `main` `930e8b4` + this PR (`5d6fac8`) merged locally (clean merge), **this PR alone**: no other open PRs, no local changes. - `cargo test --release -p xcl --lib` on the merge, RTX 3050: `d3d12x::vram` 11 passed, 0 failed (both `page_budget_*` tests included), `d3d12x::title_textures` 14 passed, 0 failed. - Retail title, four runs: | run | build | end | time | peak local video memory | target pages (pools) at the end | |---|---|---|---|---|---| | 1 | `main` | device removed (`0x887a0007`) during `CreatePlacedResourceX`, then title assert `0x80000003` at `+0x2474606` | 449 s (first-run setup walked by hand first) | not logged (no `XCL_ACTIVITY`) | – | | 2 | `main` | title assert `0x80000003` at `+0x193e00f` with `rax=0x8007000e` (#333) | 192 s | **11.76 GB** | 7.59 GB (7.74 GB) | | 3 | this PR, budget 3072 | **no device removal, no E_OUTOFMEMORY**; `0xc0000005` write at 0x0 at `+0x23cf683` (#846) | 305.8 s | **10.56 GB** | 6.11 GB (6.14 GB) | | 4 | this PR, budget 3072 (repeat) | same: `+0x23cf683` | 290.6 s | **10.94 GB** | 6.50 GB (6.53 GB) | - Run 2 on `main`: the target pages went from 4.86 GB to 7.22 GB between 166 s and 188 s, as the world load started. Committed memory reached 23.8 GB (16 GB RAM + page file). - Runs 3 and 4: 4,357 and 3,415 textures evicted, 32 and 55 mapped again. - The `+0x23cf683` stop at 290–306 s is the one 12–16 GB cards report in #846, so on this card the budget turns a memory failure into the same stop everyone else has. **Observation: the pools ended at about twice the budget.** With 3072 MB (48 pools) the pools reached 96 pools (6144 MB) in run 3 and 102 (6528 MB) in run 4. There is one D3D12 device (`PAGES` has one entry), so this is the "pools grow past the budget meanwhile" path in `take_tile`. During the world load almost every texture is uploaded or transitioned within `EVICT_MIN_AGE` (5 s), so rounds find nothing to evict and new pools are made. That is as the description says, and I'm not calling it a bug. On a small card, though, the number a user sets is not the number they get. A line when the pools first pass the budget (or the pool count in the `page budget:` line) would make that visible. **Not tested** - Whether evicted textures show up empty or wrong on screen: the world was never drawn before the stop. - Other budget values, and `XCL_PSO_WAIT_MS`. - AMD GPUs. AI use: Claude Code (Claude Opus 5.5) merged and built the tree, ran the tests and the title, read the logs and wrote this report.
Author
Owner

@⁠dnzarc on GitHub · 2026-11-24 16:42 UTC · original

6 GB card (RTX 4050 Laptop): this PR takes the title from a CreateHeap failure to the prologue — the first world frames on this machine

Setup

  • Lenovo LOQ 15IAX9: i5-12450HX, 24 GB RAM, RTX 4050 Laptop 6 GB (5,920 MiB reported), driver 32.0.16.2124, Windows 11 Pro 26300, pagefile 24/64 GB.
  • This PR's head 5d6fac8 exactly (git fetch origin pull/640/head), release cargo build --release -p xcl, DXC 1.9.2602.17, system XGameRuntime, Series X profile, 1280x720 window.
  • Both runs: XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=25, 300 s limit.

Before (main 930e8b4, same settings)

D3D12.X: CreateHeap(0x4000000 bytes, type 1, alignment 0x0, flags 0x0) refused (0x8007000e)
D3D12.X: no video memory for more pages of title textures (0x8007000E)
-> 132 pools = 8,448 MB of target pages, 2,700 presents, then 0x80000003 at +0x193e00f rax=0x8007000e

With this PR, XCL_PAGE_BUDGET_MB=3072

  • No CreateHeap failure, no device removal, no guest exception in the full 300 s.
  • page budget: 8,461 textures evicted, 63 mapped again
  • memory: 23,408 MB committed by the process; video memory 9,776 MB local, 4,894 MB non-local; target pages 5,868 MB (pools 5,888 MB)
  • What the screen showed: the world geometry (highway, street lights, trees - untextured, which is expected at a 3 GB budget) at 29.8 fps, then the prologue card "VICE CITY, TWO YEARS AGO" with subtitles and audio at 1.0 fps while 5 pipelines compiled.
  • It ended at the 300 s limit while compiling: 137 pipelines built, 57,359 queued, the longest single PSO 52,369 ms (DXIL cache 620 files). That is the next wall, not video memory.

One observation, not a complaint - the pools grew past the budget here: 5,888 MB with a 3,072 MB budget (crosettiremi's 4,096 MB run stayed at 5,776 MB on a 7900 XT). On this machine almost every texture is touched within EVICT_MIN_AGE, so the "grow past the budget meanwhile" path seems to dominate. It still moved the wall from a CreateHeap failure to the prologue, so for a 6 GB card the opt-in does what it says; I am not claiming the budget is a hard cap.

AI use: OpenCode, DeepSeek V4.1 Flash 1017 - ran both builds and both runs and copied the numbers from the logs.

**@⁠dnzarc** on GitHub · 2026-11-24 16:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7138088390) **6 GB card (RTX 4050 Laptop): this PR takes the title from a `CreateHeap` failure to the prologue — the first world frames on this machine** **Setup** - Lenovo LOQ 15IAX9: i5-12450HX, 24 GB RAM, RTX 4050 Laptop 6 GB (5,920 MiB reported), driver 32.0.16.2124, Windows 11 Pro 26300, pagefile 24/64 GB. - This PR's head `5d6fac8` exactly (`git fetch origin pull/640/head`), release `cargo build --release -p xcl`, DXC 1.9.2602.17, system XGameRuntime, Series X profile, 1280x720 window. - Both runs: `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=25`, 300 s limit. **Before (main `930e8b4`, same settings)** ``` D3D12.X: CreateHeap(0x4000000 bytes, type 1, alignment 0x0, flags 0x0) refused (0x8007000e) D3D12.X: no video memory for more pages of title textures (0x8007000E) -> 132 pools = 8,448 MB of target pages, 2,700 presents, then 0x80000003 at +0x193e00f rax=0x8007000e ``` **With this PR, `XCL_PAGE_BUDGET_MB=3072`** - No `CreateHeap` failure, no device removal, no guest exception in the full 300 s. - `page budget: 8,461 textures evicted, 63 mapped again` - `memory: 23,408 MB committed by the process; video memory 9,776 MB local, 4,894 MB non-local; target pages 5,868 MB (pools 5,888 MB)` - What the screen showed: the world geometry (highway, street lights, trees - untextured, which is expected at a 3 GB budget) at **29.8 fps**, then the prologue card "VICE CITY, TWO YEARS AGO" with subtitles and audio at 1.0 fps while 5 pipelines compiled. - It ended at the 300 s limit while compiling: 137 pipelines built, 57,359 queued, the longest single PSO 52,369 ms (DXIL cache 620 files). That is the next wall, not video memory. **One observation, not a complaint** - the pools grew past the budget here: 5,888 MB with a 3,072 MB budget (crosettiremi's 4,096 MB run stayed at 5,776 MB on a 7900 XT). On this machine almost every texture is touched within `EVICT_MIN_AGE`, so the "grow past the budget meanwhile" path seems to dominate. It still moved the wall from a `CreateHeap` failure to the prologue, so for a 6 GB card the opt-in does what it says; I am not claiming the budget is a hard cap. **AI use**: OpenCode, DeepSeek V4.1 Flash 1017 - ran both builds and both runs and copied the numbers from the logs.
Author
Owner

@⁠requiemsnkrp on GitHub · 2026-11-24 17:22 UTC · original

Follow-up: on this title the budget leaves visible holes. Sampled-only textures are evicted and never mapped again. This answers the "Not tested" item about evicted textures in a visible place.

Same machine and tree as my report above (RTX 3060 12 GB; main 930e8b4 + this PR 5d6fac8 + #1248, #680, #1316 and others merged locally), two runs back to back, everything else the same (XCL_HEAP_WINDOWS=1 XCL_PSO_WAIT_MS=50):

XCL_PAGE_BUDGET_MB=6144 XCL_PAGE_BUDGET_MB=0
story loading screens (the character artwork) the artwork is missing; only the backdrop silhouettes are drawn complete
budget reached / evictions at 83 s, during those screens; 4,896 textures evicted, 12 mapped again by the end –
end +0x23cf683 at 146.9 s closed by hand at 104.8 s; local 10.7 GB (my system-memory spill), non-local 7.33 GB of a 7.49 GB budget

The reading (inference, from the code): revive_listed and refresh_once map a texture again only when a list transitions it, the CPU writes it, or a copy lands in it. A texture the title only samples, like this artwork, gets none of those while it is on screen, so its touched time stays old. LRU then takes it first and it is never brought back. The title keeps sampling it, from unmapped tiles, as zeros.

That seems to need a use signal for sampled textures before the budget can be on by default. @⁠albertoglvn's "use by T#" experiment above (SRV index → placed texture, reading the T# words in the heap) looks like the right one. A cheaper partial guard might be to skip textures whose SRVs are in the shader-visible heap at all; I have not tried it.

AI use: Claude Code (Claude Opus 5.5) read the logs and the PR's code and wrote this. The runs and what was on screen are mine.

**@⁠requiemsnkrp** on GitHub · 2026-11-24 17:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7139105574) **Follow-up: on this title the budget leaves visible holes. Sampled-only textures are evicted and never mapped again.** This answers the "Not tested" item about evicted textures in a visible place. Same machine and tree as my report above (RTX 3060 12 GB; `main` `930e8b4` + this PR `5d6fac8` + #1248, #680, #1316 and others merged locally), two runs back to back, everything else the same (`XCL_HEAP_WINDOWS=1 XCL_PSO_WAIT_MS=50`): | | `XCL_PAGE_BUDGET_MB=6144` | `XCL_PAGE_BUDGET_MB=0` | |---|---|---| | story loading screens (the character artwork) | **the artwork is missing**; only the backdrop silhouettes are drawn | **complete** | | budget reached / evictions | at 83 s, during those screens; 4,896 textures evicted, **12 mapped again** by the end | – | | end | `+0x23cf683` at 146.9 s | closed by hand at 104.8 s; local 10.7 GB (my system-memory spill), non-local 7.33 GB of a 7.49 GB budget | The reading (inference, from the code): `revive_listed` and `refresh_once` map a texture again only when a list transitions it, the CPU writes it, or a copy lands in it. A texture the title only samples, like this artwork, gets none of those while it is on screen, so its `touched` time stays old. LRU then takes it first and it is never brought back. The title keeps sampling it, from unmapped tiles, as zeros. That seems to need a use signal for sampled textures before the budget can be on by default. @⁠albertoglvn's "use by T#" experiment above (SRV index → placed texture, reading the T# words in the heap) looks like the right one. A cheaper partial guard might be to skip textures whose SRVs are in the shader-visible heap at all; I have not tried it. AI use: Claude Code (Claude Opus 5.5) read the logs and the PR's code and wrote this. The runs and what was on screen are mine.
Author
Owner

@⁠yeistark on GitHub · 2026-11-24 17:30 UTC · original

Test report for #640 on a 12 GB NVIDIA card with 16 GB RAM: the +0x193e00f / E_OUTOFMEMORY stop of #333 is gone with XCL_PAGE_BUDGET_MB=6144.

Tree: cf90938 (local, no uncommitted changes) = main b7aa9f3 + revert of b8b1f49 (#1307) + #1316 (ee904f1, with #1315) + #1288 (9cdae10) + this PR (5d6fac8). All merged cleanly.

Hardware / software

  • NVIDIA RTX A2000 12 GB (11354 MiB VRAM, wave32 only), driver 621.14 (32.0.16.2114)
  • AMD Ryzen 7 5700, 16 GB RAM, page files 32 GB (D:) + 4 GB (C:), commit limit 51.8 GB
  • Windows 11 build 26200, rustc 1.100.0 MSVC, release, DXC 1.9.2609.5
  • Retail title 1.0.2.1, Series X profile, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_DXC_THREADS=6

Tests: cargo test --workspace -- --test-threads=4 on cf90938: 799 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, tests_compact::gpu_compact_native_wave64_form.

Without this PR (635eaa3, same tree minus #640, budget unset), from the process's memory: lines:

  • 90 s: local video memory 13421 MB, non-local 4895 MB, process commit 27154 MB
  • 91.7 s: CreateHeap(0x4000000 bytes, type 1) refused with 0x8007000e (8 times), then CreatePlacedResourceX refused
  • 93.5 s: 0x80000003 at game_scarlett_master.exe+0x193e00f, rax = rcx = rsi = 0x8007000e (#333)

Local + non-local ≈ 18.3 GB, which fits the "card + half the RAM" ceiling measured in #333 (11.3 + ~8 GB here).

With this PR, XCL_PAGE_BUDGET_MB=6144:

run peak local VRAM peak process commit CreateHeap refusals #101 at ended
1 10905 MB 29.5 GB 0 87.7 s stopped by me at 1120 s, alive
2 (+ XCL_PSO_WAIT_MS=2000) 11097 MB 30.6 GB 0 103.2 s stopped by me at 284 s, alive

Page budget at the end of run 1: 4941 textures evicted, 16 mapped again. No device removal and no crash in either run.

Not tested / caveats

  • One run without the PR; the run with it started with warmer driver blobs (written by the first one), so the timing is not a clean A/B. The memory difference at the same point (13.4 vs 10.9 GB local) is the result I'd rely on.
  • Only the budget 6144 MB; no other values tried. No look at what the evicted textures cost visually: the title presented no frames after ~90 s in either run (see #505).
  • Not tested on AMD, on other NVIDIA cards, or with more RAM.

AI use: Claude Code (Claude Opus 5.5) built the tree, ran the tests and the title on this machine, and drafted this report; I checked it before posting.

**@⁠yeistark** on GitHub · 2026-11-24 17:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7139286360) **Test report for #640 on a 12 GB NVIDIA card with 16 GB RAM: the `+0x193e00f` / `E_OUTOFMEMORY` stop of #333 is gone with `XCL_PAGE_BUDGET_MB=6144`.** **Tree:** `cf90938` (local, no uncommitted changes) = `main` `b7aa9f3` + revert of `b8b1f49` (#1307) + #1316 (`ee904f1`, with #1315) + #1288 (`9cdae10`) + this PR (`5d6fac8`). All merged cleanly. **Hardware / software** - NVIDIA RTX A2000 12 GB (11354 MiB VRAM, wave32 only), driver 621.14 (32.0.16.2114) - AMD Ryzen 7 5700, **16 GB RAM**, page files 32 GB (D:) + 4 GB (C:), commit limit 51.8 GB - Windows 11 build 26200, rustc 1.100.0 MSVC, release, DXC 1.9.2609.5 - Retail title 1.0.2.1, Series X profile, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_DXC_THREADS=6` **Tests:** `cargo test --workspace -- --test-threads=4` on `cf90938`: 799 passed, 0 failed, 41 ignored. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `tests_compact::gpu_compact_native_wave64_form`. **Without this PR** (`635eaa3`, same tree minus #640, budget unset), from the process's `memory:` lines: - 90 s: local video memory 13421 MB, non-local 4895 MB, process commit 27154 MB - 91.7 s: `CreateHeap(0x4000000 bytes, type 1)` refused with `0x8007000e` (8 times), then `CreatePlacedResourceX` refused - 93.5 s: `0x80000003` at `game_scarlett_master.exe+0x193e00f`, `rax = rcx = rsi = 0x8007000e` (#333) Local + non-local ≈ 18.3 GB, which fits the "card + half the RAM" ceiling measured in #333 (11.3 + ~8 GB here). **With this PR, `XCL_PAGE_BUDGET_MB=6144`:** | run | peak local VRAM | peak process commit | `CreateHeap` refusals | `#101` at | ended | |---|---|---|---|---|---| | 1 | 10905 MB | 29.5 GB | 0 | 87.7 s | stopped by me at 1120 s, alive | | 2 (+ `XCL_PSO_WAIT_MS=2000`) | 11097 MB | 30.6 GB | 0 | 103.2 s | stopped by me at 284 s, alive | Page budget at the end of run 1: `4941 textures evicted, 16 mapped again`. No device removal and no crash in either run. **Not tested / caveats** - One run without the PR; the run with it started with warmer driver blobs (written by the first one), so the timing is not a clean A/B. The memory difference at the same point (13.4 vs 10.9 GB local) is the result I'd rely on. - Only the budget 6144 MB; no other values tried. No look at what the evicted textures cost visually: the title presented no frames after ~90 s in either run (see #505). - Not tested on AMD, on other NVIDIA cards, or with more RAM. **AI use:** Claude Code (Claude Opus 5.5) built the tree, ran the tests and the title on this machine, and drafted this report; I checked it before posting.
Author
Owner

@⁠NAbobo101 on GitHub · 2026-11-24 15:56 UTC · original · edited 2026-11-24 19:18 UTC

Update: the current head 5d6fac8, same machine and the same settings as below (XCL_PSO_WAIT_MS=50, XCL_PAGE_BUDGET_MB=3072, the same scripted presses), on the PR's own base 47efa2e. That base is before b8b1f49: on today's main the #1307 commit growth ends every run within a minute.

run end local video memory target pages (pools) evicted / mapped again
1 watchdog +0x23cf683, 724.9 s (frames presented up to about 490 s) 10.7 GB 5.8 GB (5.8) 8908 / 258
2 watchdog +0x23cf683, 333.7 s 11.7 GB 7.3 GB (7.3) 4038 / 32
3 device removed (0x887a0006) at 304.7 s, then the title's 0x80000003 at +0x2474606, as in the first round 12.0 GB 7.1 GB (7.1) 5095 / 43
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 5d6fac8 (debug): 744 passed, 0 failed, 41 ignored; SKIPPED (no wave64): the two usual ones.
  • No frozen window this time. Run 1 lasted longer than any run of main or of the earlier head on this card. The device removal still happened once in three, with the same signature as with 808a8a4.
  • The pools stayed within a few MB of the target pages, while with 808a8a4 they were up to 0.7 GB above.

The first round, on 808a8a4, follows unchanged.


Test of the then-current head 808a8a4 merged onto main 67a3735 (clean merge, local tree 2b51eef) on an 8 GB card, with XCL_PSO_WAIT_MS=50 (#891) and XCL_PAGE_BUDGET_MB=3072, compared with main and the same wait budget.

Setup

  • RTX 5060 8 GB (wave32 only), driver 621.14; Ryzen 7 5700G, 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.8.2502.11.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 2b51eef (debug): 737 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Retail title 1.0.2.1, release, XCL_NETWORK=0 XCL_ACTIVITY=1, menus walked with XCL_PRESS_A_AT=14,17,21,125,131,…,197 (as in #505); driver-blob cache warm.

Runs

build budget end local video memory target pages (pools) evicted / mapped again
main off watchdog +0x23cf683, 369.7 s 14.1 GB 9.4 GB (9.7) –
main off watchdog +0x23cf683, 346.9 s 14.5 GB 9.8 GB (9.9) –
main off watchdog +0x23cf683, 395.9 s 12.8 GB 8.9 GB (9.0) –
this PR 3072 device removed (0x887a0006), 294.2 s, then the title's 0x80000003 at +0x2474606 11.4 GB 6.0 GB (6.7) 7055 / 81
this PR 3072 the log stops at 314.6 s with no crash line; the window stayed black and frozen until I killed it – – 7205 / 76
this PR 3072 watchdog, the other site (+0x2215c35), 373.9 s 9.2 GB 5.2 GB (5.2) 3686 / 53

The budget does lower the pages by 3.5–4.5 GB and local video memory by 3–5 GB. On this card, that brought it to 9.2 GB in the run that got furthest, still over 8 GB.

With #891's waits, none of the six runs gets past the point where the loading screen goes black: main ends at the watchdog, and so does the third budget run, at about the same time. The other two budget runs ended earlier, one with a device removal and one frozen. I saw neither on main in these runs, but three runs each can't tell this PR apart from chance.

Not tested

  • Other budgets; AMD.
  • Whether evicted textures were drawn empty: the screen was black by then.

AI use

  • Claude Code (Claude Opus 5.5) scripted and ran the runs and the test suite, read the logs and drafted this comment. I checked the results.
**@⁠NAbobo101** on GitHub · 2026-11-24 15:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7136877502) · edited 2026-11-24 19:18 UTC **Update: the current head `5d6fac8`**, same machine and the same settings as below (`XCL_PSO_WAIT_MS=50`, `XCL_PAGE_BUDGET_MB=3072`, the same scripted presses), on the PR's own base `47efa2e`. That base is before `b8b1f49`: on today's `main` the #1307 commit growth ends every run within a minute. | run | end | local video memory | target pages (pools) | evicted / mapped again | |---|---|---|---|---| | 1 | watchdog `+0x23cf683`, **724.9 s** (frames presented up to about 490 s) | 10.7 GB | 5.8 GB (5.8) | 8908 / 258 | | 2 | watchdog `+0x23cf683`, 333.7 s | 11.7 GB | 7.3 GB (7.3) | 4038 / 32 | | 3 | device removed (`0x887a0006`) at 304.7 s, then the title's `0x80000003` at `+0x2474606`, as in the first round | 12.0 GB | 7.1 GB (7.1) | 5095 / 43 | - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `5d6fac8` (debug): 744 passed, 0 failed, 41 ignored; SKIPPED (no wave64): the two usual ones. - No frozen window this time. Run 1 lasted longer than any run of `main` or of the earlier head on this card. The device removal still happened once in three, with the same signature as with `808a8a4`. - The pools stayed within a few MB of the target pages, while with `808a8a4` they were up to 0.7 GB above. The first round, on `808a8a4`, follows unchanged. --- Test of the then-current head `808a8a4` merged onto `main` `67a3735` (clean merge, local tree `2b51eef`) on an 8 GB card, with `XCL_PSO_WAIT_MS=50` (#891) and `XCL_PAGE_BUDGET_MB=3072`, compared with `main` and the same wait budget. **Setup** - RTX 5060 8 GB (wave32 only), driver 621.14; Ryzen 7 5700G, 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.8.2502.11. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `2b51eef` (debug): 737 passed, 0 failed, 41 ignored. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - Retail title 1.0.2.1, release, `XCL_NETWORK=0 XCL_ACTIVITY=1`, menus walked with `XCL_PRESS_A_AT=14,17,21,125,131,…,197` (as in #505); driver-blob cache warm. **Runs** | build | budget | end | local video memory | target pages (pools) | evicted / mapped again | |---|---|---|---|---|---| | `main` | off | watchdog `+0x23cf683`, 369.7 s | 14.1 GB | 9.4 GB (9.7) | – | | `main` | off | watchdog `+0x23cf683`, 346.9 s | 14.5 GB | 9.8 GB (9.9) | – | | `main` | off | watchdog `+0x23cf683`, 395.9 s | 12.8 GB | 8.9 GB (9.0) | – | | this PR | 3072 | device removed (`0x887a0006`), 294.2 s, then the title's `0x80000003` at `+0x2474606` | 11.4 GB | 6.0 GB (6.7) | 7055 / 81 | | this PR | 3072 | the log stops at 314.6 s with no crash line; the window stayed black and frozen until I killed it | – | – | 7205 / 76 | | this PR | 3072 | watchdog, the other site (`+0x2215c35`), 373.9 s | 9.2 GB | 5.2 GB (5.2) | 3686 / 53 | The budget does lower the pages by 3.5–4.5 GB and local video memory by 3–5 GB. On this card, that brought it to 9.2 GB in the run that got furthest, still over 8 GB. With #891's waits, none of the six runs gets past the point where the loading screen goes black: `main` ends at the watchdog, and so does the third budget run, at about the same time. The other two budget runs ended earlier, one with a device removal and one frozen. I saw neither on `main` in these runs, but three runs each can't tell this PR apart from chance. **Not tested** - Other budgets; AMD. - Whether evicted textures were drawn empty: the screen was black by then. **AI use** - Claude Code (Claude Opus 5.5) scripted and ran the runs and the test suite, read the logs and drafted this comment. I checked the results.
Author
Owner

@⁠rrrarrra9 on GitHub · 2026-11-24 19:30 UTC · original

Tested

  • Windows, GTX 1650 (4 GB), Series X package. Local release build aa0cd5474f1894e4819657583ebad42e1c20ab22 (b7aa9f3 + DXGI budget logging + a cherry-pick of this PR). XCL_ACTIVITY=1 and XCL_PAGE_BUDGET_MB=2048.
  • The 210 s run recorded 2,296 PresentX calls and no device removal. The last sample had 11,602 MiB of local usage, 6,912 MiB of texture page pools, 5,478 evictions and 57 remaps. A 270 s repeat with the shader cache already populated recorded 2,165 PresentX calls and no device removal, with 11,661 MiB local at the last sample. Both runs still had a black screen and slow presents near the end.
  • The run without this PR (e1c920e, same DXGI logging) sampled 13,876 MiB of local usage against a 3,344 MiB budget before device removal at about 148 s.

Not tested This PR head in isolation, longer gameplay, or the visual effect of eviction once in the world.

AI use OpenAI Codex with GPT-6.2-Sol summarized the local run logs.

**@⁠rrrarrra9** on GitHub · 2026-11-24 19:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7142186929) **Tested** - Windows, GTX 1650 (4 GB), Series X package. Local release build aa0cd5474f1894e4819657583ebad42e1c20ab22 (b7aa9f3 + DXGI budget logging + a cherry-pick of this PR). XCL_ACTIVITY=1 and XCL_PAGE_BUDGET_MB=2048. - The 210 s run recorded 2,296 PresentX calls and no device removal. The last sample had 11,602 MiB of local usage, 6,912 MiB of texture page pools, 5,478 evictions and 57 remaps. A 270 s repeat with the shader cache already populated recorded 2,165 PresentX calls and no device removal, with 11,661 MiB local at the last sample. Both runs still had a black screen and slow presents near the end. - The run without this PR (e1c920e, same DXGI logging) sampled 13,876 MiB of local usage against a 3,344 MiB budget before device removal at about 148 s. **Not tested** This PR head in isolation, longer gameplay, or the visual effect of eviction once in the world. **AI use** OpenAI Codex with GPT-6.2-Sol summarized the local run logs.
Author
Owner

@⁠Jefter5549 on GitHub · 2026-11-24 16:25 UTC · original · edited 2026-11-24 20:28 UTC

Hardware verification on NVIDIA GeForce RTX 2060 SUPER (Turing 8 GB) at 52d2a34 (PR #640 combined with PR #800 + PR #1017 on upstream HEAD b7aa9f3; note: #1017 was later closed as invalid)

Environment:

  • OS: Windows 11 Pro 24H2 (x64)
  • CPU: Intel Xeon E5-2666 v3 (10C/20T, Haswell-EP)
  • GPU: NVIDIA GeForce RTX 2060 SUPER 8 GB (driver 32.0.15.6614), 32-lane wave32 architecture
  • RAM: 32 GB DDR4 2133 Quad-Channel
  • Toolchain: rustc 1.100.0 MSVC / DXC 1.9.2602.17 (Windows SDK 10.0.26100.0)
  • Profile: Release build (--release -p xcl)
  • Configuration: XCL_PAGE_BUDGET_MB=4096, XCL_ACTIVITY=1, XCL_NETWORK=0

1. Unit Tests & PR #800 Integration Invariant:

  • cargo test -p xcl --lib page_budget: 3/3 PASSED (0.53s):
    • page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it
    • page_budget_evicts_the_least_recently_touched_cpu_filled_texture
    • page_budget_one_placement_at_the_cap_evicts_one_batch
  • cargo test -p xcl --lib vram -- --test-threads=1: 14/14 PASSED (4.58s), confirming clean compatibility with PR #800's pool recycling and cooling queues.
  • Important integration note with PR #800:
    When PR #640 is combined with PR #800 (which turns pools: Vec<ID3D12Heap> into Vec<Option<ID3D12Heap>> with vacant slot recycling), PR #640's pool cap check must count active non-empty pools (self.pools.iter().flatten().count()) rather than self.pools.len(). Otherwise, vacant None slots left behind by released pools are counted as allocated heaps, triggering premature and excessive LRU eviction rounds.

2. Retail Title Smoke & Sustained Streaming Run:

Phase 1: Cap Enforcement at Steady 30.0 FPS (Frames 0 – 4,800+)

  • Execution sustained 4,800+ presented frames at 4K (3840x2160) at solid 30.0 FPS.
  • With XCL_PAGE_BUDGET_MB=4096, pool growth was initially bounded at target pages 4179 MB (pools 4224 MB) with local VRAM stabilized at 6912 MB (comfortably below our 8006 MB hardware limit).
  • Initial eviction rounds succeeded: page budget: 184 textures evicted, 0 mapped again. Zero CreateHeap refused (0x887A0005) occurrences.

Phase 2: Edge Condition #1 — Visual Degradation on Static Screen Backgrounds (Root Cause Analysis)

  • Mechanism of Eviction: High-resolution loading screen artworks (e.g. 3840x2160) are registered as CPU-filled (set_evictable). Because a single 4K texture spans hundreds of 64 KiB tiles (far exceeding EVICT_MIN_TILES = 4), the greedy eviction algorithm prioritizes unmapping them first to fulfill the EVICT_BATCH = 512 tile reclamation target.
  • Missing Remap Trigger: The title uploads these background artworks once during startup. Subsequently, they remain bound to descriptor tables and are continuously sampled by pixel shaders in D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE without further CPU write cycles or resource state transition barriers.
  • Visual Failure: Because XCL's remap logic (revive_listed) relies exclusively on detecting command-list transition barriers or CPU dirty-page writes (refresh_once), XCL is blind to pure GPU shader reads. The evicted tiles remain unmapped permanently (mapped again was only 12 out of 5,461 total evictions). Under D3D12 Tier-2 tiled resource rules, sampling unmapped tiles returns zeroes (0x0), rendering the entire background artwork as a solid black rectangle while independent UI glyphs (< 4 tiles or in arenas) render over black.

Phase 3: Edge Condition #2 — Soft Cap Leaking via EVICT_IDLE

  • As the title transitioned into heavy streaming (DirectStorage request #32,768+, unpacking BCPack BC6H streams for vehicle assets), new tile demand surged faster than candidate textures could reach the 5 s age threshold.
  • When evict_lru(EVICT_BATCH) returned 0, take_tile engaged evict_idle_until = Some(now + 1s). While idle, allocation requests bypassed the cap entirely, allocating new 64 MB heaps unconditionally.
  • Pool allocations expanded past the budget from 4,096 MB up to 6,784 MB (target pages 6,752 MB).
  • Combined with ~2.1 GB of sparse pools and the 4.0 GB UMA coherent window, total local video memory allocation reached 10,842 MB (exceeding hardware physical VRAM by 2.8 GB).
  • The resulting memory pressure provoked a driver TDR / 0x887A0006 (DXGI_ERROR_DEVICE_REMOVED) during background DXIL compilation of a 330 KB compute shader, followed by the title's internal breakpoint 0x80000003 at +0x2474606.

3. Actionable Recommendations:

  1. Protect Actively Bound & Presentation-Sized Textures:
    • Full-screen presentation textures or textures currently referenced in active descriptor tables/heaps should not be candidates for LRU unmapping based solely on CPU idle time.
    • Alternatively, provide an exclusion filter (e.g., textures matching swapchain dimensions or marked as presentation art), or require an explicit opt-in for evictable textures rather than assuming any CPU-filled texture > 4 tiles is discardable.
  2. Harden the Cap against EVICT_IDLE Leaks:
    • When candidates older than 5 s are exhausted, instead of allowing unthrottled heap creation during the 1-second idle window, consider relaxing the age threshold dynamically under extreme pressure or reusing cooled tiles before allocating beyond the budget.
  3. Adopt live_pools() Count:
    • Use pools.iter().flatten().count() for the budget evaluation so that PR #640 harmonizes cleanly with PR #800's empty-pool reclamation.

AI use: Gemini 4 Neon merged the branches, resolved the PR #800 Option invariant, compiled release binaries on Windows 11, monitored live hardware telemetry and drafted this review. All test runs were executed on physical hardware.

**@⁠Jefter5549** on GitHub · 2026-11-24 16:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7137639016) · edited 2026-11-24 20:28 UTC **Hardware verification on NVIDIA GeForce RTX 2060 SUPER (Turing 8 GB) at `52d2a34` (PR #640 combined with PR #800 + PR #1017 on upstream HEAD `b7aa9f3`; note: #1017 was later closed as invalid)** **Environment:** - OS: Windows 11 Pro 24H2 (x64) - CPU: Intel Xeon E5-2666 v3 (10C/20T, Haswell-EP) - GPU: NVIDIA GeForce RTX 2060 SUPER 8 GB (driver 32.0.15.6614), 32-lane wave32 architecture - RAM: 32 GB DDR4 2133 Quad-Channel - Toolchain: rustc 1.100.0 MSVC / DXC 1.9.2602.17 (Windows SDK 10.0.26100.0) - Profile: Release build (`--release -p xcl`) - Configuration: `XCL_PAGE_BUDGET_MB=4096`, `XCL_ACTIVITY=1`, `XCL_NETWORK=0` --- ### 1. Unit Tests & PR #800 Integration Invariant: - `cargo test -p xcl --lib page_budget`: **3/3 PASSED** (0.53s): - `page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it` - `page_budget_evicts_the_least_recently_touched_cpu_filled_texture` - `page_budget_one_placement_at_the_cap_evicts_one_batch` - `cargo test -p xcl --lib vram -- --test-threads=1`: **14/14 PASSED** (4.58s), confirming clean compatibility with PR #800's pool recycling and cooling queues. - **Important integration note with PR #800:** When PR #640 is combined with PR #800 (which turns `pools: Vec<ID3D12Heap>` into `Vec<Option<ID3D12Heap>>` with vacant slot recycling), PR #640's pool cap check must count active non-empty pools (`self.pools.iter().flatten().count()`) rather than `self.pools.len()`. Otherwise, vacant `None` slots left behind by released pools are counted as allocated heaps, triggering premature and excessive LRU eviction rounds. --- ### 2. Retail Title Smoke & Sustained Streaming Run: #### Phase 1: Cap Enforcement at Steady 30.0 FPS (Frames 0 – 4,800+) - Execution sustained 4,800+ presented frames at 4K (3840x2160) at solid 30.0 FPS. - With `XCL_PAGE_BUDGET_MB=4096`, pool growth was initially bounded at `target pages 4179 MB (pools 4224 MB)` with local VRAM stabilized at `6912 MB` (comfortably below our 8006 MB hardware limit). - Initial eviction rounds succeeded: `page budget: 184 textures evicted, 0 mapped again`. Zero `CreateHeap refused (0x887A0005)` occurrences. #### Phase 2: Edge Condition #1 — Visual Degradation on Static Screen Backgrounds (Root Cause Analysis) - **Mechanism of Eviction:** High-resolution loading screen artworks (e.g. 3840x2160) are registered as CPU-filled (`set_evictable`). Because a single 4K texture spans hundreds of 64 KiB tiles (far exceeding `EVICT_MIN_TILES = 4`), the greedy eviction algorithm prioritizes unmapping them first to fulfill the `EVICT_BATCH = 512` tile reclamation target. - **Missing Remap Trigger:** The title uploads these background artworks once during startup. Subsequently, they remain bound to descriptor tables and are continuously sampled by pixel shaders in `D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE` without further CPU write cycles or resource state transition barriers. - **Visual Failure:** Because XCL's remap logic (`revive_listed`) relies exclusively on detecting command-list transition barriers or CPU dirty-page writes (`refresh_once`), XCL is blind to pure GPU shader reads. The evicted tiles remain unmapped permanently (`mapped again` was only 12 out of 5,461 total evictions). Under D3D12 Tier-2 tiled resource rules, sampling unmapped tiles returns zeroes (0x0), rendering the entire background artwork as a solid black rectangle while independent UI glyphs (< 4 tiles or in arenas) render over black. #### Phase 3: Edge Condition #2 — Soft Cap Leaking via `EVICT_IDLE` - As the title transitioned into heavy streaming (DirectStorage request #32,768+, unpacking BCPack BC6H streams for vehicle assets), new tile demand surged faster than candidate textures could reach the 5 s age threshold. - When `evict_lru(EVICT_BATCH)` returned 0, `take_tile` engaged `evict_idle_until = Some(now + 1s)`. While idle, allocation requests bypassed the cap entirely, allocating new 64 MB heaps unconditionally. - Pool allocations expanded past the budget from 4,096 MB up to 6,784 MB (target pages 6,752 MB). - Combined with ~2.1 GB of sparse pools and the 4.0 GB UMA coherent window, total local video memory allocation reached 10,842 MB (exceeding hardware physical VRAM by 2.8 GB). - The resulting memory pressure provoked a driver TDR / `0x887A0006 (DXGI_ERROR_DEVICE_REMOVED)` during background DXIL compilation of a 330 KB compute shader, followed by the title's internal breakpoint `0x80000003` at `+0x2474606`. --- ### 3. Actionable Recommendations: 1. **Protect Actively Bound & Presentation-Sized Textures:** - Full-screen presentation textures or textures currently referenced in active descriptor tables/heaps should not be candidates for LRU unmapping based solely on CPU idle time. - Alternatively, provide an exclusion filter (e.g., textures matching swapchain dimensions or marked as presentation art), or require an explicit opt-in for evictable textures rather than assuming any CPU-filled texture > 4 tiles is discardable. 2. **Harden the Cap against `EVICT_IDLE` Leaks:** - When candidates older than 5 s are exhausted, instead of allowing unthrottled heap creation during the 1-second idle window, consider relaxing the age threshold dynamically under extreme pressure or reusing cooled tiles before allocating beyond the budget. 3. **Adopt `live_pools()` Count:** - Use `pools.iter().flatten().count()` for the budget evaluation so that PR #640 harmonizes cleanly with PR #800's empty-pool reclamation. --- **AI use:** Gemini 4 Neon merged the branches, resolved the PR #800 Option<Heap> invariant, compiled release binaries on Windows 11, monitored live hardware telemetry and drafted this review. All test runs were executed on physical hardware.
Author
Owner

@⁠celmix07-design on GitHub · 2026-11-24 20:47 UTC · original

A 6 GB / 16 GB data point for this PR: with XCL_PAGE_BUDGET_MB=3072 the world load gets past the video-memory assert, and the run then ends in a device hang instead.

Setup: NVIDIA GeForce RTX 2060 6 GB (wave32), driver 621.01; 16 GB DDR5 (one stick), 44 GB page file; Windows 11 Home 26200; retail 1.0.2.1, Series X profile; release build of main 4178e88 + this PR's head 5d6fac8, DXC 1.9.2602.17.

Without the budget (same build, three runs): sparse windows: no video memory for more tiles and no video memory for more pages of title textures (0x8007000e), then 0x80000003 at +0x193e00f with rax = rcx = rsi = 0x8007000e, 110–195 s in. Per-process GPU counters just before: dedicated 5.2 GB of 6, shared 7.6 GB, which is Windows' shared limit (half the RAM).

With XCL_PAGE_BUDGET_MB=3072: page budget 3072 MB (48 pools of 64 MB), textures evicted from 13 s on (160 by 43 s), no 0x8007000e at all. The game reaches gameplay; at 63 s the device is removed with 0x887a0005 (DXGI_ERROR_DEVICE_HUNG), and the title is stopped. Nothing else is logged before it.

Not tested yet: TdrDelay. A pass slower than Windows' 2 s on this card and a pass that never ends look the same here; I will add the result.

AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and drafted this note; the numbers come from the runs described.

**@⁠celmix07-design** on GitHub · 2026-11-24 20:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7144058925) A 6 GB / 16 GB data point for this PR: with `XCL_PAGE_BUDGET_MB=3072` the world load gets past the video-memory assert, and the run then ends in a device hang instead. **Setup:** NVIDIA GeForce RTX 2060 6 GB (wave32), driver 621.01; 16 GB DDR5 (one stick), 44 GB page file; Windows 11 Home 26200; retail 1.0.2.1, Series X profile; release build of `main` `4178e88` + this PR's head `5d6fac8`, DXC 1.9.2602.17. **Without the budget** (same build, three runs): `sparse windows: no video memory for more tiles` and `no video memory for more pages of title textures` (`0x8007000e`), then `0x80000003` at `+0x193e00f` with `rax = rcx = rsi = 0x8007000e`, 110–195 s in. Per-process GPU counters just before: dedicated 5.2 GB of 6, shared 7.6 GB, which is Windows' shared limit (half the RAM). **With `XCL_PAGE_BUDGET_MB=3072`:** `page budget 3072 MB (48 pools of 64 MB)`, textures evicted from 13 s on (160 by 43 s), no `0x8007000e` at all. The game reaches gameplay; at 63 s the device is removed with `0x887a0005` (DXGI_ERROR_DEVICE_HUNG), and the title is stopped. Nothing else is logged before it. **Not tested yet:** `TdrDelay`. A pass slower than Windows' 2 s on this card and a pass that never ends look the same here; I will add the result. AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and drafted this note; the numbers come from the runs described.
Author
Owner

@⁠zorde23 on GitHub · 2026-11-25 00:40 UTC · original

Test report on an AMD RX 6750 XT (12 GB, driver 32.0.21045.29003), Ryzen 7 5700X, 32 GB RAM, Windows build 26200, release build.

What was tested: 5d6fac8 no longer applies to current main (#1747 reworked the tile pool in vram.rs), so I rebased it locally onto 80f4819. This is not your commit, so here is what I changed: the cap check moved from take_tile to the start of Pages::bind, before the missing tiles are counted (an eviction can free pages the texture being bound shares). At the budget it runs one evict_lru round of max(EVICT_BATCH, tiles), then moves every cooling tile into the free lists before take_batch. evict_lru counts pool.free_total + pool.cooling.len(). Both of your page_budget_* tests pass on the rebase (the second one adapted to the new pool). Budget XCL_PAGE_BUDGET_MB=4096. The same build also had local diagnostics (memory by kind, a commit guard), which are also in the main run it is compared with.

Run: the retail title, 300 s, A pressed at 15-35 s to reach the world, XCL_PSO_PRELOAD=0, XCL_ACTIVITY=1. Both runs were stopped by my guard at 10 % of the system's commit limit left, with about the same headroom at the start (22.7 / 23.1 GB).

main 80f4819 with the rebased #640
run length (guard) 150 s 251 s
frames drop to 0-20 per 2 s at 76 s 77 s
page pools at 150 s (pages in use) 10.0 GB (9.8) 6.5 GB (6.4)
local video memory at 150 s (OS budget ~10.2 GB) 14.0 GB 10.2 GB
process commit at 150 s 28.1 GB 23.7 GB
textures evicted / mapped again - 5,532 / 263
  • The budget holds the page pools 3.5 GB lower, but they still pass 4096 MB (6.5 GB from ~131 s on).
  • The frame stall starts at the same time, with video memory under the OS budget in both runs, so the budget does not change it on this title. Presents after 70 s: 441 in 80 s (main), 554 in 180 s (#640).
  • No device removal and no crash in either run. No visual check was made.

Not tested: your exact commit (only the rebase above), other budgets, #782 on top, NVIDIA, a full cargo test --workspace on this rebase (only the vram:: and title_textures:: tests; three of them also fail on main + my local commits on this GPU).

Written with Claude Code from runs on this machine.

**@⁠zorde23** on GitHub · 2026-11-25 00:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7148760256) Test report on an AMD RX 6750 XT (12 GB, driver 32.0.21045.29003), Ryzen 7 5700X, 32 GB RAM, Windows build 26200, release build. **What was tested:** 5d6fac8 no longer applies to current `main` (#1747 reworked the tile pool in `vram.rs`), so I rebased it locally onto 80f4819. This is not your commit, so here is what I changed: the cap check moved from `take_tile` to the start of `Pages::bind`, before the missing tiles are counted (an eviction can free pages the texture being bound shares). At the budget it runs one `evict_lru` round of `max(EVICT_BATCH, tiles)`, then moves every cooling tile into the free lists before `take_batch`. `evict_lru` counts `pool.free_total + pool.cooling.len()`. Both of your `page_budget_*` tests pass on the rebase (the second one adapted to the new pool). Budget `XCL_PAGE_BUDGET_MB=4096`. The same build also had local diagnostics (memory by kind, a commit guard), which are also in the `main` run it is compared with. **Run:** the retail title, 300 s, A pressed at 15-35 s to reach the world, `XCL_PSO_PRELOAD=0`, `XCL_ACTIVITY=1`. Both runs were stopped by my guard at 10 % of the system's commit limit left, with about the same headroom at the start (22.7 / 23.1 GB). | | `main` 80f4819 | with the rebased #640 | |---|---|---| | run length (guard) | 150 s | 251 s | | frames drop to 0-20 per 2 s at | 76 s | 77 s | | page pools at 150 s (pages in use) | 10.0 GB (9.8) | 6.5 GB (6.4) | | local video memory at 150 s (OS budget ~10.2 GB) | 14.0 GB | 10.2 GB | | process commit at 150 s | 28.1 GB | 23.7 GB | | textures evicted / mapped again | - | 5,532 / 263 | - The budget holds the page pools 3.5 GB lower, but they still pass 4096 MB (6.5 GB from ~131 s on). - The frame stall starts at the same time, with video memory under the OS budget in both runs, so the budget does not change it on this title. Presents after 70 s: 441 in 80 s (`main`), 554 in 180 s (#640). - No device removal and no crash in either run. No visual check was made. **Not tested:** your exact commit (only the rebase above), other budgets, #782 on top, NVIDIA, a full `cargo test --workspace` on this rebase (only the `vram::` and `title_textures::` tests; three of them also fail on `main` + my local commits on this GPU). Written with Claude Code from runs on this machine.
Author
Owner

@⁠iggyvilla on GitHub · 2026-11-25 01:35 UTC · original

Test report for #640 (head 5d6fac8, still the PR head on 2026-11-25) on RDNA2, a retail title.

Measured by an agent (omp, DeepSeek V4.1 Flash); I (Claude Code, Claude Sonnet 5.5) re-read the run logs, checked
the numbers below against them and wrote this. Measurement only, no code change; the test suite was not run.

  • Hardware: Radeon RX 6650 XT 8 GB (RDNA2), Ryzen 7 5700X, 32 GB RAM, Windows 10.0.26300, release build,
    retail title 7952987A (not included here).
  • Tree: origin/main b7aa9f3 + #889 (e1d3b9d) + #1288 (95299f4) + this PR. A 300 s scripted walk (XCL_PRESS_AT gamepad presses) from a save past first-run setup, XCL_ACTIVITY=1 XCL_DXC_THREADS=4 XCL_NETWORK=0.
  • Budget 4096: page budget 4096 MB (64 pools of 64 MB) logged at 2.6 s, 5,743
    textures evicted and 79 mapped again. Peak pages 6,589 MB (pools 6,592) and peak local 11,729 MB,
    against 9,817 / 14,956 MB with the budget unset (the control run, same tree). The pools stay ~2.5 GB over the cap,
    the soft-cap behaviour the PR describes. Both walks reached the loading art; neither drew the world.
  • No new failure signature: no device removal, no 0x8007000e, no +0x23cf683. But the last present is at
    145 s in both, so missing or zero-sampled textures cannot be judged from these runs.
  • Process commit: the budget run climbed at ~1 GB/s from ~205 s to 71 GB and Windows ended the process at
    254 s (74.5 GB, event 2004). This is not shown to come from the PR: the base tree without the PR did
    the same from ~280 s (34 GB -> 71 GB at 308 s), and XCL's own page/pool counters are
    flat during the climb. The two other budget runs (3072 and a repeat of 4096) hit 71 GB at 62 s while still in the
    menus, but they ran minutes after an OS kill with only 25.8 GB free, and the script aborted at 64-66 s, so
    they are invalid and only a note: pages were 4.2 and 4.1 GB there.
  • One run per state; the climb is an observation, not a measured cause.

Not tested

  • The world drawn with the budget on (nothing 3D is drawn on this walk), the test suite, other GPUs,
    combining with #1182 (they conflict in d3d12x/vram.rs).

AI use: an agent (omp, DeepSeek V4.1 Flash) ran and measured; Claude Code, Claude Sonnet 5.5 verified and wrote this report.

**@⁠iggyvilla** on GitHub · 2026-11-25 01:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7149722276) **Test report for #640 (head `5d6fac8`, still the PR head on 2026-11-25) on RDNA2, a retail title.** Measured by an agent (omp, DeepSeek V4.1 Flash); I (Claude Code, Claude Sonnet 5.5) re-read the run logs, checked the numbers below against them and wrote this. Measurement only, no code change; the test suite was not run. - Hardware: Radeon RX 6650 XT 8 GB (RDNA2), Ryzen 7 5700X, 32 GB RAM, Windows 10.0.26300, release build, retail title `7952987A` (not included here). - Tree: `origin/main` b7aa9f3 + #889 (e1d3b9d) + #1288 (95299f4) + this PR. A 300 s scripted walk (`XCL_PRESS_AT` gamepad presses) from a save past first-run setup, `XCL_ACTIVITY=1 XCL_DXC_THREADS=4 XCL_NETWORK=0`. - Budget 4096: `page budget 4096 MB (64 pools of 64 MB)` logged at 2.6 s, 5,743 textures evicted and 79 mapped again. Peak pages **6,589 MB** (pools 6,592) and peak local **11,729 MB**, against **9,817 / 14,956 MB** with the budget unset (the control run, same tree). The pools stay ~2.5 GB over the cap, the soft-cap behaviour the PR describes. Both walks reached the loading art; neither drew the world. - No new failure signature: no device removal, no `0x8007000e`, no `+0x23cf683`. But the last present is at 145 s in both, so missing or zero-sampled textures cannot be judged from these runs. - Process commit: the budget run climbed at ~1 GB/s from ~205 s to 71 GB and Windows ended the process at 254 s (74.5 GB, event 2004). **This is not shown to come from the PR**: the base tree without the PR did the same from ~280 s (34 GB -> 71 GB at 308 s), and XCL's own page/pool counters are flat during the climb. The two other budget runs (3072 and a repeat of 4096) hit 71 GB at 62 s while still in the menus, but they ran minutes after an OS kill with only 25.8 GB free, and the script aborted at 64-66 s, so they are **invalid** and only a note: pages were 4.2 and 4.1 GB there. - One run per state; the climb is an observation, not a measured cause. **Not tested** - The world drawn with the budget on (nothing 3D is drawn on this walk), the test suite, other GPUs, combining with #1182 (they conflict in `d3d12x/vram.rs`). **AI use**: an agent (omp, DeepSeek V4.1 Flash) ran and measured; Claude Code, Claude Sonnet 5.5 verified and wrote this report.
Author
Owner

@⁠UdontJustEatEm on GitHub · 2026-11-25 06:09 UTC · original · edited 2026-11-25 06:11 UTC

@⁠LeonardoS11 Thanks for working on this. I tested the texture-page budget offline on a desktop RTX 5050 (7,910 MiB), NVIDIA driver 621.24, Ryzen 5 5500, 16 GiB RAM, and Windows 11 build 26300.9974. The title build was 1.0.2.1.

Tested

  • Baseline XCL cbc296ab65a2661a61e3e2da109134bcd5319f60 reached world loading. A 64 MiB D3D12 heap for title textures returned 0x8007000E, followed by the title breakpoint at +0x193e00f. The run recorded 4,740 presents and about 9,652 MiB of live texture pages just before the failure.
  • Exact PR revision 5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a with XCL_PAGE_BUDGET_MB=3072 and the default pipeline wait got past that heap failure. It recorded 2,012 presents, 5,340 evictions, and 36 remaps. The texture pools reached 6,592 MiB, consistent with the budget acting as a soft threshold. This run reused a completed setup profile and later hit the +0x23cf683 watchdog.
  • I adapted #640 onto cbc296ab and tested a learned 4,095 MiB coherent window with XCL_PSO_WAIT_MS=50. It got past the 40-bit BVH address error seen with the 512 MiB window. It ended with 0x887a0005 after 2,978 presents. The last counters showed 1,331 skipped draws and 3,469 skipped dispatches.
  • A separate run combined that adaptation with #1405, #1599, a 3,584 MiB coherent window, and a warmed direct-DXIL cache. It logged 179 driver-blob hits and zero failed DirectStorage requests. It reached 2,817 presents before device removal. One compute pipeline still took 52.2 seconds to build. The captures showed the loading panel.

Tile-count example from the local adaptation

The newer allocator reserves tiles in a batch. Suppose a new texture needs A and C. It can initially share A, so it needs one fresh tile. If eviction releases the last mapping of A, it needs two. The adaptation recalculates the missing count and preferred heap after eviction and before reserving the batch.

# Simplified allocator flow
missing, preferred_heap = count_missing_tiles(placement)
while budget_pressure_requires_eviction(missing):
    if evict_eligible_textures() == 0:
        break
    missing, preferred_heap = count_missing_tiles(placement)
reserve_tile_batch(missing, preferred_heap)

Not tested

A same-revision budget-on/budget-off comparison, either storage patch in isolation, or longer sessions. A 3D world frame remains unverified.

I adapted the patch to the newer base, ran the offline tests on my PC, and drafted this report from the measured results.

**@⁠UdontJustEatEm** on GitHub · 2026-11-25 06:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7154505476) · edited 2026-11-25 06:11 UTC @⁠LeonardoS11 Thanks for working on this. I tested the texture-page budget offline on a desktop RTX 5050 (7,910 MiB), NVIDIA driver 621.24, Ryzen 5 5500, 16 GiB RAM, and Windows 11 build 26300.9974. The title build was 1.0.2.1. **Tested** - Baseline XCL `cbc296ab65a2661a61e3e2da109134bcd5319f60` reached world loading. A 64 MiB D3D12 heap for title textures returned `0x8007000E`, followed by the title breakpoint at `+0x193e00f`. The run recorded 4,740 presents and about 9,652 MiB of live texture pages just before the failure. - Exact PR revision `5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a` with `XCL_PAGE_BUDGET_MB=3072` and the default pipeline wait got past that heap failure. It recorded 2,012 presents, 5,340 evictions, and 36 remaps. The texture pools reached 6,592 MiB, consistent with the budget acting as a soft threshold. This run reused a completed setup profile and later hit the `+0x23cf683` watchdog. - I adapted #640 onto `cbc296ab` and tested a learned 4,095 MiB coherent window with `XCL_PSO_WAIT_MS=50`. It got past the 40-bit BVH address error seen with the 512 MiB window. It ended with `0x887a0005` after 2,978 presents. The last counters showed 1,331 skipped draws and 3,469 skipped dispatches. - A separate run combined that adaptation with #1405, #1599, a 3,584 MiB coherent window, and a warmed direct-DXIL cache. It logged 179 driver-blob hits and zero failed DirectStorage requests. It reached 2,817 presents before device removal. One compute pipeline still took 52.2 seconds to build. The captures showed the loading panel. **Tile-count example from the local adaptation** The newer allocator reserves tiles in a batch. Suppose a new texture needs A and C. It can initially share A, so it needs one fresh tile. If eviction releases the last mapping of A, it needs two. The adaptation recalculates the missing count and preferred heap after eviction and before reserving the batch. ```text # Simplified allocator flow missing, preferred_heap = count_missing_tiles(placement) while budget_pressure_requires_eviction(missing): if evict_eligible_textures() == 0: break missing, preferred_heap = count_missing_tiles(placement) reserve_tile_batch(missing, preferred_heap) ``` **Not tested** A same-revision budget-on/budget-off comparison, either storage patch in isolation, or longer sessions. A 3D world frame remains unverified. I adapted the patch to the newer base, ran the offline tests on my PC, and drafted this report from the measured results.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:33 UTC · original

Empirical test report (5d6fac8c)

Hardware / environment

  • Commit 5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a. Windows 11 build 26200, AMD Ryzen 7 3800X, Intel Arc A770 (DXGI adapter 0, driver 32.0.101.9175).
  • Rust 1.100.0 (0ef1bc386 2026-11-09) for x86_64-pc-windows-msvc, DXC 1.9.2609.5 (01b62ad47).

Commands and results

  • cargo test --workspace --no-run outside the Arc lock exited 0. The diff adds three D3D12 tests and no CPU-only tests.
  • Inside Invoke-ArcTest.ps1, with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1, ran the prebuilt library test binary once per test. All three commands and the wrapper exited 0.
    • xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::title_textures::tests::page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it --format terse
    • xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_evicts_the_least_recently_touched_cpu_filled_texture --format terse
    • xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_one_placement_at_the_cap_evicts_one_batch --format terse
  • Log totals: 3 passed, 0 failed, 0 ignored, 1 case-sensitive ^SKIPPED line. Two additional tests returned silently before their assertions. Effective coverage: 0 exercised, 3 skipped.

Observed behavior

The title-texture test logged no reserved textures. An independent DXGI/D3D12 probe reported resource heap tier 1 on the A770 at feature levels 11.0 and 12.0. Both VRAM tests require tier 2, and title-texture page placement also requires tier 2.

Not tested

Eviction and remapping assertions, the full GPU workspace suite, and game smoke runs.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr640-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7154916787) ### Empirical test report (5d6fac8c) **Hardware / environment** - Commit `5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a`. Windows 11 build 26200, AMD Ryzen 7 3800X, Intel Arc A770 (DXGI adapter 0, driver `32.0.101.9175`). - Rust `1.100.0 (0ef1bc386 2026-11-09)` for `x86_64-pc-windows-msvc`, DXC `1.9.2609.5 (01b62ad47)`. **Commands and results** - `cargo test --workspace --no-run` outside the Arc lock exited 0. The diff adds three D3D12 tests and no CPU-only tests. - Inside `Invoke-ArcTest.ps1`, with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`, ran the prebuilt library test binary once per test. All three commands and the wrapper exited 0. - `xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::title_textures::tests::page_budget_an_evicted_texture_is_mapped_again_before_the_work_that_uses_it --format terse` - `xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_evicts_the_least_recently_touched_cpu_filled_texture --format terse` - `xcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_one_placement_at_the_cap_evicts_one_batch --format terse` - Log totals: 3 passed, 0 failed, 0 ignored, 1 case-sensitive `^SKIPPED ` line. Two additional tests returned silently before their assertions. Effective coverage: 0 exercised, 3 skipped. **Observed behavior** The title-texture test logged `no reserved textures`. An independent DXGI/D3D12 probe reported resource heap tier 1 on the A770 at feature levels 11.0 and 12.0. Both VRAM tests require tier 2, and title-texture page placement also requires tier 2. **Not tested** Eviction and remapping assertions, the full GPU workspace suite, and game smoke runs. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr640-focused.log and published.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 06:42 UTC · original · edited 2026-11-25 06:47 UTC

Independent synthetic GPU check of 5d6fac8 on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. A test-only fixture queues a real readback of a 512×512 RGBA8 title texture behind a CPU-controlled fence, then places another texture while the read completion fence is still pending. It compares the 16 original pool tile IDs with the replacement's IDs. The gate is released before the bounded GPU drain.

Tested

  • cargo test --offline --locked -j 4 -p xcl --lib --no-run built. The exact test hle::d3d12x::vram::tests::page_budget_does_not_reuse_tiles_before_a_queued_read_retires ran in four fresh processes with --exact --nocapture --test-threads=1, two per setting.
  • With XCL_TEST_QUEUED_READ_UNCAPPED=1, both controls passed. The read was pending, the original stayed mapped, and the replacement reused 0/16 tile IDs.
  • With the cap forced to the existing pool count, both runs failed the intended assertion. The read was pending, the original was evicted, and the replacement reused 16/16 of its tile IDs. The control and cap runs were alternated. No runs skipped, timed out, or reported device removal.

Pixel readback follow-up. I extended the same fixture to upload a patterned 512×512 RGBA8 texture, verify all 262,144 texels with a normal read, reset the readback to a sentinel, and repeat the read behind the gate. The footprint offset and row pitch were accounted for in the comparison. In two fresh uncapped processes, the queued read returned 262,144/262,144 expected texels with 0/16 tile IDs reused. In two capped processes, the original was evicted while the read remained pending, 16/16 IDs were reused, and the completed read returned zero for all 262,144 texels. No sentinel texels remained. Both capped runs failed the intended pixel assertion, both controls passed, and all four drained after gate release without skips, ignored tests, timeouts, or device removal. This is a synthetic readback failure on this adapter. The updated test-only patch is saved locally.

Not tested
Full workspace suite, AMD, retail title, or a corrected eviction policy.

AI use
Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 06:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7155080045) · edited 2026-11-25 06:47 UTC Independent synthetic GPU check of [5d6fac8](https://github.com/xcl-dev/xcl/commit/5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a) on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. A test-only fixture queues a real readback of a 512×512 RGBA8 title texture behind a CPU-controlled fence, then places another texture while the read completion fence is still pending. It compares the 16 original pool tile IDs with the replacement's IDs. The gate is released before the bounded GPU drain. **Tested** - `cargo test --offline --locked -j 4 -p xcl --lib --no-run` built. The exact test `hle::d3d12x::vram::tests::page_budget_does_not_reuse_tiles_before_a_queued_read_retires` ran in four fresh processes with `--exact --nocapture --test-threads=1`, two per setting. - With `XCL_TEST_QUEUED_READ_UNCAPPED=1`, both controls passed. The read was pending, the original stayed mapped, and the replacement reused 0/16 tile IDs. - With the cap forced to the existing pool count, both runs failed the intended assertion. The read was pending, the original was evicted, and the replacement reused 16/16 of its tile IDs. The control and cap runs were alternated. No runs skipped, timed out, or reported device removal. **Pixel readback follow-up.** I extended the same fixture to upload a patterned 512×512 RGBA8 texture, verify all 262,144 texels with a normal read, reset the readback to a sentinel, and repeat the read behind the gate. The footprint offset and row pitch were accounted for in the comparison. In two fresh uncapped processes, the queued read returned 262,144/262,144 expected texels with 0/16 tile IDs reused. In two capped processes, the original was evicted while the read remained pending, 16/16 IDs were reused, and the completed read returned zero for all 262,144 texels. No sentinel texels remained. Both capped runs failed the intended pixel assertion, both controls passed, and all four drained after gate release without skips, ignored tests, timeouts, or device removal. This is a synthetic readback failure on this adapter. The updated test-only patch is saved locally. **Not tested** Full workspace suite, AMD, retail title, or a corrected eviction policy. **AI use** Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 12:43 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 12:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7162773916) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠Narcosasso on GitHub · 2026-11-25 16:18 UTC · original

Heads-up: this no longer merges into current main (0829441). #1747 (3bc7143, "keep vram::Pages tile mappings contiguous per heap") replaced the free / cooling vectors in Pages with a per-heap TilePool (take_batch, drain_cooling) and added reclaiming of empty pool heaps (PoolHeaps, XCL_VRAM_KEEP_SPARE_POOLS), so take_tile's cap check and evict_lru's free.len() + cooling.len() accounting have to be ported onto that allocator, not just conflict-resolved.

Also: #782 is stacked on the earlier revision of this PR (38bf6a3), and its own commit (4928ce5) conflicts with the current head (5d6fac8) in submitted, Pages and evict_lru (evict_idle_until vs evict_after). Testing the two together needs #782 rebased first.

AI use: found with Claude Code (Claude Opus 5.5) while merging main + #640 + #782; checked by me on the PR pages.


Generated by Claude Code

**@⁠Narcosasso** on GitHub · 2026-11-25 16:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7167770655) Heads-up: this no longer merges into current main (0829441). #1747 (3bc7143, "keep vram::Pages tile mappings contiguous per heap") replaced the `free` / `cooling` vectors in `Pages` with a per-heap `TilePool` (`take_batch`, `drain_cooling`) and added reclaiming of empty pool heaps (`PoolHeaps`, `XCL_VRAM_KEEP_SPARE_POOLS`), so `take_tile`'s cap check and `evict_lru`'s `free.len() + cooling.len()` accounting have to be ported onto that allocator, not just conflict-resolved. Also: #782 is stacked on the earlier revision of this PR (38bf6a3), and its own commit (4928ce5) conflicts with the current head (5d6fac8) in `submitted`, `Pages` and `evict_lru` (`evict_idle_until` vs `evict_after`). Testing the two together needs #782 rebased first. AI use: found with Claude Code (Claude Opus 5.5) while merging main + #640 + #782; checked by me on the PR pages. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠anon31-006459 on GitHub · 2026-11-25 20:05 UTC · original

Test report for #640 on Linux / NVIDIA 8 GB: a rebase of 5d6fac8 onto the per-heap tile pool (#1747), not your exact commit. With XCL_PAGE_BUDGET_MB=3072 the retail title reached the in-world intro cutscene with the page pools held at the budget and no memory pressure; it then ended on the +0x23cf683 null write that it also hits without the budget (#662 / #675).

What was tested

  • 5d6fac8 no longer applies to main (#1747 reworked the tile pool), so it was rebased locally onto 00cf258, the same way as in the RX 6750 XT report: the cap check moved from take_tile to the start of Pages::bind, before the missing tiles are counted. At the cap, when the free tiles cannot cover the texture, one evict_lru round of max(EVICT_BATCH, tiles) runs (skipped while cooling + free tiles suffice, and for EVICT_IDLE after a round that found nothing), then every cooling tile goes to the free lists before take_batch. evict_lru counts pool.free_total + pool.cooling.len(). The title_textures.rs, list_x.rs, real.rs and host.rs parts are unchanged from 5d6fac8.
  • The same tree also had local changes for Linux that are not part of #640: presentation from a separate plain queue (the idea of #793), the XG CopyFromSubresource 7-argument fix (the idea of #684), and a sync diagnostic that was off.

Setup

  • Pop!_OS 24.04, kernel 7.2.15, Ryzen 7 3700X, RTX 3070 Ti 8 GB (NVIDIA 595.104.02, 32-lane waves), 32 GB RAM + 67 GB swap (48 GB swap file, 16 GB zram, 4 GB partition).
  • Wine from Proton Experimental experimental-11.0-20261112, vkd3d-proton 2576c0b with its vtable checks patched to accept XCL's vtables (the #1701 problem), DXVK DXGI, DXC 1.9.2609.5.
  • xcl.exe cross-built on Linux for x86_64-pc-windows-gnu (mingw-w64), release.
  • Retail title 1.0.2.1, Series X profile. XCL_PAGE_BUDGET_MB=3072 XCL_PSO_WAIT_MS=50 XCL_HUGE_PSO_CONCURRENCY=1 XCL_PSO_DISK_CACHE=0 VKD3D_CONFIG=ignore_shared_fence, NVIDIA shader disk cache on.

Result (one run with the budget)

  • page budget 3072 MB (48 pools of 64 MB) at start. Evictions began early in the run and reached 3,171 textures by the end of story loading (rounds of 34, 15, 4, 124, 879 and 175 textures; the 879-texture round gave back only 4 MB, as most of those pages were still shared with mapped textures).
  • 28–30 fps through the menus and loading (27.9 fps over 300 frames at 2,700 frames). The world phase started: the intro cutscene drew world geometry (untextured silhouettes of signage, trees and lamps) at ~20 fps.
  • Memory during the world phase: 5–9 GB of RAM available, ~1 GB of swap in use. No device removal, no vkCreate* failure.
  • End: 0xc0000005 in game_scarlett_master.exe+0x23cf683 (write at 0, rcx=0x70024c348) at ~284 s; the title's crash log reports Game Running, 4 min 12 s, frame 2,343, 34 peds.

For comparison, not a clean A/B

  • The run just before it, the same tree without the budget, used 20 GB of swap (no swap file yet) and its own cgroup memory limit, which was lowered during the run. It filled RAM and swap during loading (~19 GB swapped, memory stall time 30–40 %) and ended on the same +0x23cf683 write. So the budget is not what changes the end here; it is what kept memory in bounds on an 8 GB card.

Not tested

  • Your exact commit 5d6fac8; Windows; AMD; other budgets; #782 on top.
  • The test suite: this machine runs Linux, so cargo test was not run. The run above is the only check.
  • No visual check of evicted-then-remapped textures beyond the frames shown.

AI use: Claude Code (Claude Opus 5.5) rebased the PR, ran the title and wrote this report from the logs; I reviewed it before posting.

**@⁠anon31-006459** on GitHub · 2026-11-25 20:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7173180447) **Test report for #640 on Linux / NVIDIA 8 GB: a rebase of `5d6fac8` onto the per-heap tile pool (#1747), not your exact commit. With `XCL_PAGE_BUDGET_MB=3072` the retail title reached the in-world intro cutscene with the page pools held at the budget and no memory pressure; it then ended on the `+0x23cf683` null write that it also hits without the budget (#662 / #675).** **What was tested** - `5d6fac8` no longer applies to `main` (#1747 reworked the tile pool), so it was rebased locally onto `00cf258`, the same way as in [the RX 6750 XT report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/640): the cap check moved from `take_tile` to the start of `Pages::bind`, before the missing tiles are counted. At the cap, when the free tiles cannot cover the texture, one `evict_lru` round of `max(EVICT_BATCH, tiles)` runs (skipped while cooling + free tiles suffice, and for `EVICT_IDLE` after a round that found nothing), then every cooling tile goes to the free lists before `take_batch`. `evict_lru` counts `pool.free_total + pool.cooling.len()`. The `title_textures.rs`, `list_x.rs`, `real.rs` and `host.rs` parts are unchanged from `5d6fac8`. - The same tree also had local changes for Linux that are not part of #640: presentation from a separate plain queue (the idea of #793), the XG `CopyFromSubresource` 7-argument fix (the idea of #684), and a sync diagnostic that was off. **Setup** - Pop!_OS 24.04, kernel 7.2.15, Ryzen 7 3700X, RTX 3070 Ti 8 GB (NVIDIA 595.104.02, 32-lane waves), 32 GB RAM + 67 GB swap (48 GB swap file, 16 GB zram, 4 GB partition). - Wine from Proton Experimental `experimental-11.0-20261112`, vkd3d-proton `2576c0b` with its vtable checks patched to accept XCL's vtables (the #1701 problem), DXVK DXGI, DXC 1.9.2609.5. - xcl.exe cross-built on Linux for `x86_64-pc-windows-gnu` (mingw-w64), release. - Retail title 1.0.2.1, Series X profile. `XCL_PAGE_BUDGET_MB=3072 XCL_PSO_WAIT_MS=50 XCL_HUGE_PSO_CONCURRENCY=1 XCL_PSO_DISK_CACHE=0 VKD3D_CONFIG=ignore_shared_fence`, NVIDIA shader disk cache on. **Result (one run with the budget)** - `page budget 3072 MB (48 pools of 64 MB)` at start. Evictions began early in the run and reached 3,171 textures by the end of story loading (rounds of 34, 15, 4, 124, 879 and 175 textures; the 879-texture round gave back only 4 MB, as most of those pages were still shared with mapped textures). - 28–30 fps through the menus and loading (27.9 fps over 300 frames at 2,700 frames). The world phase started: the intro cutscene drew world geometry (untextured silhouettes of signage, trees and lamps) at ~20 fps. - Memory during the world phase: 5–9 GB of RAM available, ~1 GB of swap in use. No device removal, no `vkCreate*` failure. - End: `0xc0000005` in `game_scarlett_master.exe+0x23cf683` (write at 0, `rcx=0x70024c348`) at ~284 s; the title's crash log reports `Game Running`, 4 min 12 s, frame 2,343, 34 peds. **For comparison, not a clean A/B** - The run just before it, the same tree without the budget, used 20 GB of swap (no swap file yet) and its own cgroup memory limit, which was lowered during the run. It filled RAM and swap during loading (~19 GB swapped, memory stall time 30–40 %) and ended on the same `+0x23cf683` write. So the budget is not what changes the end here; it is what kept memory in bounds on an 8 GB card. **Not tested** - Your exact commit `5d6fac8`; Windows; AMD; other budgets; #782 on top. - The test suite: this machine runs Linux, so `cargo test` was not run. The run above is the only check. - No visual check of evicted-then-remapped textures beyond the frames shown. **AI use:** Claude Code (Claude Opus 5.5) rebased the PR, ran the title and wrote this report from the logs; I reviewed it before posting.
Author
Owner

@⁠throny on GitHub · 2026-11-25 20:28 UTC · original

Two contributors checked independently and found that #2385 solves the same problem (for #1773) in a different way: #1607, group D111. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-25 20:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/640#issuecomment-7173722844) <!-- xcl-1607-hint:D111 --> Two contributors checked independently and found that #2385 solves the same problem (for #1773) in a different way: #1607, group D111. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

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

A fix for the holes @⁠requiemsnkrp reported above (sampled-only textures evicted and never mapped again): the budget does not evict a texture that a view slot still names. The art stays. But on this title the budget then frees almost nothing.

Setup: Linux, Proton Experimental's Wine + vkd3d-proton 3.1, RTX 4070 Ti 12 GB, retail title, Series S profile, XCL_PAGE_BUDGET_MB=4096. This PR's 5d6fac8 merged locally with others on #2057's head, not this PR alone.

  • Before: the loading art went black from the first eviction round (1,573 textures evicted, 0 mapped again).
  • The change (~80 lines with a test): console_heap::note_resource already keeps slot → resource for XCL_TRACE_FRAME. With a budget on, it also counts the view slots that name each texture (vram::viewed), and evict_lru skips a texture any slot names. The census in the log counts those textures apart.
  • After: the art stays in colour. But in the world 1,326 textures (2,966 MB) are named by a view and 0 are evictable, so the pools grew to 6.4 GB anyway (6.9 GB without a budget).

So for a title that keeps a view on most of what it loads, an LRU page budget either leaves holes or frees little. #2385's approach (dropping top mips) may fit those titles better.

Not tested: Windows, AMD, this PR's exact head (it no longer merges into main).

AI use: found, fixed 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/pull/640#issuecomment-7173988340) **A fix for the holes @⁠requiemsnkrp reported above (sampled-only textures evicted and never mapped again): the budget does not evict a texture that a view slot still names. The art stays. But on this title the budget then frees almost nothing.** **Setup:** Linux, Proton Experimental's Wine + vkd3d-proton 3.1, RTX 4070 Ti 12 GB, retail title, Series S profile, `XCL_PAGE_BUDGET_MB=4096`. This PR's `5d6fac8` merged locally with others on #2057's head, not this PR alone. - **Before:** the loading art went black from the first eviction round (1,573 textures evicted, 0 mapped again). - **The change (~80 lines with a test):** `console_heap::note_resource` already keeps slot → resource for `XCL_TRACE_FRAME`. With a budget on, it also counts the view slots that name each texture (`vram::viewed`), and `evict_lru` skips a texture any slot names. The census in the log counts those textures apart. - **After:** the art stays in colour. But in the world 1,326 textures (2,966 MB) are named by a view and 0 are evictable, so the pools grew to 6.4 GB anyway (6.9 GB without a budget). So for a title that keeps a view on most of what it loads, an LRU page budget either leaves holes or frees little. #2385's approach (dropping top mips) may fit those titles better. **Not tested:** Windows, AMD, this PR's exact head (it no longer merges into main). AI use: found, fixed and written with Claude Code (Claude Opus 5.5) from runs it made on this machine.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/real.rs
  • crates/xcl/src/hle/d3d12x/title_textures.rs
  • crates/xcl/src/hle/d3d12x/vram.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/640/head:github-bot/gh-640'
git switch 'github-bot/gh-640'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-640'
git switch 'github-bot/gh-640'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-640'
git switch 'github-bot/gh-640'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-640'
git switch 'main'
git merge --squash 'github-bot/gh-640'
git switch 'main'
git merge --ff-only 'github-bot/gh-640'
git switch 'main'
git merge 'github-bot/gh-640'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.