Skip to content

D3D12.X: add opt-in XCL_SPARSE_VRAM_CAP_MB to overflow sparse pools to L0 system memory - #3112

Draft
iggyvilla wants to merge 1 commit into
xcl-dev:amd-devfrom
iggyvilla:amd-sparse-vram-cap
Draft

iggyvilla wants to merge 1 commit into
xcl-dev:amd-devfrom
iggyvilla:amd-sparse-vram-cap

Conversation

@iggyvilla

@iggyvilla iggyvilla commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an opt-in XCL_SPARSE_VRAM_CAP_MB=<N> environment variable (unset by default: zero behavior change) that overflows sparse page-pool allocations past N MiB of local video memory into L0 write-back system-memory heaps, and reports L0 sparse pools separately in memory_report.rs.

TL;DR — Before vs After

Metric Before (origin/amd-dev 41aa60ce) After (93570fea, XCL_SPARSE_VRAM_CAP_MB unset) After (XCL_SPARSE_VRAM_CAP_MB=1024, RX 7800 XT report)
60 s smoke frames / peak commit 1,654 / 15,902 MB (0 crashes) 1,645 / 15,818 MB (0 crashes) —
Peak local sparse pools / local VRAM 2,236 MB / 6,896 MB Unchanged (opt-in off) 1,024 MB / 5,784 MB (−1,112 MB local)
L0 sparse pool reporting Not tracked "sparse pools in system memory" (uma_segment) Reported separately from video memory

What is in it

  • crates/xcl/src/hle/d3d12x/sparse.rs: XCL_SPARSE_VRAM_CAP_MB parsing, pool_is_sys parallel tracking, heap-kind matching when recycling retired pools, L0 fallback to video memory on CreateHeap failure, split local/L0 memory_bytes_for, unit test sparse_vram_cap_parses_pool_counts, and GPU test sparse_vram_cap_overflows_to_l0_and_reports_separately.
  • crates/xcl/src/hle/d3d12x/memory_report.rs: exposes "sparse pools in system memory" on uma_segment(non_local) (non-local on discrete GPUs, local on single-segment/UMA adapters).

Tested

  • Hardware: AMD Radeon RX 6650 XT 8 GB (RDNA2, driver 32.0.21045.29003), AMD Ryzen 7 5700X, Windows 11 x64, rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 2,960 passed, 13 failed, 49 ignored. All 13 failures reproduce identically on clean origin/amd-dev 41aa60ce (2,954 passed, 17 failed, 49 ignored: 3 pre-existing RDNA2 f32/NaN tests, 6 parallel sparse/title_textures shared-global contention tests, test_title_runs_and_game_folder_is_untouched, and two_pass_driver_cache_e2e). SKIPPED (7): 4× f16_programs_on_the_gpu (unsupported V_MUL_F16/V_PK_MUL_F16 per-lane), 2× heap-window tests (XCL_HEAP_WINDOWS=1 opt-in), 1× pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode not enabled).
  • Targeted single-threaded run cargo test -p xcl --lib -- hle::d3d12x::sparse::tests::sparse_vram_cap hle::d3d12x::memory_report::tests --test-threads=1: all passed, 0 failed, 0 skipped.
  • Independent community reports on earlier head 5ca76771: JJAutoCompare (12/12 env-parsing cases) and moombathepilot (RX 7800 XT 300 s run showing local sparse pools capped at 1,024 MB vs 2,236 MB baseline, local VRAM 5,784 vs 6,896 MB).

Regression run
Base (main, required by pr_check.py):

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: AMD Radeon RX 6650 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 15479 MB

Base (origin/amd-dev merge base):

xcl-smoke v1
commit: 41aa60ce842060a597b7e8724896f7bf6a031af5
gpu: AMD Radeon RX 6650 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15902 MB

PR head (93570fea, XCL_SPARSE_VRAM_CAP_MB unset):

xcl-smoke v1
commit: 93570fea74162f7b2a60ac891c99b3b57542b8c2
gpu: AMD Radeon RX 6650 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1645 (PresentX 1645)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 15818 MB

