Skip to content

D3D12.X: an exhausted hosted view heap maps to the null pair, not 2*k (#2380) - #2405

Open
Creaa wants to merge 1 commit into
xcl-dev:mainfrom
Creaa:d3d12x/hosted-view-overflow-null
Open

Creaa wants to merge 1 commit into
xcl-dev:mainfrom
Creaa:d3d12x/hosted-view-overflow-null

Conversation

@Creaa

@Creaa Creaa commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

console_heap::slot already maps a hosted sampler heap's slots past the shared range to reserved slot 0 (sampler_unmapped_index), but a hosted CBV/SRV/UAV heap fell back to index 2 * k of the shared heap. There that can be another heap's views or the memory windows' raw views at MEM_HEAP_BASE, which hang the GPU when read as a texture (zero_tsharp_does_not_reach_window_views). A hosted view heap now takes the null SRV / UAV pair at 0 / 1 (null_views); unhosted heaps keep their own pair at 2 * k. Fixes #2380.

What is in it

  • crates/xcl/src/hle/d3d12x/console_heap.rs: view_unmapped_index(hosted, k) beside sampler_unmapped_index, used for the view fallback in slot; test hosted_view_slots_past_the_shared_range_take_the_null_pair.

Tested

Regression run

main:

xcl-smoke v1
commit: 22b6222845976e492e0d4850ad099e3a60c4d729
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1389 (PresentX 1389)
presents per 2 s (last 3): 60 33 52
device removals: 0
crashes: 0
peak commit: 15051 MB

this PR:

xcl-smoke v1
commit: 698e7550c930ca35ea91e11e8c5c6dbec2fee0fd
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1539 (PresentX 1539)
presents per 2 s (last 3): 60 60 47
device removals: 0
crashes: 0
peak commit: 18231 MB

Not tested

  • A run that exhausts the shared view heap: the fallback is reached only when it is full, which the smoke run does not do; the index choice is covered by the unit test.
  • AMD, other NVIDIA GPUs and drivers.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and the test, ran them and the smoke pair on my machine, and drafted this description; I checked it.

🤖 Generated with Claude Code

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) test report on exact head b21afe2d655dd5c34076405fca6e9a76b53739e6 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1288 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: hle::d3d12x::console_heap::tests::hosted_view_slots_past_the_shared_range_take_the_null_pair.
    • The 3 failures are pre-existing on unmodified main 68a284a: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / Recompiler: a bridged mask write in the split form meets no barrier #2074).

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: b21afe2d655dd5c34076405fca6e9a76b53739e6
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1616 (PresentX 1616)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13956 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.

…xcl-dev#2380)

`slot` already maps a hosted sampler heap's slots past the shared range to
reserved slot 0, but a hosted CBV/SRV/UAV heap fell back to index 2*k of the
shared heap: another heap's views, or the memory windows' raw views at
MEM_HEAP_BASE, which hang the GPU when read as a texture. A hosted view heap
now takes the null SRV / UAV pair at 0 / 1 (`null_views`); unhosted heaps
keep their own pair at 2*k.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Creaa
Creaa force-pushed the d3d12x/hosted-view-overflow-null branch from b21afe2 to 698e755 Compare November 25, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3D12.X: hosted view heap exhaustion aliases 2*k into GLOBAL (and MEM_HEAP_BASE) instead of slot 0

2 participants