D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!640
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-640"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@LeonardoS11 on GitHub · 2026-11-24 02:47 UTC · original
LeonardoS11:vram-page-budget→main· +507 −4 · 5 files · 1 commits · openThe 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, withXCL_ACTIVITY=1and 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 perPagesascap, so tests can set it). At the cap,take_tiletakes the tiles the last eviction round gave back first; only when there are none does it callevict_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 texturestitle_textureskeeps in step with the title's memory (set_evictablefromregister), 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.revivemaps an evicted texture again and takes it out of the evicted set only when that worked. The budget needs late release (XCL_LATE_RELEASE=0turns it off with a warning): evicting unmaps a texture from another thread, which is safe only while a texture's lastReleasereachesvram::forgetbefore the object goes.crates/xcl/src/hle/d3d12x/title_textures.rs: evicted textures are mapped again before the work that uses them.revive_listedruns before a submit, ahead ofrefresh, for the textures its lists transition (references taken under theTEXTURESlock), and marks them pending so this submit's refresh uploads them whole. A texture written again by the CPU is mapped again inrefresh_oncebefore 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_contentdrops 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: callrevive_listedbeforerefreshinExecuteCommandListsandKickoffX(inKickoffXthe refresh moved afterreclaim_for_kickoff, which only does bookkeeping, so the segments split before it are covered).crates/xcl/src/host.rs: onepage budget: N textures evicted, M mapped againline next to theXCL_ACTIVITYmemory 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
vramcode 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; texturestitle_texturesrefused are never evicted; a copy into an evicted texture maps it first;pin/touchreturn 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
cargo build --workspace && cargo test --workspace -- --test-threads=4(debug) on5d6fac8: 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 byrevive_listed, pending, its content hash forgotten; a copy recorded into an evicted texture maps it again with no upload pending.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).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:
this PR:
Both runs drop presents in their last seconds, the
mainrun more than this PR's, so the drop is not from this PR (on thismainthe recompiler output changed, and the title's shaders were compiling again).Not tested
5d6fac8.AI use
🤖 Generated with Claude Code
@LocranKing on GitHub · 2026-11-24 03:08 UTC · original
Tested on NVIDIA GeForce RTX 3060 Ti (8 GB, wave32).
Tested
38bf6a324ac3d11387b81592f3dd5fd6fe38ddac(pr-640, clean tree)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo test --workspace --release --no-fail-fast -- --test-threads=4: 688 passed, 0 failed, 41 ignored, exit0;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):PR #640 (
38bf6a3,XCL_PAGE_BUDGET_MBunset):PR #640 (
38bf6a3,XCL_PAGE_BUDGET_MB=2048):XCL_PAGE_BUDGET_MB=2048,xcl.logreportedpage budget: 92 textures evicted, 0 mapped again,target pages 3403 MB (pools 3456 MB)and6016 MB localVRAM at 58 s (down from3577 MB/pools 3584 MBand6144 MB localonmain).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.@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=0and4608. 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).
@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):
+0x193e00f, E_OUTOFMEMORY)+0x23cf683write at 0 (watchdog, #232)Evictions: 561 by 160 s, 8714 by 280 s (824 mapped again). None after 280 s.
Observations:
evict_lrufrees nothing,take_tilemakes 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).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
QueryVideoMemoryInfolocal 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 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.+0x23cf683)+0x193e00f, 12× "no video memory")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
CreateHeapwithin 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 at0x3c, 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.
@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.
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.@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
title_textures::submitted(title_textures.rs:585-591):revivecollects rawusizeresource addresses fromnotes(recorded when the command list was built) and callsID3D12Resource::from_raw_borrowed(&p)->vram::remap_if_unmapped(r)without holdingTEXTURES.lock()or cloning a COM reference.Release/forget(res)between recording/takingresandremap_if_unmapped(r),r.GetDevice(...)dereferences a freed COM object.TEXTURES.lock()viaclone_resources(&revive)(matchingforget()) before callingremap_if_unmapped.real.rs:5028-5034+title_textures.rs:573-599):title_textures::submitted(&mapped)is called afterExecuteCommandListshas already submitted the command lists to the GPU, and only markse.pending = truefor the next submit. So the submission that actually transitions and draws with the revived texture still samples unmapped NULL tiles on that frame.listsbeforeExecuteCommandLists(insiderefresh) would avoid the blank frame.take_evicteddrops the entry even whenremap_if_unmappedreturnsfalse(title_textures.rs:581, 799):remap_if_unmappedfails (returnsfalse),reswas already removed fromEVICTEDandREMAPSwas already incremented, leaving the texture permanently unmapped and never retried.any_evicted()acquires theEVICTEDmutex andtouch(res)acquires the globalPAGESmutex per barrier note whenXCL_PAGE_BUDGET_MB > 0; anAtomicUsizecount forany_evicted()and batchingtouchcalls under onePAGESlock would avoid lock churn.)Tested
rustc 1.100.0(MSVC), debug build.cargo build --workspace && cargo test --workspace -- --test-threads=4: 688 passed, 0 failed, 41 ignored.a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchangedandpage_budget_evicts_the_least_recently_touched_cpu_filled_texture: both passed.SKIPPEDGPU/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
scripts/smoke.ps1run (test suite only).AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.
@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 byevictable,EVICT_MIN_TILES, age oftouched, andtouches == 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:
touched< 5 sSo 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
touchedis only the placement time, soevict_lruevicts the textures placed longest ago, whether or not they are still sampled. Nothing maps them back either, sincetake_evictedis 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.
@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
main9182f27+ #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 --workspacegives 669 passed, 0 failed. That includespage_budget_evicts_the_least_recently_touched_cpu_filled_textureanda_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged.Retail runs:
XCL_PAGE_BUDGET_MB=6144(runs 15–16)7316 textures evicted, 42 mapped again+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.
@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:dev_create_srv_xnotes 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 getstouched = now, and an evicted one found there is mapped again and uploaded. A scan takes 2–9 ms.evict_lrutakes 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:
evict_lruwalks 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:
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.
@woreksami on GitHub · 2026-11-24 05:25 UTC · original
Test report on an 8 GB card, which Not tested lists.
Tested
mainf4ce27c+ #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=4on that tree, twice: 675 passed, 0 failed, 21 ignored, both times.page_budget_evicts_the_least_recently_touched_cpu_filled_texturepasses. 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.XCL_NETWORK=0,XCL_PSO_WAIT_MS=150,XCL_ACTIVITY=1.XCL_PAGE_BUDGET_MB=3072page budget: 250 textures evicted, 24 mapped againby 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.Not tested
main; other budgets than 3072;scripts/smoke.ps1; AMD.AI use
@thatirishguyyy on GitHub · 2026-11-24 07:18 UTC · original
Follow-up on the RX 9070 XT. I cherry-picked
808a8a4ontobeaa245(7c4f641locally), 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.XCL_PAGE_BUDGET_MB=4096The 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_textureGPU test also passed.AI-assisted with Codex for the runs, log analysis, and report.
@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:title_textures.rs:810-812(refresh_once) and:581-590(submitted) calltake_evicted(res), which removes the key fromEVICTED, then ignore theboolfromremap_if_unmappedand callforget_content.remap_if_unmappedreturns false whenbindfinds 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 skipforget_content/upload when it failed. (Same as point 3 of @ethandepstein-del's comment on38bf6a3; it was not changed by the force-push.)evict_lrudereferences a bare address.vram.rs:469-472doesfrom_raw_borrowedon a key fromtargets, holding no reference.res_release(real.rs:1547-1565) calls the realReleasefirst and callsvram::forgetonly when the count is 0, so for a short time the key names a destroyed object, andevict_lrucan callunmapon it from another thread. Before this PR novramcode dereferenced a map key. Keeping a clonedID3D12ResourceinTargetwould close it; the same applies to thesubmittedrevive loop.Smaller:
pin(vram.rs:709) still locksPAGESon everyCopyTextureRegion/CopyResourceeven with the budget off (touchhas thepool_cap() == 0early 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.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@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 on808a8a4alone with the budget set.Tested
808a8a4merged locally intomain1c87b1d(no conflicts; the merge is not published). Release builds,cargo build --release --workspace.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 laptoppage_budget_evicts_the_least_recently_touched_cpu_filled_textureran on the Intel iGPU (tiled-resources tier 3), because it takesEnumAdapters1(0).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:
main1c87b1d0x887a0006at 143 s (12.5 GB local)XCL_PAGE_BUDGET_MB=40960x887a0006at 137 s (10.1 GB local)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.CreatePlacedResourceX … (0x887a0005)andtitle texture: upload failed: texture copy: D3D12 device removed (0x887a0006…), as in #499. Windows logged annvlddmkmevent 153 ("Error occurred on GPUID: 100") in the same second, both times. No0x8007000eand no "no video memory" line in any of the three runs.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.
@milas6669 on GitHub · 2026-11-24 09:20 UTC · original · edited 2026-11-24 09:54 UTC
One run of this PR with
XCL_PAGE_BUDGET_MB=5000on an 8 GB NVIDIA card, with a crash in the texture detiling path at 208 s. Not a regression run (noxcl-smokeblocks).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:
main077ce40+ #891 (XCL_PSO_WAIT_MS=50, so the title gets past the 106 s watchdog stop) + this PR's head808a8a4, 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
page budget 5000 MB (79 pools of 64 MB); evictions start at 118.7 s (77 textures), 5930 by 206 s, 33 mapped again;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 isxcl::gpu::tiling::Chain::detile_level (tiling.rs:438)called fromtitle_textures::subresources (title_textures.rs:1218)on a worker thread ofsubresources_on.process endsline) until I killed it.What I do not know
0x1efa8f10000is a page that this PR's eviction had unmapped: I did not check what that address is (it is not in the title's0x70…range), and I have one run. The run without this PR (same build, no budget) ended at 242 s with the title's own+0x23cf683exit, 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.
@throny on GitHub · 2026-11-24 11:24 UTC · original
Two world-loading runs of
808a8a4on a 16 GB NVIDIA card with the budget set andXCL_PSO_WAIT_MS=50(onmainsince #891), against two runs ofmainwithout the budget. The budget holds video memory down as intended; it does not stop the GPU waits from timing out.Tested
stable-x86_64-pc-windows-msvc; release.808a8a4merged ontomain47efa2e(clean merge); the runs without the budget aremain384f7f7.xcl run <folder>withXCL_NETWORK=0,XCL_ACTIVITY=1,XCL_PSO_WAIT_MS=50,XCL_PRESS_ATfor the profile prompt, 420 s limit, warm DXIL and driver-blob caches. With the budget:XCL_PAGE_BUDGET_MB=6144.target pages(peak)GPU queue.Wait … did not complete within 5000 mspage budget 6144 MB (96 pools of 64 MB)); run 1 ends with9592 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 onmainbuilds too).Not tested
AI use
@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
384f7f7with 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=512andXCL_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
vkAllocateMemoryaccess 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.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@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:take_tileevicts only whencoolingis 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 perPages.title_textures.rs:850).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) untilregisteraccepts it (title_textures.rs:397).pinreturns 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.
@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
No input, 180 s,
XCL_PSO_WAIT_MS=50:exit 0x0, 4219 presents, stays on the titlescreen (flat dark frame), never reaches the world.
With
XCL_PRESS_A_AT=25,40,55,70,85,100+XCL_PSO_WAIT_MS=50on47efa2e(BCPackmerged): 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)
Same presses, plus #640 (
XCL_PAGE_BUDGET_MB=8192),XCL_ACTIVITY=1: the budgetworks (
page budget: 3195 textures evicted, 25 mapped again), but local video memorykeeps 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
~4 GB coherent/UMA window, the sparse windows (7.4 GB) and the title's own D3D12
resources, which no knob seems to bound.
is already gone.
detile_levelcopies from title memory without the tolerance that#484 gave
read_committed(binary-splitReadProcessMemory, zeros for unreadablepages), so it faults instead of zero-filling.
Questions
(
XCL_UMA_MB,XCL_COHERENT_MBexist inconfig.rs/uma.rs— are those meant to belowered, or do they break the title's expectations)?
read_committed-style tolerant copy intitle_textures::subresources_onbethe right fix for the detile fault, or is #992 (
CopyFromSubresourcechecks the sourcerange first) the direction you want?
BCPack is confirmed not the cause on my side too:
bcpack_refused: {}andbcpack_unpackedBC1 1284 / BC5 108 / BC7 138 / BC6H 1, 0 failed.@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=6144it is not.Tested
main930e8b4+ 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 intake_tilewas 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::sparseon that tree: 43 passed, 0 failed, 1 ignored.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.0x887a0005/0x887a0007) at 98–131 s; Aftermath:DeviceRemovedNoGpuFaultListX #101, up to 19 s each). That stop is not this PR's.place_pagesvsplace), 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
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.
@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: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 with0x887a0006for 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_MBexist inconfig.rs/uma.rs— are those meant to be lowered by users, or do they break the title's expectations?).@crosettiremi on GitHub · 2026-11-24 15:32 UTC · original
RX 7900 XT, Windows, Series X profile. I compared main
930e8b4plus #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.
@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
main47efa2e+ 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.XCL_PAGE_BUDGET_MB=3072,XCL_PSO_WAIT_MS=50,XCL_NETWORK=0,XCL_ACTIVITY=1, the A press scripted withXCL_PRESS_A_AT. Two runs; the second had a warm shader cache.What the budget did (run 1, from the
memory:andpage budget:lines):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:
main930e8b4+ this PR + the same PRs and local patches as above, withb8b1f49reverted 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.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.
EVICT_MIN_AGEarrive 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.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.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_lruwould) and release it; and give GPU-owned textures and ones underEVICT_MIN_TILEStiles 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).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
AI use
@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 onceby hand, then saved, so the later runs go from Player1 (one A) straight into the story load.
Test report: on a 6 GB card,
mainruns out of video memory in the story load every time; with thisPR and
XCL_PAGE_BUDGET_MB=3072it doesn't, and the title reaches the+0x23cf683stop instead.Tested
main930e8b4, andmain930e8b4+ this PR (5d6fac8) merged locally (cleanmerge), this PR alone: no other open PRs, no local changes.
cargo test --release -p xcl --libon the merge, RTX 3050:d3d12x::vram11 passed, 0 failed (bothpage_budget_*tests included),d3d12x::title_textures14 passed, 0 failed.main0x887a0007) duringCreatePlacedResourceX, then title assert0x80000003at+0x2474606XCL_ACTIVITY)main0x80000003at+0x193e00fwithrax=0x8007000e(#333)0xc0000005write at 0x0 at+0x23cf683(#846)+0x23cf683main: the target pages went from 4.86 GB to 7.22 GB between 166 s and 188 s, as the worldload started. Committed memory reached 23.8 GB (16 GB RAM + page file).
+0x23cf683stop at 290–306 s is the one 12–16 GB cards report in #846, so on this card the budgetturns 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 (
PAGEShas oneentry), so this is the "pools grow past the budget meanwhile" path in
take_tile. During the world loadalmost every texture is uploaded or transitioned within
EVICT_MIN_AGE(5 s), so rounds find nothing toevict 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
XCL_PSO_WAIT_MS.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.
@dnzarc on GitHub · 2026-11-24 16:42 UTC · original
6 GB card (RTX 4050 Laptop): this PR takes the title from a
CreateHeapfailure to the prologue — the first world frames on this machineSetup
5d6fac8exactly (git fetch origin pull/640/head), releasecargo build --release -p xcl, DXC 1.9.2602.17, system XGameRuntime, Series X profile, 1280x720 window.XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=25, 300 s limit.Before (main
930e8b4, same settings)With this PR,
XCL_PAGE_BUDGET_MB=3072CreateHeapfailure, no device removal, no guest exception in the full 300 s.page budget: 8,461 textures evicted, 63 mapped againmemory: 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)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 aCreateHeapfailure 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.
@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;
main930e8b4+ this PR5d6fac8+ #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=6144XCL_PAGE_BUDGET_MB=0+0x23cf683at 146.9 sThe reading (inference, from the code):
revive_listedandrefresh_oncemap 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 itstouchedtime 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.
@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_OUTOFMEMORYstop of #333 is gone withXCL_PAGE_BUDGET_MB=6144.Tree:
cf90938(local, no uncommitted changes) =mainb7aa9f3+ revert ofb8b1f49(#1307) + #1316 (ee904f1, with #1315) + #1288 (9cdae10) + this PR (5d6fac8). All merged cleanly.Hardware / software
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_DXC_THREADS=6Tests:
cargo test --workspace -- --test-threads=4oncf90938: 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'smemory:lines:CreateHeap(0x4000000 bytes, type 1)refused with0x8007000e(8 times), thenCreatePlacedResourceXrefused0x80000003atgame_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:CreateHeaprefusals#101atXCL_PSO_WAIT_MS=2000)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
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.
@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 base47efa2e. That base is beforeb8b1f49: on today'smainthe #1307 commit growth ends every run within a minute.+0x23cf683, 724.9 s (frames presented up to about 490 s)+0x23cf683, 333.7 s0x887a0006) at 304.7 s, then the title's0x80000003at+0x2474606, as in the first roundcargo test --workspace --no-fail-fast -- --test-threads=4on5d6fac8(debug): 744 passed, 0 failed, 41 ignored; SKIPPED (no wave64): the two usual ones.mainor of the earlier head on this card. The device removal still happened once in three, with the same signature as with808a8a4.808a8a4they were up to 0.7 GB above.The first round, on
808a8a4, follows unchanged.Test of the then-current head
808a8a4merged ontomain67a3735(clean merge, local tree2b51eef) on an 8 GB card, withXCL_PSO_WAIT_MS=50(#891) andXCL_PAGE_BUDGET_MB=3072, compared withmainand the same wait budget.Setup
cargo test --workspace --no-fail-fast -- --test-threads=4on2b51eef(debug): 737 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.XCL_NETWORK=0 XCL_ACTIVITY=1, menus walked withXCL_PRESS_A_AT=14,17,21,125,131,…,197(as in #505); driver-blob cache warm.Runs
main+0x23cf683, 369.7 smain+0x23cf683, 346.9 smain+0x23cf683, 395.9 s0x887a0006), 294.2 s, then the title's0x80000003at+0x2474606+0x2215c35), 373.9 sThe 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:
mainends 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 onmainin these runs, but three runs each can't tell this PR apart from chance.Not tested
AI use
@rrrarrra9 on GitHub · 2026-11-24 19:30 UTC · original
Tested
b7aa9f3+ DXGI budget logging + a cherry-pick of this PR). XCL_ACTIVITY=1 and XCL_PAGE_BUDGET_MB=2048.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.
@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 HEADb7aa9f3; note: #1017 was later closed as invalid)Environment:
--release -p xcl)XCL_PAGE_BUDGET_MB=4096,XCL_ACTIVITY=1,XCL_NETWORK=01. 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_itpage_budget_evicts_the_least_recently_touched_cpu_filled_texturepage_budget_one_placement_at_the_cap_evicts_one_batchcargo 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.When PR #640 is combined with PR #800 (which turns
pools: Vec<ID3D12Heap>intoVec<Option<ID3D12Heap>>with vacant slot recycling), PR #640's pool cap check must count active non-empty pools (self.pools.iter().flatten().count()) rather thanself.pools.len(). Otherwise, vacantNoneslots 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+)
XCL_PAGE_BUDGET_MB=4096, pool growth was initially bounded attarget pages 4179 MB (pools 4224 MB)with local VRAM stabilized at6912 MB(comfortably below our 8006 MB hardware limit).page budget: 184 textures evicted, 0 mapped again. ZeroCreateHeap refused (0x887A0005)occurrences.Phase 2: Edge Condition #1 — Visual Degradation on Static Screen Backgrounds (Root Cause Analysis)
set_evictable). Because a single 4K texture spans hundreds of 64 KiB tiles (far exceedingEVICT_MIN_TILES = 4), the greedy eviction algorithm prioritizes unmapping them first to fulfill theEVICT_BATCH = 512tile reclamation target.D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCEwithout further CPU write cycles or resource state transition barriers.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 againwas 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_IDLEevict_lru(EVICT_BATCH)returned 0,take_tileengagedevict_idle_until = Some(now + 1s). While idle, allocation requests bypassed the cap entirely, allocating new 64 MB heaps unconditionally.0x887A0006 (DXGI_ERROR_DEVICE_REMOVED)during background DXIL compilation of a 330 KB compute shader, followed by the title's internal breakpoint0x80000003at+0x2474606.3. Actionable Recommendations:
EVICT_IDLELeaks:live_pools()Count: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.
@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=3072the 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
main4178e88+ this PR's head5d6fac8, DXC 1.9.2602.17.Without the budget (same build, three runs):
sparse windows: no video memory for more tilesandno video memory for more pages of title textures(0x8007000e), then0x80000003at+0x193e00fwithrax = 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), no0x8007000eat all. The game reaches gameplay; at 63 s the device is removed with0x887a0005(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.
title_memory_budget_mbis 13,824 MB regardless of the adapter's memory #1337@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:
5d6fac8no longer applies to currentmain(#1747 reworked the tile pool invram.rs), so I rebased it locally onto80f4819. This is not your commit, so here is what I changed: the cap check moved fromtake_tileto the start ofPages::bind, before the missing tiles are counted (an eviction can free pages the texture being bound shares). At the budget it runs oneevict_lruround ofmax(EVICT_BATCH, tiles), then moves every cooling tile into the free lists beforetake_batch.evict_lrucountspool.free_total + pool.cooling.len(). Both of yourpage_budget_*tests pass on the rebase (the second one adapted to the new pool). BudgetXCL_PAGE_BUDGET_MB=4096. The same build also had local diagnostics (memory by kind, a commit guard), which are also in themainrun 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).main80f4819main), 554 in 180 s (#640).Not tested: your exact commit (only the rebase above), other budgets, #782 on top, NVIDIA, a full
cargo test --workspaceon this rebase (only thevram::andtitle_textures::tests; three of them also fail onmain+ my local commits on this GPU).Written with Claude Code from runs on this machine.
@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.
retail title
7952987A(not included here).origin/mainb7aa9f3+ #889 (e1d3b9d) + #1288 (95299f4) + this PR. A 300 s scripted walk (XCL_PRESS_ATgamepad presses) from a save past first-run setup,XCL_ACTIVITY=1 XCL_DXC_THREADS=4 XCL_NETWORK=0.page budget 4096 MB (64 pools of 64 MB)logged at 2.6 s, 5,743textures 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.
0x8007000e, no+0x23cf683. But the last present is at145 s in both, so missing or zero-sampled textures cannot be judged from these runs.
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.
Not tested
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.
@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
cbc296ab65a2661a61e3e2da109134bcd5319f60reached world loading. A 64 MiB D3D12 heap for title textures returned0x8007000E, 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.5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2awithXCL_PAGE_BUDGET_MB=3072and 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+0x23cf683watchdog.cbc296aband tested a learned 4,095 MiB coherent window withXCL_PSO_WAIT_MS=50. It got past the 40-bit BVH address error seen with the 512 MiB window. It ended with0x887a0005after 2,978 presents. The last counters showed 1,331 skipped draws and 3,469 skipped dispatches.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.
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.
@JJAutoCompare on GitHub · 2026-11-25 06:33 UTC · original
Empirical test report (
5d6fac8c)Hardware / environment
5d6fac8cb6c1ccddf95adc273862e5cb4be5ae2a. Windows 11 build 26200, AMD Ryzen 7 3800X, Intel Arc A770 (DXGI adapter 0, driver32.0.101.9175).1.100.0 (0ef1bc386 2026-11-09)forx86_64-pc-windows-msvc, DXC1.9.2609.5 (01b62ad47).Commands and results
cargo test --workspace --no-runoutside the Arc lock exited 0. The diff adds three D3D12 tests and no CPU-only tests.Invoke-ArcTest.ps1, withXCL_ADAPTER=A770andRUST_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 tersexcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_evicts_the_least_recently_touched_cpu_filled_texture --format tersexcl-77aca8ccb20e299f.exe --exact hle::d3d12x::vram::tests::page_budget_one_placement_at_the_cap_evicts_one_batch --format terse^SKIPPEDline. 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.
@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-runbuilt. The exact testhle::d3d12x::vram::tests::page_budget_does_not_reuse_tiles_before_a_queued_read_retiresran in four fresh processes with--exact --nocapture --test-threads=1, two per setting.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.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.
@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.@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 thefree/coolingvectors inPageswith a per-heapTilePool(take_batch,drain_cooling) and added reclaiming of empty pool heaps (PoolHeaps,XCL_VRAM_KEEP_SPARE_POOLS), sotake_tile's cap check andevict_lru'sfree.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) insubmitted,Pagesandevict_lru(evict_idle_untilvsevict_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
@anon31-006459 on GitHub · 2026-11-25 20:05 UTC · original
Test report for #640 on Linux / NVIDIA 8 GB: a rebase of
5d6fac8onto the per-heap tile pool (#1747), not your exact commit. WithXCL_PAGE_BUDGET_MB=3072the 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+0x23cf683null write that it also hits without the budget (#662 / #675).What was tested
5d6fac8no longer applies tomain(#1747 reworked the tile pool), so it was rebased locally onto00cf258, the same way as in the RX 6750 XT report: the cap check moved fromtake_tileto the start ofPages::bind, before the missing tiles are counted. At the cap, when the free tiles cannot cover the texture, oneevict_lruround ofmax(EVICT_BATCH, tiles)runs (skipped while cooling + free tiles suffice, and forEVICT_IDLEafter a round that found nothing), then every cooling tile goes to the free lists beforetake_batch.evict_lrucountspool.free_total + pool.cooling.len(). Thetitle_textures.rs,list_x.rs,real.rsandhost.rsparts are unchanged from5d6fac8.CopyFromSubresource7-argument fix (the idea of #684), and a sync diagnostic that was off.Setup
experimental-11.0-20261112, vkd3d-proton2576c0bwith its vtable checks patched to accept XCL's vtables (the #1701 problem), DXVK DXGI, DXC 1.9.2609.5.x86_64-pc-windows-gnu(mingw-w64), release.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).vkCreate*failure.0xc0000005ingame_scarlett_master.exe+0x23cf683(write at 0,rcx=0x70024c348) at ~284 s; the title's crash log reportsGame Running, 4 min 12 s, frame 2,343, 34 peds.For comparison, not a clean A/B
+0x23cf683write. So the budget is not what changes the end here; it is what kept memory in bounds on an 8 GB card.Not tested
5d6fac8; Windows; AMD; other budgets; #782 on top.cargo testwas not run. The run above is the only check.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.
@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.
@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's5d6fac8merged locally with others on #2057's head, not this PR alone.console_heap::note_resourcealready keeps slot → resource forXCL_TRACE_FRAME. With a budget on, it also counts the view slots that name each texture (vram::viewed), andevict_lruskips a texture any slot names. The census in the log counts those textures apart.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.
github-bot referenced this pull request2026-11-26 05:54:50 +00:00
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.Merge
Merge the changes and update on Forgejo.