Not tested

  • NVIDIA and Intel GPUs, single-segment/integrated GPUs (relies on existing uma_segment(non_local)), and Wine.

AI use

  • Antigravity (Gemini 4 Neon High) updated memory_report.rs to use uma_segment(non_local), ran the workspace GPU test suite and 60 s smoke, and updated this description.

@JJAutoCompare

Copy link
Copy Markdown

Tested

Exact 5ca76771ad326f8df7f68731bd7fa8112883ef2a on the amd-dev PR, Windows 11 x64 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.1 MSVC. I reran the pinned standalone CPU harness after verifying that TILE, POOL_TILES, and sparse_vram_cap_pools matched the Git source byte-for-byte. The harness used a print-only stand-in for xlog_info!.

I ran sparse_cap.exe --exact fresh_process_cap --nocapture --test-threads=1 once per setting in 12 fresh processes with child-only environments. Each process returned the same result on its second call.

XCL_SPARSE_VRAM_CAP_MB Result
Unset, empty, invalid, -1, 4.5 None
0, 3 Some(0)
4, 7 Some(1)
8 Some(2)
1024, space-padded " 1025 " Some(256)

The process readbacks distinguished Err(NotPresent) from Ok("") and showed both spaces in " 1025 ". 12 passed, 0 failed, 0 ignored, 0 runtime skips. Every native process exited 0 with zero tests filtered out.

Not tested

Device or GPU behavior, heap allocation or fallback, tile mapping, VRAM accounting, production logging, performance, retail smoke, and the full suite.

AI use

T3 Code through the Codex harness (gpt-6.2-sol) verified the source and executable, reran the cases, and wrote this report.

@moombathepilot

Copy link
Copy Markdown

RX 7800 XT comparison

I compared release builds of the latest amd-dev (7c795f5eefa0661eaf3f9f696d0cba3a75ce9628) and this PR (5ca76771ad326f8df7f68731bd7fa8112883ef2a), whose parent is that amd-dev commit. Both source trees were clean. Neither build included the local XG compatibility patch.

Hardware: RX 7800 XT, AMD driver 32.0.32029.2010, Ryzen 7 5700X3D, 64 GiB RAM, Windows 11 build 26300.9974. I used separate title-data folders and separate copies of the same starting warm DXIL cache. There was one run per revision.

Common settings: XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RT_GATE=miss XCL_PRESS_A_AT=20,24,30,45,60,90,120,150,180,210,240,270 XCL_RUN_SECONDS=300 XCL_PIPELINE_MAX_KB=1150 XCL_PSO_MAX_KB=1150 XCL_DRED=1 XCL_PREPARE=0 XCL_COHERENT_CAP_MB=2048 XCL_TEXTURE_LEVEL_PAGES=1. Each run also set XCL_DATA_ROOT and XCL_DXIL_CACHE to its own folder. XCL_SPARSE_VRAM_CAP_MB was unset on the amd-dev baseline and 1024 on the PR. Both logs confirmed a 2,048 MB coherent window and the first scripted A press at 20.003 s.

Measure amd-dev baseline (cap unset) PR #3112 (1,024 MB cap)
Peak reported local sparse pools 2,236 MB 1,024 MB
Peak local video memory 6,896 MB 5,784 MB
Peak non-local video memory 2,792 MB 4,041 MB
Peak process commit 21,440 MB 21,338 MB
Presents counted 2,289 2,039
Last interval with a present 200.238 s 198.947 s
Last console code so far 24,132 draws (512 skipped), 3,057 dispatches (0 skipped) 21,085 draws (513 skipped), 2,871 dispatches (0 skipped)
Exit 0xe06d7363; stack includes xboxbvhbuilder.dll+0xd2538 Same
Device removal / DRED removal None None

The PR log confirms the cap setting and reports local sparse pools staying at 1,024 MB. The drop in local video memory and rise in non-local use are consistent with overflow to system memory. These counters do not directly count L0 heaps. Both runs ended at the same earlier BVH builder exception, so this test shows the memory cap taking effect on RDNA3, not improved world-load progress. With one run per revision, I cannot attribute the frame-count difference to the PR.

