D3D12.X: global shader-visible sampler heap, typed UAV validation, and occlusion/query VA fixes #1991

Manually merged
github merged 1 commit from gh-pr/1991/head into gh-pr/1991/base 2026-11-26 05:13:28 +00:00
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:27 UTC · original
raylitebull:feat/victory-main-world-fixes-v2 → main · +635 −78 · 5 files · 1 commits · merged 2026-11-25 10:40 UTC

Fixes three D3D12.X runtime issues across shared sampler heaps, typed UAV validation, and occlusion/query tracking (multi-plane PresentX compositing has been dropped from this PR and deferred cleanly to #615):

  1. Global shader-visible sampler heap (console_heap.rs, list_x.rs, real.rs): enables a shared PC sampler heap (shared_sampler_heap, global_sampler_heap, SAMPLER_PAGE_SLOTS = 8 with overflow mapped cleanly to reserved zero-sampler slot 0), tracks Bindings::has_sampler_heap so default_bound_heaps always binds GLOBAL_SAMPLER even alongside non-global view heaps or heap_windows() == false, and avoids short-circuiting CPU-only sampler heaps in set_descriptor_heaps_x.
  2. Typed UAV format validation & buffer SRV V# fast path (device_x.rs, real.rs): adds dev_create_uav_checked_x (pc_uav_linear_format, pc_typed_uav_supported keyed by GetAdapterLuid(), handling desc == NULL / Format == 0 sRGB/view mapping and matching null-view ViewDimension to resource dimension) to bind a null view when host hardware lacks TYPED_UNORDERED_ACCESS_VIEW support, plus writing a valid null PC buffer SRV in dev_create_srv_x when buffer_delta != 0.
  3. Occlusion query & resolve_query_data_x tracking (list_x.rs, bind.rs): tracks active occlusion query state and dropped draws (note_dropped_draw) so skipped draws and resolve_query_data_x stay coherent, guarding orig_fn with real::is_adopted (falling back to GetGPUVirtualAddress) and aligning unbinding_all_heaps_lets_the_shared_heap_be_bound_again with shared sampler heap binding.

Part of #1833.

What is in it

  • crates/xcl/src/hle/d3d12x/console_heap.rs, list_x.rs, bind.rs, device_x.rs, real.rs (5 files; 0 changes in present.rs):
    • shared_sampler_pages_preserve_zero_slot_and_clamp_tails
    • uav_format_promotion_and_linearization
    • occlusion_tracks_dropped_draws_and_active_counter
    • default_bound_heaps_always_includes_sampler_heap_when_available

Tested

  • Toolchain: Windows 11 x64, rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto 0f293be (71639e0).
  • cargo check --workspace --tests: passed.
  • XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: passed (shared_sampler_pages_preserve_zero_slot_and_clamp_tails, uav_format_promotion_and_linearization, occlusion_tracks_dropped_draws_and_active_counter, default_bound_heaps_always_includes_sampler_heap_when_available, and unbinding_all_heaps_lets_the_shared_heap_be_bound_again included and passed).
  • Exact-head 60 s scripts/smoke.ps1 regression pair on AMD Radeon RX 9070 (@Toons29): passed (0 device removals, 0 crashes).

Regression run
60 s scripts/smoke.ps1 pair on exact head 71639e0 vs main (AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release, XCL_NETWORK=0 on a retail title), contributed by @Toons29:

main:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1623 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14648 MB

this PR:

xcl-smoke v1
commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Not tested

  • 60 s scripts/smoke.ps1 pair on 71639e0, full cargo test --workspace suite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity assisted with implementation and unit tests; the author reviewed the diff and test output.
**@⁠raylitebull** on GitHub · 2026-11-25 00:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991) `raylitebull:feat/victory-main-world-fixes-v2` → `main` · +635 −78 · 5 files · 1 commits · merged 2026-11-25 10:40 UTC Fixes three D3D12.X runtime issues across shared sampler heaps, typed UAV validation, and occlusion/query tracking *(multi-plane `PresentX` compositing has been dropped from this PR and deferred cleanly to #615)*: 1. **Global shader-visible sampler heap (`console_heap.rs`, `list_x.rs`, `real.rs`):** enables a shared PC sampler heap (`shared_sampler_heap`, `global_sampler_heap`, `SAMPLER_PAGE_SLOTS = 8` with overflow mapped cleanly to reserved zero-sampler slot `0`), tracks `Bindings::has_sampler_heap` so `default_bound_heaps` always binds `GLOBAL_SAMPLER` even alongside non-global view heaps or `heap_windows() == false`, and avoids short-circuiting CPU-only sampler heaps in `set_descriptor_heaps_x`. 2. **Typed UAV format validation & buffer SRV V# fast path (`device_x.rs`, `real.rs`):** adds `dev_create_uav_checked_x` (`pc_uav_linear_format`, `pc_typed_uav_supported` keyed by `GetAdapterLuid()`, handling `desc == NULL` / `Format == 0` sRGB/view mapping and matching null-view `ViewDimension` to resource dimension) to bind a null view when host hardware lacks `TYPED_UNORDERED_ACCESS_VIEW` support, plus writing a valid null PC buffer SRV in `dev_create_srv_x` when `buffer_delta != 0`. 3. **Occlusion query & `resolve_query_data_x` tracking (`list_x.rs`, `bind.rs`):** tracks active occlusion query state and dropped draws (`note_dropped_draw`) so skipped draws and `resolve_query_data_x` stay coherent, guarding `orig_fn` with `real::is_adopted` (falling back to `GetGPUVirtualAddress`) and aligning `unbinding_all_heaps_lets_the_shared_heap_be_bound_again` with shared sampler heap binding. Part of #1833. **What is in it** - `crates/xcl/src/hle/d3d12x/console_heap.rs`, `list_x.rs`, `bind.rs`, `device_x.rs`, `real.rs` (`5` files; `0` changes in `present.rs`): - `shared_sampler_pages_preserve_zero_slot_and_clamp_tails` - `uav_format_promotion_and_linearization` - `occlusion_tracks_dropped_draws_and_active_counter` - `default_bound_heaps_always_includes_sampler_heap_when_available` **Tested** - Toolchain: Windows 11 x64, `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, rebased cleanly onto `0f293be` (`71639e0`). - `cargo check --workspace --tests`: passed. - `XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4`: passed (`shared_sampler_pages_preserve_zero_slot_and_clamp_tails`, `uav_format_promotion_and_linearization`, `occlusion_tracks_dropped_draws_and_active_counter`, `default_bound_heaps_always_includes_sampler_heap_when_available`, and `unbinding_all_heaps_lets_the_shared_heap_be_bound_again` included and passed). - Exact-head 60 s `scripts/smoke.ps1` regression pair on AMD Radeon RX 9070 (`@Toons29`): passed (0 device removals, 0 crashes). **Regression run** 60 s `scripts/smoke.ps1` pair on exact head `71639e0` vs `main` (AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release, `XCL_NETWORK=0` on a retail title), contributed by `@Toons29`: main: ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1623 (PresentX 1623) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14648 MB ``` this PR: ``` xcl-smoke v1 commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1636 (PresentX 1636) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` **Not tested** - 60 s `scripts/smoke.ps1` pair on `71639e0`, full `cargo test --workspace` suite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton. **AI use** - Antigravity assisted with implementation and unit tests; the author reviewed the diff and test output.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:13:26 +00:00
github manually merged commit 71639e02ba into gh-pr/1991/base 2026-11-26 05:13:28 +00:00
Author
Owner

@⁠yinx080 on GitHub · 2026-11-25 00:44 UTC · original

A data point for the 2-plane path, from the retail title in Series S mode on Windows (RTX 3060 Laptop, NVIDIA
610.91):

  • It presents 2 planes: plane 0 is a 1920×1080 game plane (black until there is a scene), plane 1 a 3840×2160
    UI plane with the menus (the account prompt). With only plane 0 shown, the window stays black on the prompt.
  • A plane is 0x48 bytes (9 qwords: token, resource count at +8, ID3D12Resource** at +0x10, …). Reading
    plane 1 at +0x40 found nothing.
  • Drawing plane 1's first resource over the copied plane 0 (full-screen triangle, linear clamp, premultiplied
    alpha ONE / INV_SRC_ALPHA) showed the prompt.

