Repository navigation
Description
Placed textures superseded at the same address are never released by a retail title, about 140 per second in its world, and each one costs about 58 KB of commit and 28 KB of local video memory. Over 20 minutes the frame rate falls from 3 to 0.25 presents/s.
RTX 3060 12 GB (NVIDIA 621.14), i9-13900K, 64 GB, Windows 11 26200. Tree: main b49be18 + #2404 + #2590 + #2301 + #751, direct DXIL, XCL_DEVICE_TYPE=lockhart, recipe from #505. Numbers come from local counters (not for upstream) in vram.rs, real.rs (res_release), title_textures.rs and list_x.rs.
The growth. In a 30-minute run in the world, the frame rate fell over 5-minute windows after #101: 3.08, 2.40, 1.91, then 0.25 presents/s. XCL hung at about 1236 s. Between 362 s and 1202 s, the process commit went from 28.4 to 36.1 GB and local video memory from 13.6 to 16.7 GB, steadily, while target pages, the arenas and the sparse pools stayed flat.
Where it goes (16-minute run): vram::PLACED_TEXTURES keeps growing, while title_textures stays flat at about 22,000 entries.
- 172,086 placed textures were made, and only 7,914 got their final release.
- There were 138,126
unmap_supersededcalls, and 136,113 unmapped page targets are still alive. - in a 12-minute run,
remap_if_unmappedremapped an old texture 128 times, against 74,079 supersedes. - The tiles are unmapped. Each old texture is left as an empty reserved resource. Commit and video memory grow by about 58 KB and 28 KB per such resource.
Not a reference held by XCL. Classified by return address in res_release, over 8 minutes: 143,968 releases on placed textures, of which 1,533 come from the title, and 1,526 of these are final. The rest are XCL's own clones being dropped. So the title recreates textures over the same address without ever releasing the old object. On the console the object is probably cheap, perhaps living in title memory, so this is harmless there.
Does the title still use the old object? Over 8 minutes and 40,172 supersedes:
GetGPUVirtualAddressis called on an old object 326 times, all from the title;CreateShaderResourceViewon an old object: 2,176 calls, none from the title;ResourceBarriertransitions on an old object: 0.Map: 0.
What a fix could reuse:
- the new texture has the same PC resource desc as the old one at the same address in 17 % of supersedes;
- a superseded object with the same desc is free somewhere (a desc-indexed pool) in 51 % of creations.
A same-address, same-desc reuse is safe, since the title's GetGPUVirtualAddress gets the same address, but it only removes 17 % of the growth. A pool would remove about half, but the title still calls GetGPUVirtualAddress on old objects, and with a pool those would answer with an unrelated address. Releasing the old object at supersede is not possible either: the title holds the real ID3D12Resource, without a wrapper, and sometimes does release it. I have not found a clean fix. A wrapper for title placed textures looks like the real one.
Related: #1897, #2270 (timing of unmap_superseded, not this growth), #505.
AI use: Claude (claude-opus-5-5, through Hermes) wrote the counters, ran the runs over SSH, worked the numbers out with Thibaut's bot and wrote this.
Activity
Natakout commentedon Nov 26, 2026
Follow-up: the title's
GetGPUVirtualAddresson superseded objects comes long after the supersede, so a quarantine before pooling would not make a pool safe.One 8-minute run, 45,443 supersedes, 371
GetGPUVirtualAddresscalls from the title on objects already superseded. Delay from the supersede to each call:Most calls come more than 10 s after the supersede, so a quarantine of a few frames before an old object can be reused would not cover them. In the same run, a superseded object with the same PC desc was free for 41,687 of 76,519 creations (54 %), and the old entry at the same address had the same desc in 7,994 of 45,407 supersedes (18 %).
upipibi commentedon Nov 26, 2026
Not every superseded placed texture here is the title's. On main 8b957be,
resource_at(views by address, #70/#71) makes its texture withdevice_x::create_placed_resource_x(real.rs:2359), so it takes the sameplace_pages/title_textures::registersupersede path, and keeps it inMADE(real.rs:2367) holding the only reference, never released. That fits your 2,176CreateShaderResourceViewcalls on old objects with none from the title, and the 17 % same-desc twins (0x04..0x08 padding in its key, #2762). #2743 traced the same growth to it. Counting creations by caller (title vsresource_at) would show what is left for the title.AI-assisted (Claude Code, Claude Opus 5.5).
Natakout commentedon Nov 26, 2026
Correction to this issue: most of the leaked objects are not the title's. They are the resources
real::resource_atmakes for device #70 / #71 (CreateShaderResourceView/CreateUnorderedAccessViewof memory, with no resource object), which stay in its cache forever.I took the title's
CreatePlacedResourceXcalls apart from XCL's own (a local shell around the title's textures only):vram::PLACED_TEXTUREShad 46,761 entries, and there were 22,573 supersedes;resource_at. It keys itsMADEcache by (address, desc) and never removes anything from it, so every superseded one stays alive with the reference that cache holds. That is why "the title never releases them": the title never had them.Experiment: when
title_texturessupersedes a resource thatresource_atmade, take it out of the cache and release it, through the hookedReleasesolate_releaseholds it until the GPU is past it. Over one 8-minute run:PLACED_TEXTURESstays at about 26,000.So that removes the leak. But it is not safe as it is:
0x887a0006) a few minutes into the world in 2 runs out of 2. A control run of the same build without it ran 480 s clean. The views the title made earlier still point at the released resource;0xc0000005ingame_scarlett_master.exe+0x55ac280, read at0x9cdb10000. So releasing such a resource has other side effects on the title's pages, through the cleanup inres_release(vram::forget,title_textures::forget, …).A real fix probably belongs in
resource_at: reuse or evict its entries with the views that use them, rather than releasing behind them. Someone who knows how those views and the page sharing work should look at it.[-]D3D12.X: superseded placed textures stay alive (the title never releases them), memory grows ~8 MB/s in a retail world[/-][+]D3D12.X: resources made by resource_at for views of memory (#70/#71) stay cached forever when superseded, memory grows ~8 MB/s in a retail world[/+]akimfomin commentedon Nov 27, 2026
Your update narrows the ownership question: XCL resource_at creates wrappers for both descriptor-by-address paths. AnyXboxX found a separate but useful accounting control on its Vice-Tay base. #466 counts unique bytes even for objects that cannot be evicted, separately from which owners permit disposal. Its eligible-victim policy would not be safe to transplant to XCL's COM lifetimes.
A small public XCL check could repeatedly create SRVs/UAVs for one underlying range, count only registry-owned wrappers, and hold one external reference as its negative control. If you have a public candidate, give the PR and receiving SHA to your agent through PortBridge #98, or return the aggregate control in Test Lab. We can route the credited result back to the implementation owners. AI-assisted source comparison.
Natakout commentedon Nov 27, 2026
Duplicate of #2743, which found the same cause first. My numbers and a holder-aware eviction that ran 2 x 20 minutes clean are there now: #2743