cargo test -p xcl --lib hle::d3d12x::sparse:: -- --test-threads=4 on the PR: 39 passed, 0 failed, 1 ignored. I did not run the full workspace suite or scripts/smoke.ps1.

Driver compile starts without a logged finish at exit: amd-dev baseline, one MS PSO (339,108 B DXIL); PR, two MS PSOs (376,292 B and 265,320 B DXIL). Those start lines contain no hashes and do not establish a driver hang.

AI use: OpenAI Codex (GPT-6) verified the commits, prepared the builds and runs, analyzed the logs, and drafted this report. I ran the test on my PC.

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) and removed gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head a0f65e2

Related, not the same: #2987 (against main) puts sparse tiles outside the title's GPU heaps into L0 system-memory pools (XCL_SPARSE_SYSMEM), choosing by what a range holds. This PR caps video-memory sparse pools by size on amd-dev. The change is not on amd-dev yet.
No correctness problems found in sparse.rs. pool_is_sys is kept alongside pools, retired heaps are reused only for the same kind, and pool_bytes leaves L0 pools out. sparse_vram_cap_overflows_to_l0_and_reports_separately now covers the L0 overflow path (take_tile_with_cap), reuse of a retired L0 pool, and the separate byte counts.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Review (head b007712, diff read, not a merge-check; draft, base amd-dev, conflicts with it):

  • Pools past the cap go to system memory whatever they hold, and never move back. Placement is first-come: GPU-written buffers can land in L0 and are then read and written over PCIe. Render targets can't, since the heaps are buffer-only (sparse.rs ~1554). moombathepilot's RDNA3 run had fewer frames, but with one run per side it can't be put on the PR.
  • L0 use is invisible. pool_bytes (~1226) leaves L0 pools out, and nothing else reports them.
  • No test covers the overflow path, and NVIDIA is untested. It conflicts with amd-dev, where the retired tuple changed shape (~2746 there).
  • The red CI comes from the base: release_tests::the_last_release_drops_entries_before_the_object_goes and exit 0x887a0005 fail the same way on D3D12.X: drop CopyScratch resources outside COPY_SCRATCH lock and skip own-work reset hooks #3111 at the same base f33df5a. The description check fails on peak commit, which the author shows is amd-dev's own number.

Fine: off when unset (parsing checked by JJAutoCompare), retired heaps are reused only for the same kind, and a failed L0 heap creation falls back to video memory. #3335 / #3039 put texture levels in system memory, a different path; #2987 (main) overlaps in what it does.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@iggyvilla
iggyvilla force-pushed the amd-sparse-vram-cap branch from b007712 to a0f65e2 Compare December 1, 2026 17:13
@iggyvilla

Copy link
Copy Markdown
Collaborator Author