Glad to test this PR on the same setup when it is ready.

AI use: Claude Code (Claude Opus 5.5).

**@⁠yinx080** on GitHub · 2026-11-25 00:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7148833536) A data point for the 2-plane path, from the retail title in Series S mode on Windows (RTX 3060 Laptop, NVIDIA 610.91): - It presents **2 planes**: plane 0 is a 1920×1080 game plane (black until there is a scene), plane 1 a 3840×2160 UI plane with the menus (the account prompt). With only plane 0 shown, the window stays black on the prompt. - A plane is **0x48 bytes** (9 qwords: token, resource count at +8, `ID3D12Resource**` at +0x10, …). Reading plane 1 at +0x40 found nothing. - Drawing plane 1's first resource over the copied plane 0 (full-screen triangle, linear clamp, premultiplied alpha `ONE` / `INV_SRC_ALPHA`) showed the prompt. Glad to test this PR on the same setup when it is ready. AI use: Claude Code (Claude Opus 5.5).
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:47 UTC · original

Overlap note: full credit to #615 (@⁠0x6461726B) for multi-plane PresentX overlay compositing (present.rs).

We will drop the duplicate present.rs 2-plane compositing changes from #1991 in favor of #615 so #1991 stays scoped strictly to its independent D3D12.X fixes: the global shader-visible PC sampler heap, typed UAV sRGB/cap validation, and resolve_query_data_x / occlusion dropped-draw fallback.

