D3D12.X: reclaim cooling and idle tiles on pool heap OOM #1663
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1663
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1663"
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?
@n-romanovich on GitHub · 2026-11-24 18:56 UTC · original
n-romanovich:vram/reclaim-tiles-on-oom→main· +108 −14 · 1 files · 1 commits · openAddresses #1585.
When
Pages::bindhitsE_OUTOFMEMORY(0x8007000E) inalloc_pool_heap, it previously failed immediately even when freed tiles were still waiting incooling(up toCOOL = 2s) or unreferenced pages were sitting inidle(up toIDLE = 2s). Now, ontake_batchfailure, ifpool.coolingoridleis non-empty,Pages::bindwaits up to 1,000 ms forPages::fenceand, onOk(()), callsTilePool::reclaim_for_oom(draining cooling tiles and evicting the oldest still-idle pages up tomissingtiles) before retryingtake_batch. Iffence::waitfails or times out, it logs a warning and returnsNonewithout reclaiming potentially in-flight tiles.What is in it
pop_idle_pagefromsweep_idleincrates/xcl/src/hle/d3d12x/vram.rs. - AddedTilePool::reclaim_for_oomand wiredPages::bindto wait onself.fence, reclaim cooling/idle tiles, and retrytake_batchon OOM. - Added unit testreclaim_for_oom_drains_cooling_and_idle_pagescovering cooling drain, staleidleentry skipping, andOwn/Extraidle eviction.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib vram::tests -- --test-threads=4:11 passed; 0 failed; 1 ignoredcargo test --workspace -- --test-threads=4:960 passed; 0 failed; 43 ignoredSKIPPED: 21 wave64 / unsupported#1426per-lane GPU tests (no wave64/unsupported V_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
5478c4a7c1ae5adba127c8d27018d7fdbf3a8725):PR (
bdcc0ebe47316ad219212d28435c26a7833f239f):Not tested
AI use
smoke.ps1runs.@eizispark on GitHub · 2026-11-24 19:15 UTC · original
Hardware test report — commit
40fd9b6Verified
40fd9b647ca69f344a17408305e50effa39c86cf(clean merge withmainc160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:778 passed, 0 failed, 41 ignored(1 skipped:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)11/11hle::d3d12x::vram::testspassed on AMD RDNA4, includingreclaim_tile_drains_cooling_and_idle_pages_on_oomandtake_tile_reclaims_only_after_fence_on_oomgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, plusconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back) passed cleanlyRegression run (
scripts/smoke.ps1, 60 s, warm shader/driver cache)main(c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):PR (
40fd9b647ca69f344a17408305e50effa39c86cf):Not tested
CreateHeappool-heap OOM in a live retail session (16 GB VRAM RX 9070 XT did not hit OOM during the 60 s smoke), NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menusAI use
@n-romanovich on GitHub · 2026-11-24 19:19 UTC · original
Thanks for the review!
@MiharaxD on GitHub · 2026-11-24 19:27 UTC · original
Test report on an 8 GB NVIDIA card, head
40fd9b6(onmain9e3831e).Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) on40fd9b6: 778 passed, 0 failed, 41 ignored (lib tests 729 / 0 / 21).reclaim_tile_drains_cooling_and_idle_pages_on_oomandtake_tile_reclaims_only_after_fence_on_oompass (the second printscould not wait for tile fence before OOM reclaim: Timeout(1000), its timeout case).gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).OOM reclaim,no video memoryor8007000Eline, so 60 s on the start screen did not run the GPU out of memory and the new path did not run.Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60(release builds, start screen, no input).mainisc160d86:main:
this PR's head:
Not tested
0x8007000E) in the retail title: it did not happen in this run, so the reclaim was only exercised by the unit tests.AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-24 21:26 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
@Adika713 on GitHub · 2026-11-25 02:30 UTC · original
Live
0x8007000Ereproduction on AMD: the reclaim change removes the VRAM wall, but host memory becomes the next limitI saw that this PR's description and two reviewers mark live retail VRAM exhaustion as untested. I have a local repro that reaches it, so here is a paired run on the same copied retail folder.
Setup:
xcl.XCL_NETWORK=0,XCL_ACTIVITY=1,XCL_PRESS_A_AT='15,22,25,30,35,40,50,60,80,100',XCL_RUN_SECONDS=240.mainaaa093657bd96a146c05c0c1a9b61149fe761453.c2ae579e9aa5ee3feda1131f48754aa023a41e1emerged with that samemainas36b93e91475e3f2187db3b27d30c476efa89c88d.cargo build --release -p xcl --lockedpassed.Results:
mainaaa0936CreateHeap(0x4000000 bytes, type 1)refusal at 100.572 s; 8 such refusals and 1,647no video memory for more pages of title textures (0x8007000E)lines0x80000003atgame_scarlett_master.exe+0x193e00f, withrax,rcxandrsiall0x8007000ec2ae579+ samemainCreateHeap ... refused (0x8007000e)lines and 0no video memory ...lines0xc0000409frommemory allocation of 2097152 bytes failedLast memory samples:
mainat 129.068 s: 17,908 MB process commit; 7,982 MB local video memory; target pages 4,555 MB (pools 4,608 MB).What this does and does not show:
0x8007000Ewall from streamed texture pools, and with the change that wall did not appear in a 240 s run.reclaim_for_oomspecifically ran. The verified observation is the absence of the pool-heap refusals andno video memorylines under the same setup.scripts/smoke.ps160 s pair, and it is not a substitute for the PR-description check.AI use: OpenCode with Big Pickle ran the builds and retail-title runs, read the logs, and drafted this report. Please verify before posting.
@JJAutoCompare on GitHub · 2026-11-25 04:44 UTC · original
XCL PR #1663 verification
Clean detached HEAD
c2ae579e9aa5ee3feda1131f48754aa023a41e1eon STOR-WINLAB. The diff changes onlycrates/xcl/src/hle/d3d12x/vram.rs.Windows 11 Enterprise Evaluation x64, build 26200. AMD Ryzen 7 3800X, Intel Arc A770 (16,258 MiB reported by XCL), driver 32.0.101.9175. DXC 1.9.2609.5 (01b62ad47), rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized Cargo profiles with debug info and incremental compilation disabled.
Tested
cargo build --workspaceandcargo test --workspace --no-runsucceeded outside the A770 lock. The latter built 19 test executables.XCL_ADAPTER=NONE_CPU_ONLYoutside the lock, each command returned 1 passed, 0 failed, 0 ignored and 0 skip messages.cargo test -p xcl --lib hle::d3d12x::vram::tests::reclaim_for_oom_drains_cooling_and_idle_pages -- --exactverified reuse of two cooling tiles and two still-idle pages before timeout, preservation of a reused active page, and a false result when reclaimable tiles ran out.cargo test -p xcl --lib hle::d3d12x::vram::tests::idle_pages_are_swept_from_their_queue -- --exactverified the ordinary idle deadline and stale-entry handling.cargo test --workspace --no-fail-fast -- --test-threads=4ran once underInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Exit 101. The 20 result lines (19 executable results and one doctest result) sum to 941 passed, 19 failed and 43 ignored. Both focused tests passed again.Workspace failures and skips
18 GPU DXIL/recompiler unit tests failed, including compute PSO creation errors (0x80070057) and shader output mismatches. The synthetic title e2e also failed on dynamic depth bias via
RSSetDepthBiasX(#94), producing blue where it expected green. The log contains 25 explicit skip messages, including 17 for missing wave64 and one for tiled-resource tier below 2. Skip messages include partial test skips and provide no coverage for the skipped paths.Not tested
Actual D3D12 pool-heap OOM, the fence-wait and retry under driver OOM, a matched
mainrun, retail-title smoke, and other GPUs.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1663-suite.logand published.@Adika713 on GitHub · 2026-11-25 14:02 UTC · original
The current no-GPU CI failure on head 24e5eb3 is a test-only stale API rename, not a failure in the reclaim change. I reproduced it locally at the exact PR head with cargo test --workspace --locked --no-run: two E0599 errors at crates/xcl/src/hle/d3d12x/vram.rs:1872-1873, because TilePool::add_heap was replaced upstream by add_heap_at(slot, pool_pages).
A two-line replacement fixes the build and preserves the test setup:
pool.add_heap_at(0, 2);
pool.add_heap_at(1, 3);
Verified locally on the exact head 24e5eb3fd7e96bc9c24c638c94e56e441520de83:
Before: cargo test --workspace --locked --no-run failed with E0599 at vram.rs:1872:25 and 1873:25; the compiler suggested add_heap_at.
After the two-line change: cargo test --workspace --locked --no-run exited 0.
After the two-line change: cargo test -p xcl --lib hle::d3d12x::vram::tests::reclaim_for_oom_drains_cooling_and_idle_pages -- --exact --nocapture reported 1 passed, 0 failed.
Only the two pre-existing Atomic::fetch_update deprecation warnings were emitted.
No retail-title smoke, GPU run, or full test suite was performed for this comment; this only verifies that the stale test calls compile and the focused reclaim test passes. I did not push a competing branch or change the PR.
AI use: OpenCode with Big Pickle reproduced the compiler failure, applied the two-line local verification patch, and drafted this comment. Please verify before applying.
@thehollowedone on GitHub · 2026-11-25 14:10 UTC · original
Independent Windows check of bdcc0eb. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11.
Commands:
cargo build --offline --locked --workspace -j 6,cargo test --offline --locked --workspace -j 6 --no-fail-fast -- --test-threads=4 --nocapture, andcargo test --offline --locked -p xcl --lib -j 6 -- --test-threads=1 --nocapture oom_reclaim reclaim_for_oom. Synthetic inputs only. No real VRAM exhaustion or retail run.AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the local follow-up and fixture, ran the tests and drafted this report.
@Lum7nt on GitHub · 2026-11-25 18:43 UTC · original
Tested on \dcc0ebe47316ad219212d28435c26a7833f239f\ (\dcc0eb, clean PR head) and merged onto \origin/main\ \
3ceb550:ustc 1.100.0\ (\x86_64-pc-windows-msvc), debug profile, \XCL_ADAPTER=nvidia.
eclaim_for_oom_drains_cooling_and_idle_pages).
3ceb550\ (\git merge origin/main): merges cleanly without conflicts; \cargo test -p xcl --lib hle::d3d12x::vram::tests -- --nocapture\ passes 20 passed, 0 failed, 1 ignored (\churn_update_tile_mappings_timing\ ignored).Review note on \origin/main\ \
3ceb550\ compatibility (#2275):eclaim_for_oom\ and immediately returning \cooling\ and \idle\ tiles to \self.pool.free\ for remapping.
11aa227), \ram.rs\ tracks all live title/upload/sparse queues on the device via \collect_device_queues\ / \RetireQueue\ because title command queues may still have in-flight GPU reads/writes referencing \cooling\ or recently \idle\ tiles. Waiting only on \self.fence\ can allow \ ake_batch\ + \self.queue.UpdateTileMappings\ to remap a tile while a title queue is still using it (the same cross-queue hazard #2275 and #2345 addressed).Not tested
AI use
@futurepro62 on GitHub · 2026-11-26 05:52 UTC · original
NVIDIA and AMD full-suite run of head
bdcc0ebe, on its own base5478c4aand merged with currentmainb49be183, to go with the reports above by Lum7nt, thehollowedone, since none of them covers AMD. On its base, the 3 failures come from changes made onmainafter that base (#2245 andea088a5); merged withmain, both cards pass. The bare-head runs come first.Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1152 passed, 2 failed, 24 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator,hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa. (stale on this base, fixed onmainby #2245; see the merged run below)reclaim_for_oom_drains_cooling_and_idle_pages.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1161 passed, 3 failed, 26 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))).--skipleaves out tests that fail on mainb49be183too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.rerouted_disk_entries_follow_the_direct_translator(#2245),gpu_image_get_resinfo_past_last_level(ea088a5),pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa(#2245).mainb49be183(git merge --no-ff, clean, local only): NVIDIAXCL_REQUIRE_GPU=mesh cargo test --workspacewith the same skips: 1424 passed, 0 failed, 45 ignored; AMD Radeon iGPU (XCL_ADAPTER=radeon, same skips): 1435 passed, 0 failed, 47 ignored.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 06:07 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.