You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Title textures: a PC copy per placement, never shared or let go – video memory grows past the card while a retail game streams its world (0x887a0007) #248
The retail title (retail, Series build) on maind4f17ca + a retry equivalent to #244, RX 7800 XT 16 GB, 31.6 GB RAM. After the menus and the first movie the game starts streaming its world. From then on video memory grows by ~0.35 GB/s until the driver resets the device:
D3D12 device removed: 0x887a0007 The GPU will not respond to more commands ...
at 106 s and 116 s in two runs; a third, ended at 100 s, had reached 23.8 GB. The menus were walked with XCL_PRESS_A_AT=14,17,21, no other input.
Measured
A local counter on the activity memory line (XCL_ACTIVITY=1): the textures title_textures keeps in step, the sum of their sizes, and the title memory they cover (overlapping ranges counted once):
time
textures kept
their bytes
title memory covered
overlapping an earlier one
released so far
video memory (local)
30 s
933
1.0 GB
0.8 GB
154
4
9.7 GB
60 s
21 885
3.5 GB
1.6 GB
7 513
11
13.5 GB
80 s
32 830
10.7 GB
3.9 GB
16 654
11
21.6 GB
90 s
35 553
12.7 GB
4.0 GB
18 940
11
23.8 GB
The target pages (3.2 GB), arenas and sparse pools stay flat over the same time; the growth is the kept textures.
Cause
The title streams by placing new textures in memory it used before (as the console allows: a placed resource over another's memory aliases it). Each CreatePlacedResourceX texture that is kept in step gets its own committed PC texture (device_x.rs, the title_textures::register arm), and the older ones at the same addresses stay – the title releases almost none of them (11 in 90 s). So video memory holds the sum of every texture ever placed (12.7 GB at 90 s) while the title only uses the 4.0 GB it covers.
Suggestion
Render targets already avoid this: since 38b05b7 they are reserved resources on 64 KiB pages of video memory, one per page of the title's address, shared by every target there (vram.rs, Pages). Kept-in-step textures on the same pages would cost the memory the title covers instead of the sum, and match the console: a texture placed over another one overwrites its memory. The upload path (title_textures::upload_all) would copy into the reserved texture as it does into the committed one.
I have not tried this; the numbers above are from a counting patch only (happy to share it).
Repro on main (9ab7d76, RTX 5070 Ti, driver 610.74). A new check in the test title places 16 RGBA8 2048×2048 textures (16 MiB each) one after another over the same 17 MiB of title memory with CreatePlacedResourceX, keeps the older objects, and reads each new one back. The contents are right every time, and local video memory (QueryVideoMemoryInfo) grows by 268,435,456 bytes = 16 × 16 MiB. By the rule in title_textures::refresh_once, each placement also uploads every older texture on the written pages again: 1 + 2 + … + 16 = 136 uploads (read from the code, not counted in the run).
XCL does not keep them alive.TEXTURES holds raw pointers, an upload holds a reference only while its batch runs, and real::res_release at refcount 0 calls vram::forget and title_textures::forget. In the same check the growth is back to 0 bytes once the 16 objects are released. So what grows in the retail game is textures the title has not released yet when it reuses their memory; on the console they cost nothing, because they alias.
Plan (about 300 lines in device_x.rs, vram.rs, title_textures.rs; the arenas of #225 are not touched):
A kept-in-step texture at a 64 KiB-aligned address is made as a reserved texture on the vram.rsPages tiles of its title pages (38b05b7), so textures over the same memory share video memory. The others (unaligned address, or a texture the tiled-resources tier cannot make) stay committed as today.
A new placement over an older kept texture's range, at another address or with another description, ends the uploads of the older one (an exact alias keeps them). That removes the repeated uploads, and shared tiles need it: the older texture's texels would be written over the newer one's.
The first version unmaps nothing early: pages go back when the objects are released, as for render targets.
Two questions:
@gw1337x: in your run, how many of the kept-in-step placements are at 64 KiB-aligned addresses, and what share of their bytes? (va & 0xFFFF over the CreatePlacedResourceX calls.) That decides whether step 1 covers the growth.
@ivall: Pages is your design. Do you want kept-in-step textures on it, or would you rather do this your own way? I will hold the PR if so.
Aligned share. In a run with your steps 1–2 applied locally (kept-in-step textures at 64 KiB-aligned addresses as reserved textures on Pages, older overlapped ones no longer uploaded), about 10 000 of the ~42 500 kept-in-step placements in the first ~110 s went on the pages – roughly a quarter by count. I did not measure the byte share. Most of the title's streamed textures are packed at 4 KiB, so steps 1–2 alone leave most of them committed. In that run video memory still reached 26.6 GB on a 16 GB card.
Step 3 is what keeps it flat here. A second local change on top:
the unaligned kept-in-step textures are reserved too, on tiles of their own (not shared);
a texture placed over an older kept one's range – the exact same range included – unmaps the older one's tiles (UpdateTileMappings with D3D12_TILE_RANGE_FLAG_NULL on the Pages queue, then the fence) and gives them back to the pools. The title keeps the object; it reads zeros from then on.
main9ab7d76 + #244, RX 7800 XT 16 GB, GTA VI, menus walked with XCL_PRESS_A_AT=14,17,21. Both runs were stopped by an external kill-switch at 28 GB of process commit:
kept-in-step bytes vs title memory they cover (end)
12.7 GB vs 4.0 GB (earlier run, 90 s)
5.8 GB vs 5.8 GB
superseded / tiles given back
–
38 180 textures / 17.7 GB
No device removal and no crash in the second run.
Not solved by this:
Process commit still rises (15 → 28 GB from 30 s to 126 s) while video memory stays near 13 GB. Something other than these textures is growing; I have not measured what.
Each unaligned texture takes at least one 64 KiB tile. The pages hold 9.5 GB for 5.8 GB of textures.
I did not check the picture during world loading: the frames there are a dark loading fade, so a wrongly superseded texture would not show yet. Superseding exact same-range placements (where your plan keeps the uploads) is the riskiest part.
The two commits are local (about 130 lines in vram.rs, title_textures.rs, device_x.rs). Happy to share the diff if it helps your PR.
Back non-GPU-owned placed textures (CreatePlacedResourceX) on vram::Pages reserved resources (sharing 64 KiB pages for every page boundary strictly inside [va, va + console_bytes) and sharing any extra/sub-page tiles by (va, tile) so repeated placements at the same address do not leak), falling back to committed resources when reserved creation is unsupported.
Synchronize title_textures::upload_all (and probe_gpu_content) against tile mappings via vram::before_execute on the upload queue, and retire superseded overlapping entries in title_textures so dead older placements do not re-upload over or corrupt shared VRAM tiles.
Add unit + real D3D12 GPU tests (RTX 3060 12 GB, including D3D12 debug-layer validation for mip chains / arrays / overlap / bounded VRAM) and open a draft PR since I do not have a retail title here for scripts/smoke.ps1.
Draft PR is up at #288 (876557cfce22). All 654 workspace tests pass on RTX 3060 12 GB, including a GPU test showing 512 unreleased 1 MiB placements over a 16 MiB window staying bounded at 16 MiB (+0 B after fill) with bit-exact readback across RGBA8/BC7 mips, cubemaps, 3D volumes, and 4 KiB-aligned neighbours.
@gw1337x — since I don't have a retail game folder here for scripts/smoke.ps1, if you have a chance to test #288 against your retail streaming repro, I'd love to see the XCL_ACTIVITY=1 VRAM curve and add the xcl-smoke blocks!
The three PRs for this, run against one check on one machine. Facts per PR, no preference; I stopped building my own when #269 opened.
What ran. Each head merged onto main9ab7d76 locally (no conflicts): #269 at 8111cf9, #288 at 876557c, #292 at bf8e16c (stacked on #269). Debug builds, MSVC toolchain, RTX 5070 Ti, driver 610.74, Ryzen 9 9950X, Windows 11 26200. The test title through xcl run, as e2e.rs runs it, with one more check in it (the one from my note above, grown): CreatePlacedResourceX of RGBA8 2048×2048 textures (16 MiB each) in XMemAlloc graphics memory, every texture read back through the GPU. The same test-title binary for all four.
the PR's own vram / title_textures tests on this GPU
–
12 passed, 0 failed
11 passed, 0 failed
14 passed, 0 failed (with its cache test in real.rs)
1. 16 textures placed in turn over 17 MiB, old objects kept, from a 64 KiB address: more local video memory
268 435 456
67 108 864 (one pool heap)
67 108 864
67 108 864
2. the same from 4 KiB past a 64 KiB address
268 435 456
268 435 456
0 (inside the pool heap of row 1)
268 435 456
3. each new texture read back
right
right
right
right
4. the older object at the same address read back after a newer placement (row 1 / row 2)
right / right
right / right
right / right
right / wrong
5. B placed over all but the first 1 MiB of A, one byte written in that first 1 MiB: B read back
right
wrong from row 0
right
right
6. a second object placed at a texture's address and released, then the memory rewritten: the first object read back
right
right
wrong
wrong
wall time of the whole test title
74 s, 75 s
76 s, 76 s
26 s, 27 s
23 s
Why the rows come out that way (from the diffs):
D3D12.X: title textures on shared 64 KiB pages of video memory – video memory stays at what the title covers (#248) #269 puts kept-in-step textures at 64 KiB-aligned addresses on pages of their own space, apart from render targets; unaligned ones stay committed (row 2). It has no rule for older textures: every texture with a written page is uploaded, oldest first. In row 5 only A has a written page, so A's upload lands on tiles B shares and B is not uploaded after it. The wall time is the same as main's because each write still uploads every older texture on its pages.
D3D12.X: back kept-in-step title textures by shared VRAM pages (#248) #288 puts kept-in-step textures on pages at any address: a page for each 64 KiB boundary inside the texture's range, the remaining tiles keyed by (address, tile), so placements at one address share them (row 2). Render targets use the same page map. A new placement, or a render target placed there, takes every older overlapping texture out of the kept set for good (two committed textures with exactly the same range excepted). That is row 5 right and row 6 wrong: the first object is not kept in step again after the second one is released.
The 4 KiB-packed textures (three quarters of the placements by gw1337x's count): committed in #269 and #292, on pages in #288. Row 2 is the only measurement of that here, with one texture size.
A fourth approach we tried locally, not a PR. 64 KiB-aligned textures on pages, and for older textures a count instead of removal: a texture is not uploaded while a later one on its pages lives, and is read from the memory again when that one is released. It is the only build here with rows 1, 5 and 6 all right (row 1: 67 108 864; row 2: 268 435 456, unaligned textures stay committed; 51 s and 52 s). About 80 lines; I can send it as a patch on top of whichever PR goes in.
Not tested
AMD, a retail title, the whole suite on any of the merges (the test title and each PR's own vram / title_textures tests only).
Mip chains, arrays and BC formats: the check uses one RGBA8 level.
Rows 4 to 6 are things the console allows a title to do; whether the retail title does them is not known to me.
Regression data point for #248 (RX 9070 16 GB, AMD Ryzen 7 7800X3D 8-Core Processor, 31.2 GB RAM, Windows 11). Written with Claude Code (Claude Sonnet 5.5); the runs and numbers are from my machine.
Setup: main9ab7d76, then main + #244 + #269 (8111cf9), then those + #292 (bf8e16c), each applied as plain diffs, same settings: XCL_NETWORK=0 XCL_DSTORAGE_BCPACK_FILL=1 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21, one run each. An external kill-switch stopped each run at 90-94% system RAM.
Process commit / local video memory from xcl's own memory lines, compared at the same line number (the lines carry no timestamps, so alignment is approximate):
Afterwards the title stopped submitting work (0 submits, 0 draws per activity line) with a dark screen; that is not memory and looks like the failed DirectStorage / BCPack loads.
Tests on main + #244 + #269 + #292 together: cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 658 passed, 0 failed, 40 ignored; no SKIPPED GPU tests.
Not tested: each PR alone; the xcl-smoke blocks (the stack is uncommitted, so no valid per-PR block); runs longer than the kill-switch allowed.
Thanks @Kalmarv for the side-by-side matrix and @gw1337x for the 4 KiB-packed retail data!
Updated #288 (ad799324d6e6) to address both findings:
Row 6 (reactivation on release): overlapped older textures are moved to a dormant shadowed map (still tracking transitions/states, never scanned by refresh_once) and promoted back to active (newest first) when a covering placement is released — keeping rows 1–5 + the ~3× upload speedup while fixing row 6.
4 KiB-packed < 64 KiB reclamation (for @gw1337x's retail churn without breaking exact aliases): when a texture is superseded by a different range ((ova, oend) != (va, end) — or a GPU-owned target), its tiles are unmapped (D3D12_TILE_RANGE_FLAG_NULL) and unshared extra_pages / tail pages go straight to cooling (and are transparently remapped via remap_if_unmapped if the newer placement is ever released). Exact same-range aliases stay mapped and share all tiles (row 4 stays right/right).
Verified locally on RTX 3060 12 GB (cargo test --workspace -- --test-threads=4: 654 passed, 0 failed, 40 ignored; release build clean), including GPU readback tests for rows 4, 5, 6, different-range unmap/remap, and immediate extra_pages reclamation.
Retail streaming runs of the three #248 PRs and main, on a 10 GB NVIDIA card. #288 asked for a retail VRAM curve; none of the PRs had a run on NVIDIA yet.
the retail title, Series 1.0.2.1. Warm caches: the coherent window was already learned (4.8 GB), and the DXIL and driver caches were filled by earlier runs.
180 s runs: XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=180 XCL_PRESS_A_AT=30,40,50,60,70,80,95,110. With this timing, every run below started streaming the world at ~48 s. One more main run stayed in the menus (an earlier screen differed before the first press) and is left out.
VRAM is "video memory … local" from the activity line and commit is the process's commit, both in GiB.
main: local video memory goes past the card (19.8 GiB on 10 GB). Then CreatePlacedResourceX fails with 0x8007000e, texture uploads fail, and the title stops 1–10 s later, in both runs.
With any of the three PRs: no 0x8007000e in any run. Growth from 60 s to 120 s:
Video memory still grows while the world streams with all three.
4 of the 6 PR runs still end in an access violation (write) in the title, between 95 and 145 s, at four different addresses. None of them follows a failed allocation in the log.
So these endings don't look caused by the PRs or by VRAM running out, but two runs per head can't rule that out.
No device removal in any run.
No new warning kinds compared with main's runs. The only new lines are DirectStorage failures for other files, because these runs got further into streaming. The refused BCPack counts depend on how far streaming got.
Correctness not checked: the frames during loading are a dark loading fade, and I can't look at them. Wrong or zeroed textures from shared or retired pages would not show up in any of these counters.
Smoke, 60 s, no input (scripts/smoke.ps1; its gpu: line comes from #281, since without it the script names this machine's iGPU)
A baseline on current main (after #244 / #252 / #283), RDNA4, for the next round of these PRs: all three (#269, #288, #292) conflict with main since #252 / #283 went in.
Setup:maindb1ddb2, release; RX 9060 XT 16 GB (driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM (commit limit 38 GB), Windows 11 Pro 26300. Same title, warm caches, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=60, A pressed by hand on the first menu. A kill-switch stops the run when the xcl processes' private bytes pass 28 GB.
What it reaches: the intro movie plays with its picture (3.7–5.6 fps on this card while it plays), then the loading screen with its artwork. No crash, no device removal before the kill-switch.
While the world streams in (from the XCL_ACTIVITY memory line; process commit / local video memory):
time
commit
local VRAM
190 s (loading screen up)
16.4 GB
7.1 GB
200 s
18.7 GB
8.3 GB
210 s
22.2 GB
10.1 GB
220 s
25.9 GB
11.9 GB
230 s
28.5 GB
13.4 GB
Stopped at 232 s (28.3 GB). So on main it still grows by ~1.6 GB of video memory and ~3.2 GB of commit per 10 s, as in the 9ab7d76 runs above.
Not done: the PR heads (they need a rebase first); past 232 s.
AI-assisted: Claude Code (Claude Opus 5.5) read the run's log and wrote this comment from my run.
A data point from Linux / Wine, RTX 5060 8 GB (NVIDIA 595.112.07, 31 GB RAM), maina6f5f7a + #494/#495/#496, Series X profile, XCL_ACTIVITY=1, A pressed at the account prompt. On this card the growth ends the run, so it is the stop here.
From the memory: line while the title streams its world (Wine reports 0 for the process commit):
time
local VRAM
non-local
target pages (pools)
sparse pools (mapped)
93 s
6 418 MB
5 272 MB
4 536 (4 608) MB
1 152 (1 119) MB
109 s
6 450 MB
7 955 MB
6 492 (6 656) MB
1 792 (1 738) MB
125 s
6 450 MB
9 939 MB
8 441 (8 640) MB
1 792 (1 764) MB
155 s
6 450 MB
11 171 MB
9 526 (9 664) MB
1 984 (1 926) MB
Almost all of the growth is target pages: +5 GB in 60 s. They never come down within the run. Arenas stay at 264 / 304 MB, and the sparse pools grow far less.
Local video memory caps at ~6.45 GB. Everything after that goes to non-local (system) memory, until the system's free memory drops from ~14 GB to < 0.5 GB in about 30 s.
I'm looking at why target pages aren't given back (where GPU-owned targets placed over the same title memory again get new pages). I'll post here if I find something concrete.
Retail streaming on a 12 GB AMD card: frames stop once local video memory passes the card's size, with or without #490 / #435 / #501 / #522 / #483
A data point for #248 on current main, where the memory growth while the world streams is still there. The PRs that speed up the streaming path move the stall earlier or later, but in every run it begins when local video memory reaches the card's 12 GB.
With device_type = "lockhart" (A's build, console_type_raw left at 6), the title stayed on a black screen at a steady 30 fps for over 3 minutes, at 19.3 GB commit / 7.5 GB local video memory, with no DirectStorage traffic. It started loading again after an A press, and 8 s later stopped on 0x80000003 at +0xb18de7. I don't know whether that comes from the Series S memory budget or from the mismatch with console_type_raw.
BCPack requests are refused throughout (BC1 up to ~2,000 in a run, BC5, BC6H, BC7), as on main.
I can rerun any of these with other settings or diagnostics.
AI use: Claude Code (Claude Opus 5.5) ran the builds and the runs and drafted this comment; the numbers come from the logs of these runs on my machine.
Follow-up to my numbers above, same setup (Linux/Wine, RTX 5060 8 GB), main7ebf1b8 + #454 + #494–#496. These are experiments, not PRs.
Where the targets come from: a counter on the XCL_ACTIVITY line shows 62 000 live targets at 170 s, growing ~300/s, none released. Most are made by real::resource_at: the console's views of memory (#70/#71) have no object, so XCL makes a placed resource per (va, desc) and keeps it in MADE for good. Each one holds its pages.
Two things I tried:
Give a target's tiles back when the title unmaps all the physical pages under it (hooked into kernelx::unmap_away, remapped on the next map there). Correct, but it barely matters: 422 targets in a whole run. The title rarely unmaps under its targets.
An opt-in budget for view-made targets (XCL_TARGET_PAGES_MB). Past it, the oldest view-made targets have their tiles unmapped (TILE_RANGE_FLAG_NULL, after a GPU wait on the title queues) but keep their object, so a stale descriptor reads zeros instead of faulting. ~40 000 were given back, with no GPU faults. Target pages still reached 5.2–5.6 GB with a budget of 3 GB or 1.5 GB. What's left is mostly the title's own placed resources (CreatePlacedResourceX), which it also never releases while streaming.
So on an 8 GB card the total is still too much: local VRAM full at ~6.6 GB, 7–8 GB non-local, plus the title's memory. System RAM runs out at ~135–150 s, and the run ends with a write fault in memcpy into a title page whose commit failed.
My reading: a bound has to cover the title's placed targets too. One way is to unmap tiles of targets not used recently (by last bind / last time a descriptor naming them was copied) rather than by creation order. Happy to test anyone's approach on this card; the experiment's diff is available if useful.
Additional data point on 9ce2070, RTX 3060 Ti 8 GB, GTA VI Xbox Series package 1.0.2.1. With XCL_TEXTURE_SKIP_UNCHANGED=0, XCL presented 3,600 frames before the window froze. At 162.5 s, D3D12 reported 0x887A0007 (DEVICE_RESET). The run recorded 414 rejected BCPack requests. I did not measure VRAM growth during this run, so I can confirm the reset code but not its cause. With the default texture setting, a separate run ended in a read access violation during texture refresh after 3,000 frames. Is there a specific fix after 9ce2070 worth testing for this case?
Activity
Kalmarv commentedon Nov 23, 2026
A synthetic repro and a plan, before I write it.
Repro on main (9ab7d76, RTX 5070 Ti, driver 610.74). A new check in the test title places 16 RGBA8 2048×2048 textures (16 MiB each) one after another over the same 17 MiB of title memory with CreatePlacedResourceX, keeps the older objects, and reads each new one back. The contents are right every time, and local video memory (
QueryVideoMemoryInfo) grows by 268,435,456 bytes = 16 × 16 MiB. By the rule intitle_textures::refresh_once, each placement also uploads every older texture on the written pages again: 1 + 2 + … + 16 = 136 uploads (read from the code, not counted in the run).XCL does not keep them alive.
TEXTURESholds raw pointers, an upload holds a reference only while its batch runs, andreal::res_releaseat refcount 0 callsvram::forgetandtitle_textures::forget. In the same check the growth is back to 0 bytes once the 16 objects are released. So what grows in the retail game is textures the title has not released yet when it reuses their memory; on the console they cost nothing, because they alias.Plan (about 300 lines in
device_x.rs,vram.rs,title_textures.rs; the arenas of #225 are not touched):vram.rsPagestiles of its title pages (38b05b7), so textures over the same memory share video memory. The others (unaligned address, or a texture the tiled-resources tier cannot make) stay committed as today.Two questions:
va & 0xFFFFover the CreatePlacedResourceX calls.) That decides whether step 1 covers the growth.Pagesis your design. Do you want kept-in-step textures on it, or would you rather do this your own way? I will hold the PR if so.🤖 Claude Fable 5.2
gw1337x commentedon Nov 23, 2026
@Kalmarv thanks – the repro matches what we see.
Aligned share. In a run with your steps 1–2 applied locally (kept-in-step textures at 64 KiB-aligned addresses as reserved textures on
Pages, older overlapped ones no longer uploaded), about 10 000 of the ~42 500 kept-in-step placements in the first ~110 s went on the pages – roughly a quarter by count. I did not measure the byte share. Most of the title's streamed textures are packed at 4 KiB, so steps 1–2 alone leave most of them committed. In that run video memory still reached 26.6 GB on a 16 GB card.Step 3 is what keeps it flat here. A second local change on top:
UpdateTileMappingswithD3D12_TILE_RANGE_FLAG_NULLon thePagesqueue, then the fence) and gives them back to the pools. The title keeps the object; it reads zeros from then on.main9ab7d76 + #244, RX 7800 XT 16 GB, GTA VI, menus walked withXCL_PRESS_A_AT=14,17,21. Both runs were stopped by an external kill-switch at 28 GB of process commit:main+ #244No device removal and no crash in the second run.
Not solved by this:
The two commits are local (about 130 lines in
vram.rs,title_textures.rs,device_x.rs). Happy to share the diff if it helps your PR.iliassgm commentedon Nov 23, 2026
Taking a look at this. Plan:
CreatePlacedResourceX) onvram::Pagesreserved resources (sharing 64 KiB pages for every page boundary strictly inside[va, va + console_bytes)and sharing any extra/sub-page tiles by(va, tile)so repeated placements at the same address do not leak), falling back to committed resources when reserved creation is unsupported.title_textures::upload_all(andprobe_gpu_content) against tile mappings viavram::before_executeon the upload queue, and retire superseded overlapping entries intitle_texturesso dead older placements do not re-upload over or corrupt shared VRAM tiles.scripts/smoke.ps1.iliassgm commentedon Nov 23, 2026
Draft PR is up at #288 (
876557cfce22). All 654 workspace tests pass on RTX 3060 12 GB, including a GPU test showing 512 unreleased 1 MiB placements over a 16 MiB window staying bounded at 16 MiB (+0 Bafter fill) with bit-exact readback across RGBA8/BC7 mips, cubemaps, 3D volumes, and 4 KiB-aligned neighbours.@gw1337x — since I don't have a retail game folder here for
scripts/smoke.ps1, if you have a chance to test #288 against your retail streaming repro, I'd love to see theXCL_ACTIVITY=1VRAM curve and add thexcl-smokeblocks!D3D12.X: kept-in-step title textures on shared 64 KiB pages of video …
D3D12.X: retire overwritten title textures, evict MADE, and clean up (i…
Kalmarv commentedon Nov 23, 2026
The three PRs for this, run against one check on one machine. Facts per PR, no preference; I stopped building my own when #269 opened.
What ran. Each head merged onto
main9ab7d76 locally (no conflicts): #269 at 8111cf9, #288 at 876557c, #292 at bf8e16c (stacked on #269). Debug builds, MSVC toolchain, RTX 5070 Ti, driver 610.74, Ryzen 9 9950X, Windows 11 26200. The test title throughxcl run, ase2e.rsruns it, with one more check in it (the one from my note above, grown): CreatePlacedResourceX of RGBA8 2048×2048 textures (16 MiB each) in XMemAlloc graphics memory, every texture read back through the GPU. The same test-title binary for all four.mainvram/title_texturestests on this GPUreal.rs)Why the rows come out that way (from the diffs):
main's because each write still uploads every older texture on its pages.XCL_ACTIVITYline. Its description says it was not built or run on Windows; here it builds, and its tests and the 50 checks pass.The 4 KiB-packed textures (three quarters of the placements by gw1337x's count): committed in #269 and #292, on pages in #288. Row 2 is the only measurement of that here, with one texture size.
A fourth approach we tried locally, not a PR. 64 KiB-aligned textures on pages, and for older textures a count instead of removal: a texture is not uploaded while a later one on its pages lives, and is read from the memory again when that one is released. It is the only build here with rows 1, 5 and 6 all right (row 1: 67 108 864; row 2: 268 435 456, unaligned textures stay committed; 51 s and 52 s). About 80 lines; I can send it as a patch on top of whichever PR goes in.
Not tested
vram/title_texturestests only).🤖 Claude Fable 5.2
ExMoha commentedon Nov 23, 2026
Regression data point for #248 (RX 9070 16 GB, AMD Ryzen 7 7800X3D 8-Core Processor, 31.2 GB RAM, Windows 11). Written with Claude Code (Claude Sonnet 5.5); the runs and numbers are from my machine.
Setup:
main9ab7d76, thenmain+ #244 + #269 (8111cf9), then those + #292 (bf8e16c), each applied as plain diffs, same settings:XCL_NETWORK=0 XCL_DSTORAGE_BCPACK_FILL=1 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21, one run each. An external kill-switch stopped each run at 90-94% system RAM.Process commit / local video memory from xcl's own memory lines, compared at the same line number (the lines carry no timestamps, so alignment is approximate):
0 submits, 0 drawsper activity line) with a dark screen; that is not memory and looks like the failed DirectStorage / BCPack loads.Tests on main + #244 + #269 + #292 together:
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 658 passed, 0 failed, 40 ignored; no SKIPPED GPU tests.Not tested: each PR alone; the
xcl-smokeblocks (the stack is uncommitted, so no valid per-PR block); runs longer than the kill-switch allowed.iliassgm commentedon Nov 23, 2026
Thanks @Kalmarv for the side-by-side matrix and @gw1337x for the 4 KiB-packed retail data!
Updated #288 (
ad799324d6e6) to address both findings:shadowedmap (still tracking transitions/states, never scanned byrefresh_once) and promoted back to active (newest first) when a covering placement is released — keeping rows 1–5 + the ~3× upload speedup while fixing row 6.< 64 KiBreclamation (for @gw1337x's retail churn without breaking exact aliases): when a texture is superseded by a different range ((ova, oend) != (va, end)— or a GPU-owned target), its tiles are unmapped (D3D12_TILE_RANGE_FLAG_NULL) and unsharedextra_pages/ tail pages go straight tocooling(and are transparently remapped viaremap_if_unmappedif the newer placement is ever released). Exact same-range aliases stay mapped and share all tiles (row 4 stays right/right).Verified locally on RTX 3060 12 GB (
cargo test --workspace -- --test-threads=4: 654 passed, 0 failed, 40 ignored; release build clean), including GPU readback tests for rows 4, 5, 6, different-range unmap/remap, and immediateextra_pagesreclamation.grahamster2 commentedon Nov 23, 2026
Retail streaming runs of the three #248 PRs and
main, on a 10 GB NVIDIA card. #288 asked for a retail VRAM curve; none of the PRs had a run on NVIDIA yet.Setup
main9ab7d76, D3D12.X: title textures on shared 64 KiB pages of video memory – video memory stays at what the title covers (#248) #2698111cf9, D3D12.X: back kept-in-step title textures by shared VRAM pages (#248) #288876557c, D3D12.X: scope resource_at by device and clean up on release (#248) #292bf8e16c(D3D12.X: scope resource_at by device and clean up on release (#248) #292 contains D3D12.X: title textures on shared 64 KiB pages of video memory – video memory stays at what the title covers (#248) #269's commit).XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=180 XCL_PRESS_A_AT=30,40,50,60,70,80,95,110. With this timing, every run below started streaming the world at ~48 s. One moremainrun stayed in the menus (an earlier screen differed before the first press) and is left out.Two runs per head
0x8007000e+0x13936, 128 s0x80000003at+0x193e00f(rax0x8007000e), 138 s+0x61bbd6, 120 s+0x35a47bc, 141 s+0x2926872, 145 s+0x13936, 95 s("–": the run had ended.)
What the numbers show
main: local video memory goes past the card (19.8 GiB on 10 GB). ThenCreatePlacedResourceXfails with0x8007000e, texture uploads fail, and the title stops 1–10 s later, in both runs.With any of the three PRs: no
0x8007000ein any run. Growth from 60 s to 120 s:main: 10.1–10.4 GiB.Video memory still grows while the world streams with all three.
4 of the 6 PR runs still end in an access violation (write) in the title, between 95 and 145 s, at four different addresses. None of them follows a failed allocation in the log.
+0x13936is also one of the twomainendings here, and with+0x35a47bcit is in MaurycyBartczak's earliermainruns (NVIDIA (RTX 5070): graphics pipelines never finish – nvgpucomp64 stalls on large translated shaders (+ 2 fixes: chad.dll XDsp, XMemMapPhysicalPagesScatter) #156).No device removal in any run.
No new warning kinds compared with
main's runs. The only new lines are DirectStorage failures for other files, because these runs got further into streaming. The refused BCPack counts depend on how far streaming got.Correctness not checked: the frames during loading are a dark loading fade, and I can't look at them. Wrong or zeroed textures from shared or retired pages would not show up in any of these counters.
Smoke, 60 s, no input (
scripts/smoke.ps1; itsgpu:line comes from #281, since without it the script names this machine's iGPU)main 9ab7d76
#269 8111cf9
#288 876557c
#292 bf8e16c
Claude Code (Claude Opus 5.5) ran the tests and wrote this report. Crash addresses and XCL's counters only; no game files attached.
emirduran707 commentedon Nov 23, 2026
A baseline on current
main(after #244 / #252 / #283), RDNA4, for the next round of these PRs: all three (#269, #288, #292) conflict withmainsince #252 / #283 went in.Setup:
maindb1ddb2, release; RX 9060 XT 16 GB (driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM (commit limit 38 GB), Windows 11 Pro 26300. Same title, warm caches,XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=60, A pressed by hand on the first menu. A kill-switch stops the run when the xcl processes' private bytes pass 28 GB.What it reaches: the intro movie plays with its picture (3.7–5.6 fps on this card while it plays), then the loading screen with its artwork. No crash, no device removal before the kill-switch.
While the world streams in (from the
XCL_ACTIVITYmemory line; process commit / local video memory):Stopped at 232 s (28.3 GB). So on
mainit still grows by ~1.6 GB of video memory and ~3.2 GB of commit per 10 s, as in the 9ab7d76 runs above.Not done: the PR heads (they need a rebase first); past 232 s.
AI-assisted: Claude Code (Claude Opus 5.5) read the run's log and wrote this comment from my run.
notdxbi commentedon Nov 24, 2026
A data point from Linux / Wine, RTX 5060 8 GB (NVIDIA 595.112.07, 31 GB RAM),
maina6f5f7a+ #494/#495/#496, Series X profile,XCL_ACTIVITY=1, A pressed at the account prompt. On this card the growth ends the run, so it is the stop here.From the
memory:line while the title streams its world (Wine reports 0 for the process commit):NV_ERR_NO_MEMORYfor system memory. The run ends inmsvcrtmemcpy fromread_committed(write fault), which looks like what D3D12.X: read_committed survives concurrent decommit and unmap #454 handles.I'm looking at why target pages aren't given back (where GPU-owned targets placed over the same title memory again get new pages). I'll post here if I find something concrete.
MicaelHernandes commentedon Nov 24, 2026
Retail streaming on a 12 GB AMD card: frames stop once local video memory passes the card's size, with or without #490 / #435 / #501 / #522 / #483
A data point for #248 on current
main, where the memory growth while the world streams is still there. The PRs that speed up the streaming path move the stall earlier or later, but in every run it begins when local video memory reaches the card's 12 GB.Setup
device_type = "anaconda",XCL_ACTIVITY=1 XCL_TRACE_FAULTS=1, one A press on the first menu, runs up to 320 s.main7ebf1b8+ D3D12.X: faster title texture uploads (reused upload memory, faster detiling) #4511f282c7main508a0c7+ D3D12.X: faster title texture uploads (reused upload memory, faster detiling) #4511f282c7+ D3D12.X: a placement on title pages sweeps the idle ones, not every page #4907695539+ Textures: a layout's high-coordinate tables hold one period, not 65536 entries #435a94e151c73b0c8+ UMA: used and sparse_used are running totals, alloc_in searches its window only #522638c039+ Memory: bound sparse UMA first-fit searches by address #4833462d40All merges were clean.
Frames and memory (cumulative presents from the activity lines; process commit / local video memory from the memory lines)
+0x23cf683, with+0x4e4ba89,+0x2215c35and+0x2215ecaon the stack.used()totals (UMA: used and sparse_used are running totals, alloc_in searches its window only #522), the bounded search (Memory: bound sparse UMA first-fit searches by address #483) and the sparse-window write check (Memory: writes into a sparse window are checked without VirtualQuery #501) all in, it stalls at the same video memory and the same time as B.Also seen
device_type = "lockhart"(A's build,console_type_rawleft at 6), the title stayed on a black screen at a steady 30 fps for over 3 minutes, at 19.3 GB commit / 7.5 GB local video memory, with no DirectStorage traffic. It started loading again after an A press, and 8 s later stopped on0x80000003at+0xb18de7. I don't know whether that comes from the Series S memory budget or from the mismatch withconsole_type_raw.main.I can rerun any of these with other settings or diagnostics.
AI use: Claude Code (Claude Opus 5.5) ran the builds and the runs and drafted this comment; the numbers come from the logs of these runs on my machine.
notdxbi commentedon Nov 24, 2026
Follow-up to my numbers above, same setup (Linux/Wine, RTX 5060 8 GB),
main7ebf1b8+ #454 + #494–#496. These are experiments, not PRs.Where the targets come from: a counter on the
XCL_ACTIVITYline shows 62 000 live targets at 170 s, growing ~300/s, none released. Most are made byreal::resource_at: the console's views of memory (#70/#71) have no object, so XCL makes a placed resource per (va, desc) and keeps it inMADEfor good. Each one holds its pages.Two things I tried:
kernelx::unmap_away, remapped on the next map there). Correct, but it barely matters: 422 targets in a whole run. The title rarely unmaps under its targets.XCL_TARGET_PAGES_MB). Past it, the oldest view-made targets have their tiles unmapped (TILE_RANGE_FLAG_NULL, after a GPU wait on the title queues) but keep their object, so a stale descriptor reads zeros instead of faulting. ~40 000 were given back, with no GPU faults. Target pages still reached 5.2–5.6 GB with a budget of 3 GB or 1.5 GB. What's left is mostly the title's own placed resources (CreatePlacedResourceX), which it also never releases while streaming.So on an 8 GB card the total is still too much: local VRAM full at ~6.6 GB, 7–8 GB non-local, plus the title's memory. System RAM runs out at ~135–150 s, and the run ends with a write fault in
memcpyinto a title page whose commit failed.My reading: a bound has to cover the title's placed targets too. One way is to unmap tiles of targets not used recently (by last bind / last time a descriptor naming them was copied) rather than by creation order. Happy to test anyone's approach on this card; the experiment's diff is available if useful.
Merge ivall/xcl main (9ce2070) into gexcl
RD-sample commentedon Nov 24, 2026
Additional data point on 9ce2070, RTX 3060 Ti 8 GB, GTA VI Xbox Series package 1.0.2.1. With XCL_TEXTURE_SKIP_UNCHANGED=0, XCL presented 3,600 frames before the window froze. At 162.5 s, D3D12 reported 0x887A0007 (DEVICE_RESET). The run recorded 414 rejected BCPack requests. I did not measure VRAM growth during this run, so I can confirm the reset code but not its cause. With the default texture setting, a separate run ended in a read access violation during texture refresh after 3,000 frames. Is there a specific fix after 9ce2070 worth testing for this case?
D3D12.X: scope resource_at by device and clean up on release
Merge upstream main (2997c9a)
D3D12.X: write-watch only over committed sparse runs, kept up to date…