**@⁠raylitebull** on GitHub · 2026-11-25 00:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7148881486) Overlap note: full credit to **#615** (@⁠0x6461726B) for multi-plane `PresentX` overlay compositing (`present.rs`). We will drop the duplicate `present.rs` 2-plane compositing changes from #1991 in favor of #615 so #1991 stays scoped strictly to its independent D3D12.X fixes: the global shader-visible PC sampler heap, typed UAV sRGB/cap validation, and `resolve_query_data_x` / occlusion dropped-draw fallback.
Author
Owner

@⁠gsucristo on GitHub · 2026-11-25 00:57 UTC · original

Technical review findings:

Blocking

  1. set_descriptor_heaps_x forwards CPU-only sampler heaps when global_heap() is None (list_x.rs, pc_heaps + real.rs, dev_create_descriptor_heap_x): dev_create_descriptor_heap_x strips SHADER_VISIBLE from title sampler heaps whenever shared_sampler_heap(dev) is true, but set_descriptor_heaps_x still short-circuits when global_heap().is_none(), forwarding the downgraded CPU-only sampler heap directly to PC SetDescriptorHeaps.
  2. 2048-sampler exhaustion silently aliases wrong samplers (console_heap.rs, GLOBAL_SAMPLER_MAX, SAMPLER_PAGE_SLOTS, slot): Once the 63 pages (SAMPLER_PAGE_SLOTS = 32, wasting 31 slots at the tail and up to 31 per small heap) fill up, reserve_global_sampler returns None, slot() falls back to (k, 0), and publish() becomes a no-op — while shaders still bind GLOBAL_SAMPLER and index k into unrelated samplers.
  3. default_bound_heaps skips binding GLOBAL_SAMPLER when a non-global view heap is bound or heap_windows() is false (list_x.rs, default_bound_heaps): Only appends sampler when current.is_empty() or current == [v], leaving 0 sampler heaps bound for SAMPLER_HEAP_DIRECTLY_INDEXED whenever view == None or a non-global view heap is bound.

Major

  1. dev_create_uav_checked_x (real.rs): When desc is non-null with desc.Format == DXGI_FORMAT_UNKNOWN (0) (or desc is null), eff_fmt != raw_fmt && raw_fmt != 0 skips patching sRGB/promoted formats. Also the null-view fallback hardcodes D3D12_UAV_DIMENSION_TEXTURE2D regardless of resource dimension, and TYPED_UAV_SUPPORT caches by raw device pointer without invalidation.
  2. dev_create_srv_x buffer SRV early-return (real.rs): Leaves slot.pc_srv (and its GLOBAL slot) uninitialized/stale for any PC/fallback shader reading that slot, and leaves the duplicate D3D12_SRV_DIMENSION_BUFFER branch below dead.
  3. present.rs 2-plane compositor (if kept): try_composite_two_planes checks ui_desc for MSAA/TEXTURE2D but not src_desc; build_compositor calls real::orig_fn without real::is_adopted; failed build_compositor retries full RS/heap/PSO creation every frame.
**@⁠gsucristo** on GitHub · 2026-11-25 00:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7149056140) Technical review findings: **Blocking** 1. **`set_descriptor_heaps_x` forwards CPU-only sampler heaps when `global_heap()` is `None` (`list_x.rs`, `pc_heaps` + `real.rs`, `dev_create_descriptor_heap_x`)**: `dev_create_descriptor_heap_x` strips `SHADER_VISIBLE` from title sampler heaps whenever `shared_sampler_heap(dev)` is true, but `set_descriptor_heaps_x` still short-circuits when `global_heap().is_none()`, forwarding the downgraded CPU-only sampler heap directly to PC `SetDescriptorHeaps`. 2. **2048-sampler exhaustion silently aliases wrong samplers (`console_heap.rs`, `GLOBAL_SAMPLER_MAX`, `SAMPLER_PAGE_SLOTS`, `slot`)**: Once the 63 pages (`SAMPLER_PAGE_SLOTS = 32`, wasting 31 slots at the tail and up to 31 per small heap) fill up, `reserve_global_sampler` returns `None`, `slot()` falls back to `(k, 0)`, and `publish()` becomes a no-op — while shaders still bind `GLOBAL_SAMPLER` and index `k` into unrelated samplers. 3. **`default_bound_heaps` skips binding `GLOBAL_SAMPLER` when a non-global view heap is bound or `heap_windows()` is false (`list_x.rs`, `default_bound_heaps`)**: Only appends `sampler` when `current.is_empty()` or `current == [v]`, leaving 0 sampler heaps bound for `SAMPLER_HEAP_DIRECTLY_INDEXED` whenever `view == None` or a non-global view heap is bound. **Major** 1. **`dev_create_uav_checked_x` (`real.rs`)**: When `desc` is non-null with `desc.Format == DXGI_FORMAT_UNKNOWN (0)` (or `desc` is null), `eff_fmt != raw_fmt && raw_fmt != 0` skips patching sRGB/promoted formats. Also the null-view fallback hardcodes `D3D12_UAV_DIMENSION_TEXTURE2D` regardless of resource dimension, and `TYPED_UAV_SUPPORT` caches by raw device pointer without invalidation. 2. **`dev_create_srv_x` buffer SRV early-return (`real.rs`)**: Leaves `slot.pc_srv` (and its `GLOBAL` slot) uninitialized/stale for any PC/fallback shader reading that slot, and leaves the duplicate `D3D12_SRV_DIMENSION_BUFFER` branch below dead. 3. **`present.rs` 2-plane compositor** (if kept): `try_composite_two_planes` checks `ui_desc` for MSAA/`TEXTURE2D` but not `src_desc`; `build_compositor` calls `real::orig_fn` without `real::is_adopted`; failed `build_compositor` retries full RS/heap/PSO creation every frame.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 01:00 UTC · original · edited 2026-11-25 01:11 UTC