Rebased onto amd-dev 41aa60ce (a0f65e2f) addressing the review points:

  • Resolved the sparse.rs retired tuple merge conflict.
  • Exposed L0 sparse pools in memory_report.rs as "sparse pools in system memory" on Kind::NonLocal (while keeping video-memory counts local-only).
  • Added unit test sparse_vram_cap_parses_pool_counts and GPU test sparse_vram_cap_overflows_to_l0_and_reports_separately covering L0 overflow allocation, retired-pool kind matching, and split accounting.
  • Refreshed the 60 s smoke.ps1 regression run (1,643 frames, 15,430 MB peak commit — now under main's 15,479 MB).

Note: first-come placement past the cap remains intentional for this opt-in MiB cap (workload-aware placement is tracked separately by #2987 and #3587).

@github-actions github-actions Bot added gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) and removed gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Dec 1, 2026
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 2, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range allocates a local VRAM tile, copies the 64 KiB tile bytes from L0 to local on Pages::queue (via lazily-created 0-VRAM reserved scratch textures), promotes the page in-place, cools the old L0 tile, remaps any live mapped aliases in Pages::targets, and marks any pending HeldUnmap referencing that page stale so cancelling it in remap_if_unmapped re-maps onto the promoted local tiles. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 2, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range allocates a local VRAM tile, copies the 64 KiB tile bytes from L0 to local on Pages::queue (via lazily-created 0-VRAM reserved scratch textures), promotes the page in-place, cools the old L0 tile, remaps any live mapped aliases in Pages::targets, and marks any pending HeldUnmap referencing that page stale so cancelling it in remap_if_unmapped re-maps onto the promoted local tiles. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 2, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range allocates a local VRAM tile, copies the 64 KiB tile bytes from L0 to local on Pages::queue (via lazily-created 0-VRAM reserved scratch textures), promotes the page in-place, cools the old L0 tile, remaps any live mapped aliases in Pages::targets, and marks any pending HeldUnmap referencing that page stale so cancelling it in remap_if_unmapped re-maps onto the promoted local tiles. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
…o L0 system memory

With XCL_SPARSE_VRAM_CAP_MB=<N> set (unset: no change), sparse pool heaps
past N MiB of local video memory are allocated in custom L0 write-back
system memory. Video-memory pool counts exclude L0 pools, and
memory_report exposes them on the non-local side as "sparse pools in
system memory". Retired pool reuse matches the heap kind, and a failed
L0 heap allocation falls back to video memory.

Assisted-by: Antigravity (Gemini 4 Neon High)
@iggyvilla
iggyvilla force-pushed the amd-sparse-vram-cap branch from a0f65e2 to 93570fe Compare December 2, 2026 04:11
@Foniass

Foniass commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Follow-up review (head 93570fe, since a0f65e2, diff read, not a merge-check; draft):

  • L0 use is invisible: fixed. memory_bytes_for reports system-memory pools separately and memory_report lists them as "sparse pools in system memory"; this push files them under uma_segment(non_local) (memory_report.rs ~151), so on a single-segment adapter they count as local, as DXGI does.
  • No test of the overflow path: fixed; sparse_vram_cap_overflows_to_l0_and_reports_separately and sparse_vram_cap_parses_pool_counts were added, and the branch now sits on the current amd-dev tip.
  • Pools past the cap go to system memory whatever they hold, and never move back: still open; placement is still first-come (take_tile_with_cap).

New: none; only the segment kind changed since a0f65e2f.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 2, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range allocates a local VRAM tile, copies the 64 KiB tile bytes from L0 to local on Pages::queue (via lazily-created 0-VRAM reserved scratch textures), promotes the page in-place, cools the old L0 tile, remaps any live mapped aliases in Pages::targets, and marks any pending HeldUnmap referencing that page stale so cancelling it in remap_if_unmapped re-maps onto the promoted local tiles. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
@Foniass

Foniass commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Test report (not a merge-check: draft)
base: 41aa60c
head: 93570fe
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2963 passed, 9 failed, 49 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on amd-dev); failing: gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu, gpu::recomp::tests::gpu_fract_f32_edges, hle::d3d12x::sparse::tests::private_physical_pages_reach_the_gpu_on_mapping, hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, hle::d3d12x::title_textures::tests::remapped_pages_are_compared_with_what_they_held, hle::d3d12x::title_textures::tests::stream_recheck_keeps_the_whole_upload_baseline_over_partial_uploads, hle::d3d12x::title_textures::tests::stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload, hle::d3d12x::title_textures::tests::stream_recheck_schedule_catches_late_writes_and_resets_milestones (the same tests fail on amd-dev 41aa60c alone on this card, so none is from this PR)
review: read by one reviewer at this same head; the review is at #3112 (comment) and its findings stand. Most serious: past the cap, take_tile_with_cap (sparse.rs ~3886) sends new pools to system memory in arrival order and never moves them back (a limit of an opt-in switch, not a bug).
performance: 60 s smoke of a retail title, amd-dev 41aa60c vs this merge (93570fe): 1671 -> 1687 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 16722 -> 16853 MB, 0 device removals, 0 crashes.
assessment: merges cleanly into amd-dev, adds no test failure, and the smoke run is clean; the review found no blocking problem (past the cap, new pools go to system memory in arrival order and never move back, a limit of the opt-in switch); ready for a merge-check once it leaves draft
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants