D3D12.X: bound target-page pools by title and adapter VRAM budgets #2347
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2357"
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?
Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-25T16:29:46Z.
Bound
vram::Pages64 MiB pool-heap growth byConfig::title_memory_budget_mb()and DXGI local VRAM budget, and keep Tier-2 reserved resources alive with explicitD3D12_TILE_RANGE_FLAG_NULLpartial tile mappings when capped or out of VRAM instead of destroying them and failingCreatePlacedResourceXwith0x8007000E.Part of #1833
Part of #646
Part of #333
Part of #1337
Part of #1773
What is in it
crates/xcl/src/hle/d3d12x/vram.rs:compute_max_pools/target_pages_max_pools: cap 64 MiBPoolHeapsatmin(title_memory_budget_mb(), 75% of DXGI local VRAM budget)on discrete GPUs (5,056 MiB/ 79 pools on 8 GB GPUs;4,096 MiB/ 64 pools on#646Run 2), usetitle_memory_budget_mb()onUMAadapters so small BIOS carve-outs are ignored, and supportXCL_TARGET_PAGES_MB(0= uncapped).alloc_budgeted_pool&RetireQueuepool accounting (RetiringBatch::pool_heaps,pending_pools,counted_pools,reserve_pending_pools,note_queued_pools,reap_completed,poll_retiring_pool_heaps,page_bytes): count both pending-handoff (before_executewhilePAGES.lock()is still held) and fence-retiring 64 MiB pool heaps separately from variable-sizedArenasheaps sharingRetireQueue(active + pending + retiring < max_pools), and poll/reap fence-completed retirements before refusing pool allocation at cap.TileShape::from_tiling,packed_and_standard_layout,TilePool::take_up_to,Pages::bind_tiles,Pages::rebind,backfill_incomplete_state,available_tiles, &map_levels: reuse 100% of already-resident shared pages at cap, partition per-sliceD3D12_PACKED_MIP_INFO(StartTileIndexInOverallResource+NumTilesForPackedMipsper array slice, plus single shared tails) into atomic packed groups kept whole (never partially mapped, returning any unusedfreshtiles toTilePool), prioritize coarsest standard mips round-robin across slices, resolvedesc.MipLevels == 0, and report unmapped lazy-level groups + minimum fresh tiles needed to advance.TileRange::Null,heap_ranges&Pages::map: explicitly bind unbacked (None) tile spans withD3D12_TILE_RANGE_FLAG_NULLon the first heap pass (preserving trailingNullspans) and emit apHeap = NoneD3D12_TILE_RANGE_FLAG_NULLmapping +pages.fenceSignalwhen0tiles are backed, ensuringvkd3d-protonemitsVK_NULL_HANDLEsparse binds instead of leaving newly created reserved tiles uninitialized on Linux/NVIDIA copy queues.crates/xcl/src/hle/d3d12x/title_textures.rs:Incomplete(Eager/Lazy),refresh_once,upload_all, &map_levels_with_texels: track active incomplete eager andXCL_TEXTURE_LEVEL_PAGES=1lazy-level textures so normalrefresh/upload_allretries missing tiles or pending level groups oncevram::available_tilesmeetsmin_tiles(without spinning while capped, and self-pruning onnote_gpu_write, shadowing,retire_overlapping, andforget), and clearLAST_CONTENTwhenever new tiles/levels map sosame_as_last_uploadnever swallows identical-byte retries.vram::testsandtitle_textures::tests(target_pages_budget_respects_env_title_memory_uma_and_adapter_vram,budgeted_bind_shares_pages_retains_cubemap_coarse_mips_and_recovers_after_free,retire_queue_pool_cap_counts_retiring_pools_ignores_arenas_and_polls_completion,reclaimed_pool_still_counts_before_retirement_is_queued,capped_pages_keep_over_budget_placements_alive,capped_eager_placed_texture_recovers_on_upload_after_capacity_frees,capped_lazy_level_texture_retries_same_bytes_after_capacity_frees, and extendedtile_ranges_per_heap).The diff adds 743 net non-test runtime lines (
602invram.rs,141intitle_textures.rs) alongside ~920 lines of pure-CPU and D3D12 GPU upload/readback/concurrency regression tests requested during review; the budget formula,FLAG_NULLsparse binding, atomic per-slice packed groups, pending + retiring pool-cap accounting, and active eager/lazy recovery stay in one commit because cappingPageswithout those invariants leaves incomplete or partially packed textures unrecoverable.Tested
af3ebe93cf6df094dc359439f02d377f3196484d(onorigin/main8b957bec) on Linuxx86_64withcargo check --offline --target x86_64-pc-windows-gnu --workspace --tests(0errors,0warnings invram.rsortitle_textures.rs; only8b957bec's 2 pre-existingfetch_updatedeprecation warnings), and ran the 14 pure-CPUvram::testsnatively viarustc --edition 2021 --test(14 passed; 0 failed: budget matrix,FLAG_NULLtile ranges, 6-face per-slice packed mips3, 7, 11, 15, 19, 23, 2-tile atomic packed group under 1-tile budget,SINGLE_MIPTAIL_BIT, partial/0-tile backfill, andRetireQueuepending + retiring pool-cap vsArenasaccounting).55ab6ba0(@thehollowedone, #2357 (comment)): NVIDIA GeForce RTX 3080 Ti (driver621.35), Ryzen 7 9800X3D, Windows 1126300,rustc 1.99.1MSVC, DXC1.8.2502.11—reclaimed_pool_still_counts_before_retirement_is_queued(1/1),capped_pages_keep_over_budget_placements_alive(1/1), andcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4(1,439 passed,1pre-existing8b957becmesh-cache failure,47 ignored).889008fd:@Haxodius(#2357 (comment)): AMD Radeon RX 6700 XT 12 GB —1283 passed,1pre-existing fuzz seed,46 ignored, plus 60 s smoke pair below.889008fd: RTX 3080 10 GB world-load0/6->6/6surviving (@Berserker64), RTX 3060 12 GB-1.46 GBlocal VRAM (@jennydeth, plus298.9 satXCL_TARGET_PAGES_MB=4096vs4/4losses without#2357,@Anon64), RX 6600 XT 8 GB capped at5,056 MiB/ 79 pools (@SlopTart), RX 9070 XT 16 GB Linux/RADV 25 min crash-free (@DavidM1911).Regression run
main:
PR (v1
889008fd— rerun pending foraf3ebe93):Not tested
cargo test --workspace -- --test-threads=4, including the newcapped_eager_placed_texture_recovers_on_upload_after_capacity_freesandcapped_lazy_level_texture_retries_same_bytes_after_capacity_freesGPU readback tests) and a fresh 60 sscripts/smoke.ps1retail pair onaf3ebe93(authored on Linux without a Windows GPU host).vkd3d-protonon NVIDIA (lockhart/ 8 GB cap) onaf3ebe93to confirm explicitD3D12_TILE_RANGE_FLAG_NULLbinding +#2275multi-queue retirement resolve theXid 31copy-engine fault reported on889008fd+68a284a.Pagesallocations (sparse heaps, coherent window, PSOs) consume ~5 GB, the default 75% adapter cap (~8.3 GiB) prevents unbounded growth (#646) whileXCL_TARGET_PAGES_MB=4096(ortitle_memory_mb = 4096) boundsPagesmore tightly;XCL_TARGET_PAGES_MB=0restores uncapped behavior.AI use
vram.rsandtitle_textures.rsbudget,FLAG_NULLsparse init, per-slice atomic packed groups, pending + retiring pool-cap accounting, active eager + lazy-level recovery, unit/GPU tests, and adversarial review fixes.pending_poolslock-handoff catch and test contributed by@thehollowedoneusing Codex (GPT-6.2 Sol / Astra); Windows v1 GPU test and smoke runs reported by@Haxodiususing Claude Code (Claude Opus 5.5).Imported from ivall/xcl. Originally posted by Haxodius on 2026-11-25T17:14:13Z.
Windows / AMD RDNA2, 12 GB card + 16 GB RAM: exact head
889008f, suite + smoke pair + a cap-on / cap-off title A/B. No regression; on this machine host RAM runs out long before the target-page cap is reached, so the cap never engaged.Tested
889008fd342ac779a601d7f93c8a54430360b306and its basemain65fc114a140d9043f8e3d70ffb863f7987816d8f, each in a clean worktree.cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on889008f: 1283 passed, 1 failed, 46 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 540:res[833] = 0x7, CPU 0x6). It fails the same way on the base65fc114, so it is not this PR.--no-fail-fast,hle::d3d12x::list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_listalso failed once; alone it passed 3 / 3 on the head. Reads as the parallel flake of #1978.f16/f32cases oflower_dxil::tests(refused:V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32),pso_measurement_compiles_an_exact_synthetic_record(Developer Mode off),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).vram::testsall pass on this card, includingbudgeted_bind_shares_pages_retains_cubemap_coarse_mips_and_survives_cap,capped_pages_keep_over_budget_placements_aliveandtarget_pages_budget_respects_env_title_memory_uma_and_adapter_vram.anaconda, 13 824 MiB):pool budget 8576 MiB, 134 pools from 75% of DXGI local budget.Regression run
scripts/smoke.ps1, 60 s, default settings, same binaries. The first base run was on a cold shader cache (870 frames); this is the warm pair, base run again after it:main:
PR:
Title A/B on the head, cap on (default) vs
XCL_TARGET_PAGES_MB=0XCL_NETWORK=0 XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_PRELOAD=0 XCL_DXC_THREADS=4 XCL_SPLIT_MIDLIST_WAIT=0 XCL_TEXTURE_LEVEL_PAGES=1 XCL_ACTIVITY=1,XCL_PRESS_AT=16:A,XCL_PRESS_A_AT=20,24,…,80,90,100. A local watchdog stops the title when free physical RAM stays under 500 MB for 3 s (16 GB host).memory:line)level pagesat ~60 sNot tested
AI use
Imported from ivall/xcl. Originally posted by pane33 on 2026-11-25T17:22:03Z.
I tested
889008fd342ac779a601d7f93c8a54430360b306on Windows 11 with a native RTX 4060 (tiled resources Tier 4). The VRAM filter returned 21 passed, 0 failed, 1 ignored and no skips, including two local test-only probes. The probes used one- and two-heap caps.remap_if_unmappedreturnedtruefor the partial and empty resources, which remained at 2/4 and 0/4. Explicitly unmapping the empty resource let it remap to 4/4 and read back a fresh upload in full. The target startsmapped = trueatvram.rs:1338and remap returns early at:1398. Is incomplete eager backing expected to persist until explicit unmap or replacement?vram.rs:967the cap checks the active count. Is the intended bound active heap capacity, or should it also cover heaps held for retirement?No retail run. AI use — Codex added the two local test probes, ran the tests, analyzed the results, and assisted in drafting this report.
Imported from ivall/xcl. Originally posted by ozimchuk on 2026-11-25T17:57:11Z.
A test where the cap engages on the retail title: on NVIDIA under Linux, one of the two runs with this PR ended in a GPU page fault from the copy engine, and the other had fewer frames and about half the draws of the two runs without it.
Tested
694cc67); release build forx86_64-pc-windows-gnu.mainalone: this PR's889008fmerged without conflicts into my working tree (main68a284a+ other open PRs + local changes); the same tree without it as the comparison.XCL_DEVICE_TYPE=lockhart: title memory budget 8 192 MB, so the cap here is 8 192 MB),XCL_PSO_WAIT_MS=50, 300 s each, the same data folder, runs alternated (with, without, without, with).D3D12 device removed: 0x887a0005Run 4's kernel line:
NVRM: Xid (PCI:0000:01:00): 31, … MMU Fault: ENGINE CE7 HUBCLIENT_CE1 faulted @ 0x2_8fcec000. Fault is of type FAULT_PTE ACCESS_TYPE_VIRT_READ– a copy-engine read of an unmapped page. That fits tiles this PR leavesNULLat the cap being read by a copy; on this driver path a NULL tile does not seem to read as zero. It is one fault in two runs, so not proven.After the world load (runs 1–3): 1.45 presents/s, 234 draws/s with the cap; 1.65–1.73 presents/s, 561–574 draws/s without. Peak GPU memory 15.3 GB with the cap against 15.8 GB (full) without; system memory and swap about the same. The frames I dumped are loading screens in all four runs and look the same.
Not tested: Windows; Series X mode (there the cap would be ~12 GB here, above the ~10.5 GB the pools reach, so it would not engage); the test suite on this tree with the PR; whether the copy that faulted is an upload, a readback or a title copy.
AI-assisted. Claude Code, Claude Opus 5.5 made the runs and wrote this comment.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:28:48Z.
Diff review on
889008f(crates/xcl/src/hle/d3d12x/vram.rs): clean budget computation (compute_max_pools) and unit coverage (bind_tiles,capped_pages_keep_over_budget_placements_alive).Remaining before merge:
origin/main(currentlyDIRTY).@pane33's questions (mapped = truepreventingremap_if_unmappedon partially backed eager resources, and whether active-only vs retiring heap counts should bound the cap) and check@ozimchuk's Wine/NVIDIA CEXid 31fault report on NULL tiles under the cap.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:37:33Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by jennydeth on 2026-11-25T19:00:52Z.
NVIDIA RTX 3060 12 GB (the #646 card), retail title 1.0.2.1 into its story load: the cap holds – pools stop at 8 448 MB and target pages at 8 404 MB, against 9 984 / 9 644 MB on the base, and local video memory ends 1.46 GB lower. No
0x8007000E, no crash, no device removal. Neither arm reaches the world in 600 s: both stop presenting during the load and spend the rest of the run compiling pipelines, as onmainin #846. The lower peak commit (31.7 vs 34.8 GB) is not evidence for the cap: see below. One run per arm.Setup: NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2101 (wave32), Ryzen 5 5600X, 32 GB RAM, Windows 11 Pro 10.0.26300.9974, Rust 1.100.0, release builds, DXC 1.9.2609.5. Head
889008fagainst its base65fc114, both as they are. Default settings (noXCL_TARGET_PAGES_MB),XCL_NETWORK=0,XCL_FRAME_DUMP=300,scripts/smoke.ps1 -Seconds 600(frommain, the same script for both), profile already past the first-run flow, A presses on the schedule from my #846 comment. Base first, then head, back to back; driver-blob cache warm from earlier runs.Head's startup line:
textures in title memory: tiled resources on 64 KiB pages of video memory, one per page of the title's (pool budget 8448 MiB, 132 pools from 75% of DXGI local budget)– so the DXGI local budget here is ~11.3 GB.Regression run
Base
65fc114:Head
889008f:Head 108 % of base frames, 91 % of its peak commit.
65fc114889008ftarget-page pool cap reached0x8007000E/ out of memoryAS slot – refused/would close a GPU cycle/wanted at oncerequest failedwarnings)reclaimedlines in either log). Target pages fill the free tiles inside them up to 8 404 MB by 104.7 s and stay there; the base goes on to 9 644 MB in 9 984 MB of pools. Local video memory ends 1.46 GB lower (12.5 vs 14.0 GB), matching the 1.5 GB fewer pools, but that is still ~1.2 GB over the ~11.3 GB DXGI local budget the cap is computed from: ~4.1 GB of local video memory outside the pool heaps keeps it oversubscribed.vram.rs, a bind past the cap gets whatever free tiles remain – for mipmapped textures the coarsest mips of each slice first – and the rest stayNULL(reads zero, writes dropped). In the default mode they are not retried for that placement; onlyXCL_TEXTURE_LEVEL_PAGES=1retries level groups. The warning counts bind calls that came up short (new placements and re-binds of superseded textures) and logs at #1–4 and powers of two: it reached #8192 at 100.2 s and never #16384, so 8 192–16 383 such calls in the run; after 100.2 s the log can't say whether they continued. Whether that changes the picture I can't tell: neither arm shows the world.NULLtiles to a stall.Tested
Not tested
XCL_TARGET_PAGES_MBoverrides;XCL_TEXTURE_LEVEL_PAGES=1; the branch rebased onto currentmain; AMD.AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T19:06:01Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).suite: 145/3 = the three known baseline failures on this lane (
fuzz_validate_and_gpu_2seed 1003,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed). Targeted run of the four new tile-budget tests: 4 passed.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:23:05Z.
Review: COMMENTED
P2: VRAM cap accounting excludes fence-retiring heaps. The cap checks active pools.len() (vram.rs:967/bind allocation), but sweep_and_reclaim removes empty pools from active state before queuing their heaps in retiring until both fences complete. New allocations then see a free cap slot; repeated reclaim/allocate while fences lag can exceed the configured cap by all retired heaps. Count active plus retiring residency, or retain cap capacity until retirement completes, with a blocked-retire-fence test. P2: eager partial binds still set Target.mapped=true when cap pressure leaves some tiles NULL. remap_if_unmapped then returns immediately, so later freed tiles never fill those eager missing pages. Track missing tiles/retry them, or leave partial targets unmapped; add a recovery-after-budget-frees test.
Imported from ivall/xcl. Originally posted by Berserker64 on 2026-11-25T21:57:20Z.
RTX 3080 10 GB: with this PR the retail title no longer loses its device at world load. 6 of 6 runs reached 100 s against 0 of 6 without it.
Setup
65fc114+ #684. Head:889008f+ #684. #684 (e56dbc3) applied cleanly to both, so this PR is the only difference.xcl run,XCL_RUN_SECONDS=100 XCL_ACTIVITY=1 XCL_DRED=1 XCL_FRAME_DUMP=200 XCL_PRESS_A_AT=21,62,66,70,75,90,105,120,140,180,240. Base and head alternate run by run.Results
0x887a0007, 1 ×0x887a0006One longer run of head + #684 with no
XCL_RUN_SECONDS(stopped at 900 s): no removal and no crash in 15 minutes, local video memory steady at 10.8 GB. It presented for the first 78 s (loading art) and then waited on cold NVIDIA compute-pipeline compiles for the rest of the run (100 of 103 finished, up to 280 s each), so it did not reach the world.Without #684, head got past the removal but every run (7 of 7) then crashed at 74–80 s in
VCRUNTIME140.dll+0x122b3(memcpyfromgame_scarlett_master.exe+0x979f5b, a write into title memory), the crash in #646. The two base runs that weren't removed first crashed the same way. So on this card the two PRs go together.Why the removal is out of memory
The
0x887a0007removals on this card are the kernel refusing a submission: D3D12Core'sNDXGI::CDevice::RemoveDeviceis entered fromSubmitCommandCB(called fromlist_x::execute_with_waits_on), withD3DKMTGetDeviceStatereportingD3DKMT_DEVICEEXECUTION_ERROR_OUTOFMEMORY(5). D3D12Core reports state 5 as0x887a0007and writes no DRED data for it, which is why DRED was always empty. A read-only Frida probe saw state 5 in all 6 removals it caught, on an older tree (c4d37beplus open PRs); no runtime configuration change removed the device. There's no TDR event in the System log at these removals.Not tested
cargo test; other cards; AMD.AI use: Claude Code (Claude Opus 5.5) made the builds, ran the runs and the probe on the hardware above, and wrote this.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T08:53:10Z.
Tested on an RTX 3060 12 GB with 32 GB of RAM in a retail world load (the case "Not tested" asks for): the cap holds, but on a 12 GB card 75 % of the budget still leaves the process about 3 GB over it.
Setup: RTX 3060 12 GB, NVIDIA 581.80, i9-14900KF, 32 GB RAM, Windows 11 26200, release build. The PR's head
889008fmerged locally ontonvidia-devaf2cecc4, not ontomain. One conflict invram.rs: I keptnvidia-dev's comment onpoolsand the PR'smax_pools/oom_until, and left out the PR'sretire_fence, whichnvidia-devno longer has. So this is not the exact head. All runs:XCL_ADAPTER=3060 XCL_GFX_PSO_WAIT_MS=200 XCL_PREPARE=0 XCL_ACTIVITY=1, compute pipelines warmed first, one run each, same title and start.Video memory from the 2 s
memory:line (MB):over the budgetwarningsnvidia-devaf2cecc4pool budget 8448 MiB, 132 pools from 75% of DXGI local budgetXCL_TARGET_PAGES_MB=4096pool budget 4096 MiB, 64 pools from XCL_TARGET_PAGES_MBCreatePlacedResourceXkept succeeding (no0x8007000E, no device removal in any of the three).nvidia-devc044dc6before it) the same world load lost the device (0x887a0005) in 4 of 4 runs at 120–254 s with 14–17 GB local against a 10.9 GB budget (#2688).How far each got. None of the three lost the device; all ended on the title's own watchdog when its submits stopped while pipelines were still being built, which is not this PR's code. The first
XCL_TARGET_PAGES_MB=4096run stopped at 106 s on a compute pipeline the warm-up had missed. After warming it, a second 4096 run went on to 298.9 s, the longest of any run on this card, and played the cutscene. Its submits stopped at 270 s, while graphics pipelines for a part of the world no run had reached were waiting 24–109 s each at the compile gate.What the cap costs and what it does not cover, from that 298.9 s run:
NULLand read as 0, so part of that is this PR's cap; the rest is graphics pipelines not built yet (81,530 queued,XCL_GFX_PSO_WAIT_MS=200). I have not separated the two.Not tested: the PR's exact head or
main; how the textures look withNULLtiles at the cap (no screenshots taken); more than one run per row;XCL_TEXTURE_LEVEL_PAGES=1; the suite on this merge.AI use: Claude Code (Claude Opus 5.5) merged the branch locally, ran the runs on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T14:06:48Z.
Rebased onto
b49be183(#2275integrated) as one squashed commit (c6213b24), addressing all review and hardware test findings:Active + retiring 64 MiB pool-heap cap accounting (
@bmjaskP2 #1,@pane33):RetiringBatchnow trackspool_heaps: usizeandRetireQueuemaintainsretiring_pools: usize(note_queued_pools/reap_completed), keeping 64 MiBPagespool heaps separate from variable-sizedArenasheaps that shareRetireQueue(before_executepassesreclaimed_pools;placepasses0forArenas).alloc_budgeted_poolcallspoll_retiring_pool_heaps(dev_key)first to reap fence-completed batches (dropping finishedID3D12Heaps outsideRETIRE.lock()) and enforcespools.len().saturating_add(retiring) < max_pools.page_bytes()also includes retiring pool heaps.retire_queue_pool_cap_counts_retiring_pools_ignores_arenas_and_polls_completion(CPU) and a blocked-gate-fence phase incapped_pages_keep_over_budget_placements_alive(GPU).Incomplete eager target tracking & backfill (
@bmjaskP2 #2,@pane33) + packed mip tails:Target::is_complete()checksself.mapped && (self.levels.is_some() || self.used.len() + self.used_extra.len() >= self.total as usize)(Target.mappedstaystruesounmap_supersededandforget_pagesnever leakPage::usersrefcounts on partial binds).!complete,remap_if_unmappedrunsPages::rebind, which sweeps idle pages first, preserves already-held tiles in place (users == 1), backfills missing slots once budget frees, and re-emitsmaponly whenbacked > prev_backed.place_on_pagesalso readsD3D12_PACKED_MIP_INFOsobind_tilesbacks packed mip tails (NumTilesForPackedMips, e.g. 6-tail orSINGLE_MIPTAIL_BITcubemaps) before per-slice standard mips.budgeted_bind_shares_pages_retains_cubemap_coarse_mips_and_recovers_after_free(CPU) andcapped_pages_keep_over_budget_placements_alive(GPU).Linux / Wine +
vkd3d-protonNVIDIA copy-engineXid 31fault (@ozimchuk):vkd3d-proton(libs/vkd3d/resource.c,d3d12_device_requires_explicit_sparse_init == false),CreateReservedResourcedoes not emit an initialvkQueueBindSparse(..., memory = VK_NULL_HANDLE)over the resource's tiles;vkd3d-protononly bindsVK_NULL_HANDLEwhenUpdateTileMappingsexplicitly passesD3D12_TILE_RANGE_FLAG_NULL. In889008fd,Pages::mapreturned early on0-tile binds and usedFLAG_SKIP(plus trimmed trailingNonespans) on partial binds.Pages::mapandheap_ranges_trimmednow explicitly bind every unbacked span withD3D12_TILE_RANGE_FLAG_NULLon pass 0 (and issueUpdateTileMappings(..., pHeap = None, D3D12_TILE_RANGE_FLAG_NULL)+pages.fenceSignalon0-tile binds), alongside#2275multi-queue retirement across copy/upload queues (which68a284alacked when Run 4 reclaimed ~826 MB of pools).nvidia-devstruct conflict & 12 GB budget note (@Anon64):max_poolsandoom_untilbelowpool: TilePoolto avoid thePages::poolshunk conflict onnvidia-dev. On 12 GB cards where non-Pagesallocations take ~5 GB in heavy scenes,XCL_TARGET_PAGES_MB=4096(ortitle_memory_mb = 4096) tightens thePagescap whileXCL_TARGET_PAGES_MB=0leaves it uncapped.Huge thanks to
@Berserker64,@jennydeth,@Haxodius,@DavidM1911,@SlopTart,@pane33,@ozimchuk,@Anon64, and@raylitebullfor the testing and reviews! Sincec6213b24is a new head SHA (authored on Linux), a fresh Windowscargo test --workspace -- --test-threads=4+ 60 sscripts/smoke.ps1pair onc6213b24is needed to turnPR descriptiongreen.AI use: Antigravity (Gemini 4 Carbon)
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T14:18:58Z.
Windows/NVIDIA check of current head
c6213b24, based onb49be18:cargo build --offline --locked --workspacepassed;cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4passed with 1,439 passed, 0 failed, 47 ignored across 37 test targets. There were 25 GPUSKIPPEDnotices (21 wave64, 3 refused per-lane forms, 1 heap-window case); I do not count those as coverage. Hardware: Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, DXC 1.8.2502.11. This was a clean tracked tree at the exact head. I did not run the paired retail-title smoke, so this report does not establish merge readiness.One remaining cap-accounting interleaving in the new revision:
before_executeremoves empty pool heaps fromPages::poolsunderPAGES.lock(), then releases that lock beforeretire_heaps_and_sweep()records them inRetireQueue::retiring_pools. A concurrent placement can enteralloc_budgeted_poolduring that gap: the heap is in neither count, so it can allocate a replacement while the old heap is still live behind GPU fences. I traced this lock/order path in the source; I have not reproduced the scheduling window in a runtime test. A bounded fix is to reserve cap capacity for reclaimed pools before releasingPAGES.lock(), then transfer that reservation to the retirement batch (or release it if retirement is immediate). A concurrent reclaim/placement test with a blocked retirement fence would cover the gap.AI use: Codex (GPT-6.2 Sol) inspected the revision, ran the tests, and drafted this report; I checked the review point against the code.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T14:35:03Z.
Follow-up to my exact-head report: I reproduced the narrow cap handoff race on an RTX 3080 Ti using a gated GPU regression. The test pauses
before_executeafter it removes one empty 64 MiB heap fromPages::poolsand before it queues retirement. On unmodifiedc6213b24,alloc_budgeted_pooladmits a replacement during that pause: the test fails, 0 passed / 1 failed. With the candidate diff below, it passes, 1 passed / 0 failed. The test also asserts the old heap appears in the cap count during the handoff, so an unrelated allocation failure cannot make it pass.The candidate reserves reclaimed pool capacity while
PAGES.lock()is still held, then transfers that count toRetireQueue's fence-backed batch underRETIRE.lock(). It counts pending plus retiring heaps in allocation and memory accounting. The existingPAGES→RETIRElock order is preserved. The test uses a five-second rendezvous and restores per-device state; it skips when no GPU is available. This is an uncommitted suggestion against the exact head, with no retail-title smoke run. It does not establish merge readiness.Tested: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --offline --locked --workspacepassed. Focused command on stock and candidate:cargo test --offline --locked -p xcl --lib reclaimed_pool_still_counts_before_retirement_is_queued -- --nocapture --test-threads=1. Full candidate suite:cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4, 1,440 passed / 0 failed / 47 ignored across 37 targets, with 25 GPUSKIPPEDnotices (21 no wave64, 3 refused per-lane cases, 1 no heap windows); skips are not coverage.Not tested: paired retail-title smoke, AMD and Intel GPUs.
AI use: Codex (GPT-6.2 Sol) wrote and ran the regression and candidate; Codex (GPT-6.2 Astra) reviewed the lock and test-lifecycle paths. I checked each point against the code and test output.
Candidate diff against
c6213b24Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T15:46:36Z.
Great catch and clean GPU repro on that
before_execute→retire_heaps_and_sweephandoff window,@thehollowedone— thank you!Squashed into
55ab6ba0(onb49be183):before_executenow reserves reclaimed pool count viaRetireQueue::reserve_pending_poolsunderPAGES → RETIREbefore releasingPAGES.lock(), andretire_heaps_and_sweeptransferspending_poolsatomically underRETIRE.lock()(counted_pools = retiring_pools + pending_pools).reclaimed_pool_still_counts_before_retirement_is_queued(switching thespare > 2env-override guard fromskip_test(...)to plainreturnsoXCL_REQUIRE_GPUnever flags a non-standard skip reason perCONTRIBUTING.md, and dropping the now-unusedRetireQueue::retiring_poolsgetter for 0 compiler warnings) plus CPU assertions inretire_queue_pool_cap_counts_retiring_pools_ignores_arenas_and_polls_completion.Waiting on a 60 s
scripts/smoke.ps1pair on55ab6ba0to turnPR descriptiongreen.AI use: Antigravity (Gemini 4 Carbon)
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T16:34:32Z.
Review of current head 55ab6ba0. I checked these source paths against the current diff; these are review findings, not title-run results.
Packed mips in arrays: The capped selection in
Pages::bind_tilestreatspacked_tilesas one tail at the end of the resource.D3D12_PACKED_MIP_INFOreports the packed count per array slice and its start within the first slice; each slice repeats that layout (Microsoft's contract). For a six-face resource with four tiles per face and one packed tile per face, a six-tile budget selects indices 18–23, whereas the packed tiles are 3, 7, 11, 15, 19, and 23. Four faces lose their coarsest mip. A budget smaller than a multi-tile packed group can also map only part of that group; D3D12 leaves partial packed-mip reads/writes undefined. Please carry the reported per-slice packed start/count into the selection and keep each packed group whole. A regression should cover both six faces and a two-tile packed group with only one tile available.Eager texture recovery:
remap_if_unmappedcan now fill an incomplete target, but its only production caller istitle_textures::forget, when removing an overlapping texture uncovers a shadowed one. A partially backed active texture at a disjoint address never takes that path. If another texture later frees capacity, its missing tiles still discard ordinary uploads. Please retry incomplete active eager targets on a normal use/upload path, with a cap → free capacity → upload/readback regression that does not callremap_if_unmappeddirectly.Lazy-level retry with unchanged bytes: When a lazy level cannot obtain pages,
map_levelsskips that group, butupload_allcontinues to copy to NULL tiles. The source hash was already recorded bysame_as_last_upload; a later dirty submission of identical bytes skips beforemap_levels_with_texels, even after capacity returns. Please keep failed groups pending and avoid treating their discarded upload as successfully cached. A same-byte retry after freeing capacity would exercise the actual upload path.AI use: Codex (GPT-6.2 Sol) traced and reviewed these paths and drafted this comment. I checked each point before posting.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T16:36:00Z.
Independent Windows/NVIDIA test of PR head
55ab6ba0against its exact base8b957bec. RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11.cargo test --offline --locked -p xcl --lib reclaimed_pool_still_counts_before_retirement_is_queued -- --test-threads=1: 1 passed, 0 failed, 0 ignored.cargo test --offline --locked -p xcl --lib capped_pages_keep_over_budget_placements_alive -- --test-threads=1: 1 passed, 0 failed, 0 ignored; the one-pool cap logged partially backed and zero-tile placements.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,439 passed, 1 failed, 47 ignored across 37 test targets; 25 GPUSKIPPEDnotices, excluded from coverage. The only failure wasconsole_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(cached_only console_mesh hit: "DXIL not compiled yet"). I reran that test alone on exact base8b957bec; it also failed 0/1 with the same error. This failure is therefore reproducible without the PR change on this machine.Not tested: the required fresh 60-second retail smoke pair, AMD, and Linux/Wine. This report does not satisfy the PR's smoke gate.
AI use: Codex (GPT-6.2 Sol) ran the tests, checked the exact commits and counts, and drafted this report.
Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T17:31:44Z.
Thank you for the thorough review on
55ab6ba0and the exact-head RTX 3080 Ti run,@thehollowedone! Addressed all three items and rebased ontoorigin/main(8b957bec) as one squashed commit (af3ebe93):Per-slice
D3D12_PACKED_MIP_INFO& atomic packed groups (TileShape::from_tiling,packed_and_standard_layout,Pages::bind_tiles):NumPackedMips,StartTileIndexInOverallResource(within slice 0), andNumTilesForPackedMips(per array slice) intoTileShape. Whentotal == (packed_start + packed_tiles) * array_slices,packed_and_standard_layoutpartitions each slice's packed group[s * per_slice + packed_start .. (s + 1) * per_slice)separately (while retaining single-group handling whenpacked_start + packed_tiles == totalunderSINGLE_MIPTAIL_BIT).None/FLAG_NULL, including skipping any shared page in that group so it is never partially mapped), and any unconsumedfreshtiles are returned toTilePool(return_tiles).budgeted_bind_shares_pages_retains_cubemap_coarse_mips_and_recovers_after_freeto cover both the 6-face × 4-tile (packed_start = 3, packed_tiles = 1) 6-tile budget (3, 7, 11, 15, 19, 23) + 12-tile budget (2, 3, 6, 7, ...) and a 2-tile packed group with only 1 tile available ([None, None]with zero leaked pool tiles, plus mixed standard + 2-tile packed[None, Some(_), None, None]).Active eager texture recovery on normal
refresh/upload_all(title_textures::INCOMPLETE,vram::backfill_incomplete_state,vram::available_tiles):title_texturesnow tracks incomplete active placements inINCOMPLETE(keyed with the minimum fresh tiles needed to advance, skipping wakeups whileavailable_tiles(dev) < min_tilesso capped submits do not spin, and self-pruning onnote_gpu_write/ shadowing /retire_overlapping/forget).upload_allcallsvram::backfill_incomplete_state(&r)(under a singlePAGES.lock()acquisition) and invalidatesLAST_CONTENTwhenever new tiles map (eager_gained).capped_eager_placed_texture_recovers_on_upload_after_capacity_frees(title_textures::tests) exercising both a partially backed (half / all) active texture at a disjoint address recovering on a normalrefreshafter capacity frees and a0 / allactive texture recovering on an identical-byte dirty submit, with no directremap_if_unmappedcalls.Lazy-level (
XCL_TEXTURE_LEVEL_PAGES=1) retry with unchanged bytes (vram::map_levels,map_levels_with_texels,Incomplete::Lazy):vram::map_levelsnow returnsLevelMapResult { gained, unmapped, min_tiles }. When any non-zero level group failsbind_rangeat cap,map_levels_with_texelsrecords the unmapped group start(s) inIncomplete::Lazy.upload_allretriesIncomplete::Lazygroups beforesame_as_last_uploadand removesLAST_CONTENT[res]wheneverm.gainedis true — so still-capped unchanged submits keep skipping, while an identical-byte dirty submit (or capacity wakeup) after capacity returns maps the pending group and uploads its texels. Also resolveddesc.MipLevels == 0viares.GetDesc().MipLevelsinplace_on_pages.capped_lazy_level_texture_retries_same_bytes_after_capacity_frees(title_textures::tests) verifying1..11mapped at cap → identical-byte skip while capped → capacity freed + identical bytes rewritten → mip0mapped and verified via readback → subsequent identical submit skipped.Waiting on a Windows GPU suite + 60 s
scripts/smoke.ps1pair onaf3ebe93.AI use: Antigravity (Gemini 4 Carbon)
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T17:53:41Z.
Windows/NVIDIA follow-up on current head
af3ebe93, after the author's requested recheck. Exact base:8b957bec. RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11.cargo build --offline --locked --workspace: passed.cargo test --offline --locked -p xcl --lib capped_eager_placed_texture_recovers_on_upload_after_capacity_frees -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, no GPU skip. The test exercised partial and zero-tile placements and GPU readback after capacity returned.cargo test --offline --locked -p xcl --lib capped_lazy_level_texture_retries_same_bytes_after_capacity_frees -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, no GPU skip. It exercised the same-byte mip retry and readback path.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,452 passed, 1 failed, 47 ignored across 38 targets; 25 GPU subcaseSKIPPEDnotices, not counted as coverage. The sole failure wasconsole_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, which also failed on the clean base on this machine.I also attempted the required
scripts/smoke.ps1 -Game <licensed title> -Seconds 60on this clean head with networking disabled. The launcher remained atprecompiling 26503 shadersbeyond the script's 120-second startup allowance and never printed a log path, so noxcl-smokeblock was produced. A first attempt with a sandbox-redirected empty cache had the same startup outcome; the second used the normal local cache. I did not clear the cache. Since the head did not reach the timed title run, I did not run a base smoke pair or calculate a regression ratio. The smoke gate remains open; this is a GPU test report, not a merge-readiness claim.Not tested: AMD, Intel, Linux/Wine, retail world-load or gameplay under this head. No title files or diagnostics are attached.
AI use: Codex (GPT-6.2 Sol) ran and checked these tests and drafted this report.
Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-26T18:15:44Z.
Partial RX 9070 / Linux-Wine verification of head
af3ebe93cf6df094dc359439f02d377f3196484dagainst main8b957bec6f82495aec940944c6bf47faa02db590. The bounded pool-cap/retirement tests and native budget selection passed. The new eager/lazy recovery tests stopped before GPU readback, so this does not confirm their recovery behavior on Wine.Tested
RX 9070 (RADV GFX1201), Mesa
26.3.1-arch3.5, Ryzen 7 7700, CachyOS kernel7.3.0-5-cachyos, GE-Proton11-12 / Wine 11.0 Staging, native d3d12/d3d12core/dxgi, vkd3d-proton8293130ebe370b1+(local asserts-disabled build), DXC1.9.2602.17, Rust1.97.1, releasex86_64-pc-windows-gnu.Separate source copies and targets, built with
cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run. Original assertions were retained. Head had test-only readback/device observations and a native budget-query fixture. Production source bytes and executable hashes were verified, including the archived first-phase test binary.hle::d3d12x::vram::tests::, threads 1 and 4title_textures::tests::controls, threads 1 and 4The VRAM selection explicitly excluded the existing
d32s8_targets_take_their_own_size_of_video_memorycase, following an earlier blocked interaction on this stack.churn_update_tile_mappings_timingstayed ignored. Neither is counted as coverage. There were no capability-skip messages in the selected runs.The passing VRAM selection includes the new budget arithmetic, packed-group allocation, retirement accounting and native pool-cap tests. I then reran
reclaimed_pool_still_counts_before_retirement_is_queuedandcapped_pages_keep_over_budget_placements_alivetogether with read-only device observations at threads 1 and 4: 2 passed, 0 failed, 0 ignored each. All four observations identify vendor/device1002:7550, LUID00000000:000003ef, RX 9070. This covers the original bounded native mapping/retirement assertions, not texture recovery pixels.A separate query-only fixture called the actual budget-selection function on the initialized native device:
75% of DXGI local budget064128The default query recorded DXGI local budget
15,288,639,488bytes, dedicated memory17,095,983,104bytes,UMA=false, and title budget13,824MiB. An independent calculation from the native snapshot matched the 170-pool result. Each of the four query processes passed. These queries did not allocate the full selected capacity.Blocked coverage
Both new recovery tests reached
title_textures.rs:2800, the readback helper'sdev.CreateCommandList(...), and failed withHRESULT(0x80070057)before any captured readback. Upload also loggedtitle texture: upload failed: Invalid parameter. (0x80070057). No recovery bytes were produced, and the eager/lazy pixel assertions were not reached.The old
a_placed_texture_gets_the_pages_of_a_level_with_its_texelscontrol fails at its ownCreateCommandListwith the same HRESULT on both main and head. The other common failure isplaced_title_textures_share_vram_and_preserve_pixels, reporting 0 page bytes against the expected 16 MiB on both. These common failures do not establish a root cause for the new tests.Four initial failures in the locally added query fixture came from requesting the device before initializing the backend. I corrected that fixture, preserved its source/binary/log evidence, and reran all four queries. No production code or original assertion was changed. The blocked recovery path was not investigated further.
Environment:
XCL_ADAPTER=AMD Radeon RX 9070,XCL_REQUIRE_GPU=wave64,XCL_NETWORK=0,XCL_DXC_THREADS=1, native DLL overrides, private enabled caches. Original recovery fixtures use a 64 MiB pool with small synthetic textures; their large virtual reservation does not commit the entire range.Not tested
Successful eager/lazy recovery readbacks under Wine, a full workspace suite, retail data, smoke/world-load runs, actual VRAM pressure or OOM, title-level cap behavior, VRAM savings, performance/FPS, or other GPUs/native Windows. This is a limited test report, not a clean-suite or merge-readiness claim.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the full diff, prepared test-only observations and the query fixture, ran the tests, independently checked source/binary hashes, failure boundaries, adapter identity and budget arithmetic, and wrote this report. Publication authorized by the account owner.
Imported from ivall/xcl. Originally posted by razormontana on 2026-11-26T20:20:07Z.
Independent native Windows validation of #2357 at
af3ebe93cf6df094dc359439f02d377f3196484d, based on8b957bec6f82495aec940944c6bf47faa02db590. Clean detached checkout.Tested
XCL_ADAPTER=3070,XCL_NETWORK=0, external sample variables unset. The target, data, DXIL cache, and temp directories were isolated. All Cargo commands below used+stable-x86_64-pc-windows-msvc.cargo build --offline --locked -j 1 --workspaceandcargo test --offline --locked -j 1 --workspace --no-runsucceeded.cargo test --offline --locked -j 1 -p xcl --lib hle::d3d12x::vram::tests:: -- --test-threads=1 --nocapturereported 24 passed, 0 failed, 1 ignored, and 0 explicit skips. This covered the cap calculation, atomic packed-mip groups, partial and zero-tile placements, and the pool retirement handoff. XCL selected a target-page pool ceiling of 84 pools (5,376 MiB) from 75% of the DXGI local budget.cargo test --offline --locked -j 1 -p xcl --lib hle::d3d12x::title_textures::tests::capped_eager_placed_texture_recovers_on_upload_after_capacity_frees -- --exact --test-threads=1 --nocaptureand the same command withhle::d3d12x::title_textures::tests::capped_lazy_level_texture_retries_same_bytes_after_capacity_freeseach reported 1 passed, 0 failed, 0 ignored, and 0 explicit skips. With the fixture's 64 MiB cap, eager placements initially had 2 of 4 and 0 of 4 tiles and both read back correctly once capacity returned. The isolated lazy run logged the unchanged-upload check, so it reached the capped-lazy readback path. The largest mip read back correctly after capacity returned and the CPU resubmitted the same bytes.cargo test --offline --locked -j 1 --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 1,453 passed, 0 failed, 47 ignored across 38 test targets. The pass total includes 26 explicit GPU skip notices: 21 for unavailable native wave64, 3 refused per-lane shader forms, 1 for missing heap windows, and 1 for unsupported reserved cube textures with mips. The console-mesh shader cache test passed in this run.Not tested
AI use
Codex GPT-6.2 ran the builds and validation, reconciled the result counts with the logs, and prepared this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T21:08:03Z.
Follow-up on current head
af3ebe93: the capped eager recovery test passes for a disjoint active texture, but I found a missing recovery path when an exact-range alias temporarily shadows a partially backed texture.I extended
capped_eager_placed_texture_recovers_on_upload_after_capacity_freeswith this sequence: place A with 2/4 tiles backed; place B at A's exact range; free capacity; refresh until B reads all expected bytes; release B; refresh without writing the CPU bytes again; read A. On the unmodified head, B read correctly, but A differed in 131,072 bytes. The focused test reported 0 passed / 1 failed, with no GPU skip.INCOMPLETEno longer tracks A while it is shadowed, andTable::removemarks a reactivated CPU-owned entry pending only whene.unmappedis true. Exact-range aliases retaine.unmapped == false, so A never retries its missing tiles.A local candidate marks every reactivated CPU-owned texture pending and invalidates its
LAST_CONTENTentry before the next refresh. With the same synthetic regression, the focused test passed (1/0, no skip);cargo test --offline --locked -p xcl --lib title_textures::tests:: -- --test-threads=1passed 21/0/0, with no skip notices. This is related to my earlier exact-range reactivation finding on #2484; please make the eventual fix work with both the bounded tile recovery here and the hash change there. The regression should assert the reactivated A's actual GPU bytes, without relying on a new CPU write.Test-only regression added to the existing eager recovery fixture
Tested on Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, DXC 1.8.2502.11. No retail smoke, AMD, Intel, or Linux/Wine run for this candidate; this does not establish merge readiness. AI use: Codex (GPT-6.2 Sol) inspected the code, wrote and ran the synthetic regression and candidate, and drafted this report. I checked the source path and test output before posting.
Imported from ivall/xcl. Originally posted by milas6669 on 2026-11-26T22:01:00Z.
RTX 3070 8 GB retail smoke on head
af3ebe93. Both clean builds completed 60 seconds with exit 0, zero crashes and zero device removals. The PR produced 95.5% of main’s frames and used 111.6% of its peak commit. Both values meet the numerical smoke thresholds. Only the PR logged an unscripted A press, so these runs do not isolate the patch’s effect on memory at the same loading progress.Tested
Windows 11 build 26200, i9-10900KF, 32 GB RAM, RTX 3070 8 GB, NVIDIA 621.40, DXC 1.8.2502.11. Both releases built with
cargo build --locked --release -p xcl --bin xcl. Each checkout ran its ownscripts/smoke.ps1 -Game <local title> -Xcl <release exe> -Seconds 60 -StartupTimeoutSeconds 14400 -OutDir <run>. The guest timer started after shader preparation. Measured order was PR, then main. Both started with separate copies of the same frozen save, learned coherent-window size and 38,232-file shader cache (5,236,030,927 bytes). The Windows driver cache was retained.Series X, default target-page policy, no scripted input. Both used
XCL_ADAPTER=NVIDIA GeForce RTX 3070,XCL_NETWORK=0,XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_UMA_WINDOWS=16,XCL_FRAME_DUMP=120and smoke’s activity logging. Overcooked 2 was absent in every sample. The preliminary base warm-up was excluded from the comparison.The A press occurred about 29 s into the PR’s title timer. The PR selected a 5,376 MiB pool limit and logged no cap hits. Total local video memory exceeded the Windows budget in five samples. A matched-input follow-up was cancelled during shader preparation and produced no smoke block.
The two head GPU readbacks also passed on this adapter (2 passed, 0 failed, 0 ignored, no explicit skips). I ran
cargo test --locked --release -p xcl --lib -- capped_eager_placed_texture_recovers_on_upload_after_capacity_frees capped_lazy_level_texture_retries_same_bytes_after_capacity_frees --nocapture --test-threads=1.Regression run
Main
PR
Not tested
Matched-progress VRAM savings, world gameplay, retail recovery at the cap and the exact-range alias case reported above. I ran the two focused GPU tests locally. Another contributor ran the full GPU suite. Independent suite report
AI use
OpenAI Codex (GPT-6, exact serving variant unavailable here) ran the builds and trials, checked the smoke blocks against manifests, logs and private frame samples, and drafted this report.
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T18:13:02Z.
Data point from a 4 GB card, in case it helps the review.
Setup: GTX 1650 (3935 MiB VRAM, driver 621.24), Ryzen 5 1600, 16 GB RAM, Windows 11 build 26300. Retail title, Series X mode.
XCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE=0, 300-second runs. Main is6089122a. The branch is this PR'saf3ebe93applied on top of6089122a. The only conflict was intitle_textures.rs, where I kept main'swith_title_bytesread and this PR'sres_key. Runs went main, PR, PR, main.The PR logged
pool budget 2496 MiB, 39 pools from 75% of DXGI local budget, and the cap held in both runs. On main the target pools filled to 3776 MB, and from then on every 64 MiBCreateHeap(type 1) was refused. Peak process commit was similar in both arms (main 17.7 and 18.3 GB, PR 17.6 and 16.7 GB). No device removals in any run.Not checked: why the PR runs stayed black (the conflict resolution in
title_textures.rsis a suspect, I have not ruled it out), world entry, other GPUs.Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T20:43:49Z.
Follow-up on the GTX 1650 black framebuffer. I rebuilt the same local integration of
af3ebe93on6089122aand ran it for 120 seconds on the same title, withXCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE=0, andXCL_FRAME_DUMP=300. The only runtime setting I changed wasXCL_TARGET_PAGES_MB=0. The log confirmed that the target-page budget was disabled.The profile selector was visible in the first nonblack readback at 101.250 s (517,917 of 518,400 samples nonblack). The run produced 2 nonblack readbacks out of 10 and exited normally at the time limit. Peak target pages were 3379 MiB and peak local video memory was 5952 MiB. The log showed no partial-mapping warnings, allocation OOMs, or device removals. I left the selector on screen so the check covered the same input as the capped runs.
At the automatic 2496 MiB cap, both earlier runs stayed black (0/28 and 0/29 nonblack readbacks), with warnings for consecutive placements at 0/60, 0/60 and 0/240 tiles. Disabling the cap restored the selector on this setup with the integration code held constant. The logs do not identify which unbacked resource affected the framebuffer.
Imported from ivall/xcl. Originally posted by DjCanigia on 2026-11-27T20:46:38Z.
Windows / RTX 3090 test. Ryzen 9 5950X, 32 GiB RAM, NVIDIA 630.20, Windows 11 build 28120.3571. One run on local
9620331and one on the same tree with the #2357 patch fromaf3ebe93and XCL_TARGET_PAGES_MB=8192. Both used the same warm cache directory and a 3 GiB system commit-headroom guard.Between 46 and 74 seconds, PresentX fell from 29.8/s to 21.2/s, before the cap was reached. The target-page pool reached 9,920 MiB on baseline and stayed at or below 8,192 MiB with the patch. The guard fired at 164 s and 196 s respectively. XCL first crossed 20,000 MiB process commit at 126 s and 157 s, so the longer run does not establish a memory saving at matched progress.
Coverage: One run per build. Candidate with the cap disabled and repeatability remain untested.
AI use: OpenAI Codex (GPT-6, exact serving variant unavailable) prepared the local build, analyzed the logs, and drafted this report.
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T21:14:03Z.
I traced the three early zero-backed placements in a 120 s run at the automatic 2496 MiB cap on the GTX 1650, using the same local integration of
af3ebe93on6089122a. All ten framebuffer readbacks were black.All three were single-sample, single-mip UAV-capable textures (flags 0x4), and the title made SRVs for each while they still had zero mapped tiles. The title presented two different resource identities, both 3840 × 2160 R8G8B8A8_UNORM (28), flags 0x5. Neither was tracked in the target-page pool. The actual source of the readback and copy to the swap chain likewise never matched any of the three zero-backed resources, and the traced title copy and resolve calls recorded no direct source for either presented plane. The trace covers placements, view creation, and direct copies and resolves. It does not establish which resources the shaders sampled or wrote.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:54:44Z.
Triage (#1607) – head
af3ebe9No open or merged PR makes the same change. Main has no target-page pool cap: no
XCL_TARGET_PAGES_MBand nomax_pools. Related open PRs handle VRAM pressure differently: #1663 reclaims cooling tiles on pool-heap OOM, #2385 and #3098 drop top mips, and #782 adds view-heap use to the page budget. None of them capsvram::Pagespool growth.The cap is on by default:
min(title_memory_mb, 75% of the DXGI local budget)on discrete adapters. It changes behaviour for every title, and the smoke pair in the description is from the older head889008fd.At +1665 lines in one commit (743 of them runtime), it is far over the size rule. The description argues why it cannot be split.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.