Full-suite run, since this PR has no test report yet. Tested exact head fbbd982 (on its base 6567c5f).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_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::dxil::fuzz_tests: 992 passed, 0 failed, 43 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.
  • The new tests ran and passed: shared_sampler_pages_preserve_zero_slot_and_clamp_tails, uav_format_promotion_and_linearization, occlusion_tracks_dropped_draws_and_active_counter, default_bound_heaps_always_includes_sampler_heap_when_available, extract_present_planes_reads_series_s_two_plane_stride, composite_shaders_compile_to_sm5_dxbc.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1002 passed, 0 failed, 45 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))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 7994cd1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 01:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7149113688) · edited 2026-11-25 01:11 UTC Full-suite run, since this PR has no test report yet. Tested exact head `fbbd982` (on its base `6567c5f`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_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::dxil::fuzz_tests`: **992 passed, 0 failed, 43 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`. - The new tests ran and passed: `shared_sampler_pages_preserve_zero_slot_and_clamp_tails`, `uav_format_promotion_and_linearization`, `occlusion_tracks_dropped_draws_and_active_counter`, `default_bound_heaps_always_includes_sampler_heap_when_available`, `extract_present_planes_reads_series_s_two_plane_stride`, `composite_shaders_compile_to_sm5_dxbc`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1002 passed, 0 failed, 45 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))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `7994cd1` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests and `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:15 UTC · original

Thanks for the thorough review and pointers, @gsucristo and @0x6461726B!

Updated #1991 cleanly onto 0f293be (71639e0):

  • Dropped present.rs 2-plane compositing hunks: 0 changes in present.rs now, deferring multi-plane compositing cleanly to #615 and eliminating overlap with #1988.
  • Descriptor heap & sampler safety (list_x.rs, console_heap.rs, real.rs):
    • set_descriptor_heaps_x no longer short-circuits when global_sampler_heap().is_some() (never forwarding SHADER_VISIBLE-stripped CPU-only sampler heaps).
    • Reduced SAMPLER_PAGE_SLOTS (32 -> 8) and mapped GLOBAL_SAMPLER exhaustion on hosted sampler heaps to reserved zero-sampler slot 0 instead of aliasing (k, 0).
    • Tracked Bindings::has_sampler_heap so default_bound_heaps appends GLOBAL_SAMPLER even with non-global view heaps or heap_windows() == false (and prepends the shared view heap when only a sampler heap is bound).
    • dev_create_uav_checked_x handles desc == NULL / desc.Format == 0 sRGB/view mapping, matches null-view ViewDimension to resource dimension, and keys TYPED_UAV_SUPPORT by GetAdapterLuid().
    • dev_create_srv_x writes a valid null PC buffer SRV (and publishes) when buffer_delta != 0 so slot.pc_srv / GLOBAL are never stale, and drops the dead duplicate buffer branch.
    • Also includes real::is_adopted guard on resolve_query_data_x + unbinding_all_heaps test alignment.

Verified locally (cargo check --workspace --tests + XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4).

**@⁠raylitebull** on GitHub · 2026-11-25 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7149367232) Thanks for the thorough review and pointers, `@gsucristo` and `@0x6461726B`! Updated `#1991` cleanly onto `0f293be` (`71639e0`): - **Dropped `present.rs` 2-plane compositing hunks:** `0` changes in `present.rs` now, deferring multi-plane compositing cleanly to `#615` and eliminating overlap with `#1988`. - **Descriptor heap & sampler safety (`list_x.rs`, `console_heap.rs`, `real.rs`):** - `set_descriptor_heaps_x` no longer short-circuits when `global_sampler_heap().is_some()` (never forwarding `SHADER_VISIBLE`-stripped CPU-only sampler heaps). - Reduced `SAMPLER_PAGE_SLOTS` (`32 -> 8`) and mapped `GLOBAL_SAMPLER` exhaustion on hosted sampler heaps to reserved zero-sampler slot `0` instead of aliasing `(k, 0)`. - Tracked `Bindings::has_sampler_heap` so `default_bound_heaps` appends `GLOBAL_SAMPLER` even with non-global view heaps or `heap_windows() == false` (and prepends the shared view heap when only a sampler heap is bound). - `dev_create_uav_checked_x` handles `desc == NULL` / `desc.Format == 0` sRGB/view mapping, matches null-view `ViewDimension` to resource dimension, and keys `TYPED_UAV_SUPPORT` by `GetAdapterLuid()`. - `dev_create_srv_x` writes a valid null PC buffer SRV (and publishes) when `buffer_delta != 0` so `slot.pc_srv` / `GLOBAL` are never stale, and drops the dead duplicate buffer branch. - Also includes `real::is_adopted` guard on `resolve_query_data_x` + `unbinding_all_heaps` test alignment. Verified locally (`cargo check --workspace --tests` + `XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4`).
Author
Owner

