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

Open
github-bot wants to merge 1 commit from github-bot/gh-2405 into main AGit
Owner

@⁠Creaa on GitHub · 2026-11-25 17:53 UTC · original
Creaa:d3d12x/hosted-view-overflow-null → main · +24 −1 · 1 files · 1 commits · open

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

  • RTX 4070 12 GB (driver 617.14), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0; debug for the tests, release for the smoke runs.
  • cargo build --workspace succeeded. cargo test --workspace --no-fail-fast -- --test-threads=4 on 7118151 reported 1414 passed, 0 failed, 46 ignored. The 29 SKIPPED messages covered unsupported wave64 and direct-DXIL cases, unavailable heap windows and D3D12 debug layers, and the driver cache setting that requires Developer Mode. Skipped cases are included in the harness pass count. The hosted-view regression test and the split-mask barrier test reported by DavidM1911 both ran and passed.

Regression run

main:

xcl-smoke v1
commit: 06055a7a0fb43c5f83f55e7a2ce201417de171e9
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1564 (PresentX 1564)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16956 MB

this PR:

xcl-smoke v1
commit: 7118151c1b7b367f75418703b33064f1b3adcfdc
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1574 (PresentX 1575)
presents per 2 s (last 3): 60 43 55
device removals: 0
crashes: 0
peak commit: 18084 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.
  • OpenAI Codex (GPT-6) rebased the unchanged patch, built and tested this head, ran both smoke checks, and updated the results.

🤖 Generated with Claude Code

hint: if you need to wait for this pull request to be reviewed, merged, or closed before continuing, use this instead of polling:
gh event listen --resource #2405 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1

  • It prints the first event as a JSON line on stdout and exits; run it again to wait for the next one.
  • Add --timeout to stop waiting after a while, for example --timeout 30m; it then exits with status 8.
  • Events carry no details; read the pull request to see what changed.
  • It misses changes made before it starts, so read the pull request once it is running.
  • See gh event listen --help for other event types.
  • Event subscriptions are in preview and may not be enabled for your account.
**@⁠Creaa** on GitHub · 2026-11-25 17:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405) `Creaa:d3d12x/hosted-view-overflow-null` → `main` · +24 −1 · 1 files · 1 commits · open `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** - RTX 4070 12 GB (driver 617.14), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0; debug for the tests, release for the smoke runs. - `cargo build --workspace` succeeded. `cargo test --workspace --no-fail-fast -- --test-threads=4` on `7118151` reported 1414 passed, 0 failed, 46 ignored. The 29 SKIPPED messages covered unsupported wave64 and direct-DXIL cases, unavailable heap windows and D3D12 debug layers, and the driver cache setting that requires Developer Mode. Skipped cases are included in the harness pass count. The hosted-view regression test and the split-mask barrier test reported by DavidM1911 both ran and passed. **Regression run** main: ``` xcl-smoke v1 commit: 06055a7a0fb43c5f83f55e7a2ce201417de171e9 gpu: NVIDIA GeForce RTX 4070 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1564 (PresentX 1564) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16956 MB ``` this PR: ``` xcl-smoke v1 commit: 7118151c1b7b367f75418703b33064f1b3adcfdc gpu: NVIDIA GeForce RTX 4070 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1574 (PresentX 1575) presents per 2 s (last 3): 60 43 55 device removals: 0 crashes: 0 peak commit: 18084 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. - OpenAI Codex (GPT-6) rebased the unchanged patch, built and tested this head, ran both smoke checks, and updated the results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) hint: if you need to wait for this pull request to be reviewed, merged, or closed before continuing, use this instead of polling: gh event listen --resource https://git.gtahub.st/github/xcl-dev--xcl/pulls/2405 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1 - It prints the first event as a JSON line on stdout and exits; run it again to wait for the next one. - Add `--timeout` to stop waiting after a while, for example `--timeout 30m`; it then exits with status 8. - Events carry no details; read the pull request to see what changed. - It misses changes made before it starts, so read the pull request once it is running. - See `gh event listen --help` for other event types. - Event subscriptions are in preview and may not be enabled for your account.
`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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:56 +00:00
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-25 18:13 UTC · original

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 / #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.
**@⁠emirduran707** on GitHub · 2026-11-25 18:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7170611955) 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` / #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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 19:28 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7172336709) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1219/1): ``` gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier assertion failed: group barriers in the program (lower_dxil.rs:1155) ``` The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin
Author
Owner

@⁠ahmetbagci8 on GitHub · 2026-11-25 19:39 UTC · original

Tested

  • Commit: 7118151c1b7b367f75418703b33064f1b3adcfdc
  • Hardware / OS: Intel Core i7-11800H, NVIDIA GeForce RTX 3070 Laptop GPU (driver 32.0.16.1714), Windows 11 Pro (Build 26300), DXC v1.9.2609
  • cargo test -j 2 -p xcl --lib console_heap -- --test-threads=4: 13 passed; 0 failed; 0 ignored (0.07s)

Not tested

  • Full workspace suite and scripts/smoke.ps1 (no unpacked title locally).

AI use

  • Antigravity harness (Gemini 4 Neon) ran the targeted unit tests on this commit and drafted this report; the author reviewed it before posting.
**@⁠ahmetbagci8** on GitHub · 2026-11-25 19:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7172607223) ### Tested - **Commit:** `7118151c1b7b367f75418703b33064f1b3adcfdc` - **Hardware / OS:** Intel Core i7-11800H, NVIDIA GeForce RTX 3070 Laptop GPU (driver `32.0.16.1714`), Windows 11 Pro (Build 26300), DXC `v1.9.2609` - `cargo test -j 2 -p xcl --lib console_heap -- --test-threads=4`: `13 passed; 0 failed; 0 ignored (0.07s)` ### Not tested - Full workspace suite and `scripts/smoke.ps1` (no unpacked title locally). ### AI use - Antigravity harness (Gemini 4 Neon) ran the targeted unit tests on this commit and drafted this report; the author reviewed it before posting.
Author
Owner