@⁠Anon64 on GitHub · 2026-11-25 01:47 UTC · original

Regression run for this PR: head 76d2681, based on main 80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s, in one batch with the main run.

main 80f4819:

xcl-smoke v1
commit: 80f4819098e921f2e1ab371144d4832f68ffedd6
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1589)
presents per 2 s (last 3): 47 56 27
device removals: 0
crashes: 0
peak commit: 25184 MB

this PR:

xcl-smoke v1
commit: 76d26815ffb0454733c7e1be50eb781142f8d4dc
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1579 (PresentX 1579)
presents per 2 s (last 3): 39 48 18
device removals: 0
crashes: 0
peak commit: 26203 MB

No device removals or crashes; 99 % of main's frames, 104 % of its peak commit.

Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: XCL_DIRECT_DXIL and XCL_HEAP_WINDOWS unset).

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7149963120) Regression run for this PR: head `76d2681`, based on `main` `80f4819`. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s, in one batch with the `main` run. main `80f4819`: ``` xcl-smoke v1 commit: 80f4819098e921f2e1ab371144d4832f68ffedd6 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1589) presents per 2 s (last 3): 47 56 27 device removals: 0 crashes: 0 peak commit: 25184 MB ``` this PR: ``` xcl-smoke v1 commit: 76d26815ffb0454733c7e1be50eb781142f8d4dc gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1579 (PresentX 1579) presents per 2 s (last 3): 39 48 18 device removals: 0 crashes: 0 peak commit: 26203 MB ``` No device removals or crashes; 99 % of main's frames, 104 % of its peak commit. **Not tested:** the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: `XCL_DIRECT_DXIL` and `XCL_HEAP_WINDOWS` unset). Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 02:25 UTC · original

PR #1991 empirical verification

Tested xcl-dev/xcl PR #1991 at 71639e02ba90f85d8ba36ef638402e8ee2971e28. The live PR ref still matched after the run, and the worktree was clean before and after testing.

git merge-tree --write-tree origin/main HEAD exited 0 against the initial origin/main at aaa093657bd96a146c05c0c1a9b61149fe761453 (tree b10a58c30a14c5f6c7f2c337fc87448065f78e10). The recheck against the updated origin/main at cbc296ab65a2661a61e3e2da109134bcd5319f60 also exited 0 (tree a1b8f61cdd9b7453c47356c6ed6862fc92e7f7de).

What is in it

  • Shared shader-visible sampler heap and default sampler binding (console_heap.rs, list_x.rs).
  • Typed UAV format and capability checks (device_x.rs, real.rs).
  • Occlusion tracking for dropped draws and query resolve GPU virtual address handling (bind.rs, list_x.rs).

Tested

  • STOR-WINLAB, Intel Arc A770 16 GiB (driver 32.0.101.9175, DoublePrecisionFloatShaderOps=0, wave size 8–32), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized dev and test profiles with debug info and incremental compilation disabled. XCL_ADAPTER=A770.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the GPU lock.
  • Six focused CPU unit tests passed outside the lock (0 failed, 0 ignored, 0 SKIPPED markers). The same six also passed in the workspace run.
cargo test -p xcl --lib -- --show-output shared_sampler_pages_preserve_zero_slot_and_clamp_tails uav_format_promotion_and_linearization occlusion_tracks_dropped_draws_and_active_counter default_bound_heaps_always_includes_sampler_heap_when_available nested_occlusion_queries_end_the_outer_one_early resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback

One full suite run under the shared GPU lock:

Set-ExecutionPolicy -Scope Process Bypass -Force
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output }
  • Cargo exited 101. Across 20 target summaries, libtest reported 1,043 passed, 26 failed, 45 ignored. The log contains 26 SKIPPED markers across 16 named tests, including tests that skipped individual cases. Skipped cases do not add coverage. See pr1991-suite.log in this directory for the complete run.
  • xcl --lib reported 25 failures. In 21, CreateComputePipelineState returned 0x80070057. The other four were result mismatches in gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_ps_image_sample_offset_implicit_lod_between_mips, gpu_valu_16_and_64_bit, and gpu_wave64_ps_whole_wave_reductions.
  • xcl --test e2e reported one failure in test_title_runs_and_game_folder_is_untouched. The dynamic depth bias check (#94) read blue [0, 0, 255, 255] where it expected green after RSSetDepthBiasX(-1000.5).

All SKIPPED lines from the suite:

SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::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))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::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))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Not tested

  • No main test run or retail-title smoke comparison. The suite alone does not establish which failures reproduce on main.
  • No AMD or NVIDIA GPU run or release build. Debug-layer and other hardware-gated paths listed above were unavailable.
  • Sample-dependent paths that returned early, including retail shader tests with XCL_SAMPLE_RPF unset, yielded no sample coverage. The suite also reported early returns for missing audio and system XGameRuntime.

AI use

Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against pr1991-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 02:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7150711849) # PR #1991 empirical verification Tested `xcl-dev/xcl` PR #1991 at `71639e02ba90f85d8ba36ef638402e8ee2971e28`. The live PR ref still matched after the run, and the worktree was clean before and after testing. `git merge-tree --write-tree origin/main HEAD` exited 0 against the initial `origin/main` at `aaa093657bd96a146c05c0c1a9b61149fe761453` (tree `b10a58c30a14c5f6c7f2c337fc87448065f78e10`). The recheck against the updated `origin/main` at `cbc296ab65a2661a61e3e2da109134bcd5319f60` also exited 0 (tree `a1b8f61cdd9b7453c47356c6ed6862fc92e7f7de`). **What is in it** - Shared shader-visible sampler heap and default sampler binding (`console_heap.rs`, `list_x.rs`). - Typed UAV format and capability checks (`device_x.rs`, `real.rs`). - Occlusion tracking for dropped draws and query resolve GPU virtual address handling (`bind.rs`, `list_x.rs`). **Tested** - STOR-WINLAB, Intel Arc A770 16 GiB (driver `32.0.101.9175`, `DoublePrecisionFloatShaderOps=0`, wave size 8–32), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build `26200.9974`. - `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC/DXIL `1.9.2609.5`, unoptimized dev and test profiles with debug info and incremental compilation disabled. `XCL_ADAPTER=A770`. - `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0 outside the GPU lock. - Six focused CPU unit tests passed outside the lock (0 failed, 0 ignored, 0 `SKIPPED` markers). The same six also passed in the workspace run. ```powershell cargo test -p xcl --lib -- --show-output shared_sampler_pages_preserve_zero_slot_and_clamp_tails uav_format_promotion_and_linearization occlusion_tracks_dropped_draws_and_active_counter default_bound_heaps_always_includes_sampler_heap_when_available nested_occlusion_queries_end_the_outer_one_early resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback ``` One full suite run under the shared GPU lock: ```powershell Set-ExecutionPolicy -Scope Process Bypass -Force & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output } ``` - Cargo exited 101. Across 20 target summaries, libtest reported **1,043 passed, 26 failed, 45 ignored**. The log contains **26 `SKIPPED` markers across 16 named tests**, including tests that skipped individual cases. Skipped cases do not add coverage. See `pr1991-suite.log` in this directory for the complete run. - `xcl --lib` reported 25 failures. In 21, `CreateComputePipelineState` returned `0x80070057`. The other four were result mismatches in `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_ps_image_sample_offset_implicit_lod_between_mips`, `gpu_valu_16_and_64_bit`, and `gpu_wave64_ps_whole_wave_reductions`. - `xcl --test e2e` reported one failure in `test_title_runs_and_game_folder_is_untouched`. The dynamic depth bias check (#94) read blue `[0, 0, 255, 255]` where it expected green after `RSSetDepthBiasX(-1000.5)`. All `SKIPPED` lines from the suite: ```text SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::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)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::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)) SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64 SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64 SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64 SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D) SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2 SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)) ``` **Not tested** - No `main` test run or retail-title smoke comparison. The suite alone does not establish which failures reproduce on `main`. - No AMD or NVIDIA GPU run or release build. Debug-layer and other hardware-gated paths listed above were unavailable. - Sample-dependent paths that returned early, including retail shader tests with `XCL_SAMPLE_RPF` unset, yielded no sample coverage. The suite also reported early returns for missing audio and system XGameRuntime. **AI use** Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against `pr1991-suite.log` and published this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 03:31 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 03:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7151996843) 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!
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:49 UTC · original

Regression run of 71639e02 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on cbc296ab, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1623 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14648 MB
xcl-smoke v1
commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 101 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

**@⁠Toons29** on GitHub · 2026-11-25 03:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7152276608) Regression run of `71639e02` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `cbc296ab`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1623 (PresentX 1623) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14648 MB ``` ``` xcl-smoke v1 commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1636 (PresentX 1636) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 101 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; a script posted this right after the run, with both blocks exactly as printed.
Author
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-25 05:02 UTC · original