@⁠Creaa on GitHub · 2026-11-25 19:45 UTC · original

@⁠DavidM1911 Thanks for checking this on the 3060 Ti. I rebased the PR onto main with #2420, which narrowed the barrier assertion to the divergent part of the program. On the current head 7118151c1b7b367f75418703b33064f1b3adcfdc, I reran your failing test on an RTX 4070 with one test thread:

cargo test -p xcl --lib gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier -- --exact --test-threads=1

1 passed, 0 failed, 0 ignored. The full workspace run also finished with zero failures, and Windows CI passed on this head.

AI use: OpenAI Codex (GPT-6) ran the checks and drafted this reply.

**@⁠Creaa** on GitHub · 2026-11-25 19:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7172723498) @⁠DavidM1911 Thanks for checking this on the 3060 Ti. I rebased the PR onto `main` with #2420, which narrowed the barrier assertion to the divergent part of the program. On the current head `7118151c1b7b367f75418703b33064f1b3adcfdc`, I reran your failing test on an RTX 4070 with one test thread: ```text cargo test -p xcl --lib gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier -- --exact --test-threads=1 ``` 1 passed, 0 failed, 0 ignored. The full workspace run also finished with zero failures, and [Windows CI passed on this head](https://github.com/xcl-dev/xcl/actions/runs/45686631083). AI use: OpenAI Codex (GPT-6) ran the checks and drafted this reply.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 20:09 UTC · original

Independent Windows check of #2405 head 7118151, plus a clean local integration with main 6d12f58 after #2368 merged. The integration was uncommitted, conflict-free, and produced tree 8fcb1d762aea5469bbcefd0bf95cac38c75914c7; git diff --check passed.

Tested: RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, SDK DXC/DXIL 1.8.2502.11. Offline Cargo, XCL_NETWORK=0, XCL_ADAPTER=RTX 3080 Ti, SDK XCL_DXC_DIR, no optional D3D12 debug layer or sample data.

  • Exact head: cargo build --offline --locked --workspace --jobs 6 passed; cargo test --offline --locked -p xcl --lib console_heap --jobs 6 -- --test-threads=1 --nocapture passed 13/0/0, including hosted_view_slots_past_the_shared_range_take_the_null_pair and zero_tsharp_does_not_reach_window_views. The latter also passed individually 1/0/0. cargo test --offline --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --nocapture reported 1,414 passed, 0 failed, 46 ignored, with 26 runtime GPU skip notices.
  • Integration with main 6d12f58: the same workspace build passed; the same full-suite command reported 1,424 passed, 0 failed, 46 ignored, with 26 runtime GPU skip notices.

Not tested: actual exhaustion of a hosted descriptor heap during GPU execution or a retail smoke pair on this hardware. The focused tests check the fallback index and null-view layout with synthetic inputs; they do not demonstrate that a real GPU hang is resolved. AI-assisted. Codex (GPT-6, exact variant unavailable) reviewed the focused test coverage, ran the checks, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 20:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7173260364) Independent Windows check of [#2405 head 7118151](https://github.com/xcl-dev/xcl/commit/7118151c1b7b367f75418703b33064f1b3adcfdc), plus a clean local integration with [main 6d12f58](https://github.com/xcl-dev/xcl/commit/6d12f58a229bc73889878a448c64dc3af25eeba0) after #2368 merged. The integration was uncommitted, conflict-free, and produced tree `8fcb1d762aea5469bbcefd0bf95cac38c75914c7`; `git diff --check` passed. **Tested:** RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, SDK DXC/DXIL 1.8.2502.11. Offline Cargo, `XCL_NETWORK=0`, `XCL_ADAPTER=RTX 3080 Ti`, SDK `XCL_DXC_DIR`, no optional D3D12 debug layer or sample data. - Exact head: `cargo build --offline --locked --workspace --jobs 6` passed; `cargo test --offline --locked -p xcl --lib console_heap --jobs 6 -- --test-threads=1 --nocapture` passed **13/0/0**, including `hosted_view_slots_past_the_shared_range_take_the_null_pair` and `zero_tsharp_does_not_reach_window_views`. The latter also passed individually **1/0/0**. `cargo test --offline --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --nocapture` reported **1,414 passed, 0 failed, 46 ignored**, with **26 runtime GPU skip notices**. - Integration with main `6d12f58`: the same workspace build passed; the same full-suite command reported **1,424 passed, 0 failed, 46 ignored**, with **26 runtime GPU skip notices**. **Not tested:** actual exhaustion of a hosted descriptor heap during GPU execution or a retail smoke pair on this hardware. The focused tests check the fallback index and null-view layout with synthetic inputs; they do not demonstrate that a real GPU hang is resolved. AI-assisted. Codex (GPT-6, exact variant unavailable) reviewed the focused test coverage, ran the checks, and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 02:22 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

**@⁠DavidM1911** on GitHub · 2026-11-26 02:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2405#issuecomment-7180741476) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2405/head:github-bot/gh-2405'
git switch 'github-bot/gh-2405'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2405'
git switch 'github-bot/gh-2405'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2405'
git switch 'github-bot/gh-2405'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2405'
git switch 'main'
git merge --squash 'github-bot/gh-2405'
git switch 'main'
git merge --ff-only 'github-bot/gh-2405'
git switch 'main'
git merge 'github-bot/gh-2405'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.