Fixes three D3D12.X runtime issues across shared sampler heaps, typed UAV validation, and occlusion/query tracking (multi-plane PresentX compositing has been dropped from this PR and deferred cleanly to #615):

  1. Global shader-visible sampler heap (console_heap.rs, list_x.rs, real.rs): enables a shared PC sampler heap (shared_sampler_heap, global_sampler_heap, SAMPLER_PAGE_SLOTS = 8 with overflow mapped cleanly to reserved zero-sampler slot 0), tracks Bindings::has_sampler_heap so default_bound_heaps always binds GLOBAL_SAMPLER even alongside non-global view heaps or heap_windows() == false, and avoids short-circuiting CPU-only sampler heaps in set_descriptor_heaps_x.
  2. Typed UAV format validation & buffer SRV V# fast path (device_x.rs, real.rs): adds dev_create_uav_checked_x (pc_uav_linear_format, pc_typed_uav_supported keyed by GetAdapterLuid(), handling desc == NULL / Format == 0 sRGB/view mapping and matching null-view ViewDimension to resource dimension) to bind a null view when host hardware lacks TYPED_UNORDERED_ACCESS_VIEW support, plus writing a valid null PC buffer SRV in dev_create_srv_x when buffer_delta != 0.
  3. Occlusion query & resolve_query_data_x tracking (list_x.rs, bind.rs): tracks active occlusion query state and dropped draws (note_dropped_draw) so skipped draws and resolve_query_data_x stay coherent, guarding orig_fn with real::is_adopted (falling back to GetGPUVirtualAddress) and aligning unbinding_all_heaps_lets_the_shared_heap_be_bound_again with shared sampler heap binding.

Part of #1833.

What is in it

  • crates/xcl/src/hle/d3d12x/console_heap.rs, list_x.rs, bind.rs, device_x.rs, real.rs (5 files; 0 changes in present.rs):
    • shared_sampler_pages_preserve_zero_slot_and_clamp_tails
    • uav_format_promotion_and_linearization
    • occlusion_tracks_dropped_draws_and_active_counter
    • default_bound_heaps_always_includes_sampler_heap_when_available

Tested

  • Toolchain: Windows 11 x64, rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto 0f293be (71639e0).
  • cargo check --workspace --tests: passed.
  • XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: passed (shared_sampler_pages_preserve_zero_slot_and_clamp_tails, uav_format_promotion_and_linearization, occlusion_tracks_dropped_draws_and_active_counter, default_bound_heaps_always_includes_sampler_heap_when_available, and unbinding_all_heaps_lets_the_shared_heap_be_bound_again included and passed).
  • Exact-head paired retail smoke passed on AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, release, XCL_NETWORK=0: 101% of main's frames, 101% of its peak commit, no crash and no device removal.
  • A predecessor paired run on RTX 3060 also completed without crashes or device removals; it is supporting evidence only because it predates current head.

Regression run

main:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1623 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14648 MB

PR:

xcl-smoke v1
commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Both blocks were produced by scripts/smoke.ps1 from clean trees, with the same title and duration. This checks startup/menu stability; it does not prove that the run reached every path changed by this PR.

Not tested

  • Full cargo test --workspace suite.
  • Targeted runtime exercise proving that the retail smoke reached the shared sampler heap, typed-UAV fallback and occlusion-query paths.
  • Intel and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity assisted with implementation and unit tests; the author reviewed the diff and test output.
  • Claude Code (Claude Opus 5.5) built the exact-head and main trees and ran the paired smoke report posted by the contributor; the blocks above are reproduced unchanged.
**@⁠mokkamokacaffe** on GitHub · 2026-11-25 05:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7153401862) Fixes three D3D12.X runtime issues across shared sampler heaps, typed UAV validation, and occlusion/query tracking *(multi-plane `PresentX` compositing has been dropped from this PR and deferred cleanly to #615)*: 1. **Global shader-visible sampler heap (`console_heap.rs`, `list_x.rs`, `real.rs`):** enables a shared PC sampler heap (`shared_sampler_heap`, `global_sampler_heap`, `SAMPLER_PAGE_SLOTS = 8` with overflow mapped cleanly to reserved zero-sampler slot `0`), tracks `Bindings::has_sampler_heap` so `default_bound_heaps` always binds `GLOBAL_SAMPLER` even alongside non-global view heaps or `heap_windows() == false`, and avoids short-circuiting CPU-only sampler heaps in `set_descriptor_heaps_x`. 2. **Typed UAV format validation & buffer SRV V# fast path (`device_x.rs`, `real.rs`):** adds `dev_create_uav_checked_x` (`pc_uav_linear_format`, `pc_typed_uav_supported` keyed by `GetAdapterLuid()`, handling `desc == NULL` / `Format == 0` sRGB/view mapping and matching null-view `ViewDimension` to resource dimension) to bind a null view when host hardware lacks `TYPED_UNORDERED_ACCESS_VIEW` support, plus writing a valid null PC buffer SRV in `dev_create_srv_x` when `buffer_delta != 0`. 3. **Occlusion query & `resolve_query_data_x` tracking (`list_x.rs`, `bind.rs`):** tracks active occlusion query state and dropped draws (`note_dropped_draw`) so skipped draws and `resolve_query_data_x` stay coherent, guarding `orig_fn` with `real::is_adopted` (falling back to `GetGPUVirtualAddress`) and aligning `unbinding_all_heaps_lets_the_shared_heap_be_bound_again` with shared sampler heap binding. Part of #1833. **What is in it** - `crates/xcl/src/hle/d3d12x/console_heap.rs`, `list_x.rs`, `bind.rs`, `device_x.rs`, `real.rs` (`5` files; `0` changes in `present.rs`): - `shared_sampler_pages_preserve_zero_slot_and_clamp_tails` - `uav_format_promotion_and_linearization` - `occlusion_tracks_dropped_draws_and_active_counter` - `default_bound_heaps_always_includes_sampler_heap_when_available` **Tested** - Toolchain: Windows 11 x64, `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, rebased cleanly onto `0f293be` (`71639e0`). - `cargo check --workspace --tests`: passed. - `XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4`: passed (`shared_sampler_pages_preserve_zero_slot_and_clamp_tails`, `uav_format_promotion_and_linearization`, `occlusion_tracks_dropped_draws_and_active_counter`, `default_bound_heaps_always_includes_sampler_heap_when_available`, and `unbinding_all_heaps_lets_the_shared_heap_be_bound_again` included and passed). - Exact-head paired retail smoke passed on AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, release, `XCL_NETWORK=0`: 101% of main's frames, 101% of its peak commit, no crash and no device removal. - A predecessor paired run on RTX 3060 also completed without crashes or device removals; it is supporting evidence only because it predates current head. **Regression run** main: ```xcl-smoke xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1623 (PresentX 1623) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14648 MB ``` PR: ```xcl-smoke xcl-smoke v1 commit: 71639e02ba90f85d8ba36ef638402e8ee2971e28 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1636 (PresentX 1636) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Both blocks were produced by `scripts/smoke.ps1` from clean trees, with the same title and duration. This checks startup/menu stability; it does not prove that the run reached every path changed by this PR. **Not tested** - Full `cargo test --workspace` suite. - Targeted runtime exercise proving that the retail smoke reached the shared sampler heap, typed-UAV fallback and occlusion-query paths. - Intel and Linux/Wine/vkd3d-proton. **AI use** - Antigravity assisted with implementation and unit tests; the author reviewed the diff and test output. - Claude Code (Claude Opus 5.5) built the exact-head and main trees and ran the paired smoke report posted by the contributor; the blocks above are reproduced unchanged.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:38 UTC · original

Thanks @⁠Toons29 for running and sharing the exact-head 60 s scripts/smoke.ps1 pair on 71639e0 (0 device removals, 0 crashes) — added to the PR description!

**@⁠raylitebull** on GitHub · 2026-11-25 10:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7159963772) Thanks @⁠Toons29 for running and sharing the exact-head 60 s `scripts/smoke.ps1` pair on `71639e0` (0 device removals, 0 crashes) — added to the PR description!
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 10:52 UTC · original

Heads-up: main fails a unit test since this merge (cbfc67bc, still on aaa931b2), so "Build and test" fails on every PR's merge commit (seen on #1912's run, job 139149025089). main's own runs on both commits were cancelled, so they did not show it.

device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa panics with format 85 kept (left 28, right 85).

  • That test came with #1988 (587d77be). It expects B5G6R5 (85) with ALLOW_UNORDERED_ACCESS to keep its format and lose the flag.
  • 71639e02 from this PR promotes it to R8G8B8A8_UNORM (28) instead, and its own test at device_x.rs:1523 expects that.
  • From the code, 88 (B8G8R8X8, now promoted to 87) is next in the same list and would fail the same assert.

Reproduced on aaa931b2 with cargo test -p xcl --lib --release -- pc_resource_desc_strips_uav: 0 passed, 1 failed. Which behaviour is wanted is yours to say; the two tests can't both pass.

AI use: Claude Code (Claude Opus 5.5) found the failure, ran the test and wrote this note.

**@⁠Kalmarv** on GitHub · 2026-11-25 10:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1991#issuecomment-7160290051) Heads-up: `main` fails a unit test since this merge (`cbfc67bc`, still on `aaa931b2`), so "Build and test" fails on every PR's merge commit (seen on #1912's run, job 139149025089). `main`'s own runs on both commits were cancelled, so they did not show it. `device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` panics with `format 85 kept` (left 28, right 85). - That test came with #1988 (`587d77be`). It expects B5G6R5 (85) with ALLOW_UNORDERED_ACCESS to keep its format and lose the flag. - `71639e02` from this PR promotes it to R8G8B8A8_UNORM (28) instead, and its own test at `device_x.rs:1523` expects that. - From the code, 88 (B8G8R8X8, now promoted to 87) is next in the same list and would fail the same assert. Reproduced on `aaa931b2` with `cargo test -p xcl --lib --release -- pc_resource_desc_strips_uav`: 0 passed, 1 failed. Which behaviour is wanted is yours to say; the two tests can't both pass. AI use: Claude Code (Claude Opus 5.5) found the failure, ran the test and wrote this note.
This discussion has been locked. Commenting is limited to contributors.
No description provided.