dxil: mark UAVs as Rasterizer-Ordered Views in POPS pixel shaders #1949

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

@⁠raylitebull on GitHub · 2026-11-24 23:48 UTC · original
raylitebull:feat/pops-rov → main · +138 −8 · 4 files · 1 commits · merged 2026-11-25 01:58 UTC

Marks UAV handles as Rasterizer-Ordered Views (IsROV) and sets the DXIL Rovs shader feature/flag (0x1000 / bit 18) when compiling Primitive Ordered Pixel Shading (POPS) pixel shaders in the direct RDNA2 -> DXIL translator, preserving primitive-ordered UAV accesses on D3D12 instead of unordered writes.

Part of #1269 and #1833.

What is in it

  • crates/xcl/src/gpu/dxil/kernel.rs (uses_pops): detect POPS pixel shaders (Stage::Pixel) reading src_pops_exiting_wave_id (operand 239) or accessing HW_REG_POPS_PACKER (25), and enable ROV marking via s.enable_rov().
  • crates/xcl/src/gpu/dxil/ops.rs & module.rs: add Feature::Rovs (shader feature flag 0x1000 / tag 18), Binding.rov, has_rov_handle(), and DxilModule::annotate_uav(..., rov: bool) emitting the IsROV (0x2000) annotation flag on dx.op.annotateHandle.
  • crates/xcl/src/gpu/dxil/shader.rs: propagate rov into UAV resource bindings, heap UAV annotations, and Feature::Rovs emission when rov bindings or has_rov_handle() are present; add 3 dxil.dll 1.8-validated unit tests in pops_rov_tests (pops_pixel_shader_marks_uavs_as_rov_and_validates, pops_pixel_shader_without_uavs_on_heap_windows_validates_cleanly, non_pops_pixel_shader_does_not_mark_rovs).

Tested

  • Hardware & toolchain: AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64), Windows 11 x64 (10.0.22631.0), rustc 1.99.1 (58cf8f9c3 2026-10-13), DXC 1.8.2502.11, rebased onto 62265d3 (1f8d4be).
  • cargo check --workspace --tests and cargo test -p xcl --lib pops (3 passed, 0 failed; dxil.dll 1.8 validation passing across all 3 pops_rov_tests cases).
  • Independent NVIDIA RTX 5070 Ti verification on 1f8d4be (@⁠futurepro62, driver 621.40, rustc 1.100.0, DXC 1.9.2602.17): XCL_REQUIRE_GPU=mesh cargo test --workspace passed 979/0/43 (with pre-existing #1651/fuzz_tests skipped on both base and PR), including all 3 pops_rov_tests.
  • Independent NVIDIA RTX 3060 60 s scripts/smoke.ps1 pair on 1f8d4be vs 62265d3 (@⁠Anon64, driver 581.80, release): 1610/1629 frames, 0 device removals, 0 crashes.

Regression run
60 s scripts/smoke.ps1 pair on NVIDIA GeForce RTX 3060 (Windows 11 26200, driver 581.80, release, XCL_NETWORK=0), contributed by @⁠Anon64:

main:

xcl-smoke v1
commit: 62265d3bbde2255f849fb650cc29872df91a4cf0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1629 (PresentX 1629)
presents per 2 s (last 3): 60 60 47
device removals: 0
crashes: 0
peak commit: 23489 MB

PR:

xcl-smoke v1
commit: 1f8d4bec4eb6ae9beaaa9d03758cc99e05aab03b
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1610 (PresentX 1610)
presents per 2 s (last 3): 60 41 48
device removals: 0
crashes: 0
peak commit: 24041 MB

Not tested

  • Independent AMD GPU verification and runtime GPU ordering execution of POPS pixel shaders on AMD / NVIDIA / Intel hardware, wave32-only AMD adapters, and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity (Claude Opus 4.6) assisted with implementation and DXIL validation tests; the author reviewed the diff and test output.
**@⁠raylitebull** on GitHub · 2026-11-24 23:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1949) `raylitebull:feat/pops-rov` → `main` · +138 −8 · 4 files · 1 commits · merged 2026-11-25 01:58 UTC Marks UAV handles as Rasterizer-Ordered Views (`IsROV`) and sets the DXIL `Rovs` shader feature/flag (`0x1000` / bit 18) when compiling Primitive Ordered Pixel Shading (POPS) pixel shaders in the direct RDNA2 -> DXIL translator, preserving primitive-ordered UAV accesses on D3D12 instead of unordered writes. Part of #1269 and #1833. **What is in it** - `crates/xcl/src/gpu/dxil/kernel.rs` (`uses_pops`): detect POPS pixel shaders (`Stage::Pixel`) reading `src_pops_exiting_wave_id` (operand 239) or accessing `HW_REG_POPS_PACKER` (`25`), and enable ROV marking via `s.enable_rov()`. - `crates/xcl/src/gpu/dxil/ops.rs` & `module.rs`: add `Feature::Rovs` (shader feature flag `0x1000` / tag `18`), `Binding.rov`, `has_rov_handle()`, and `DxilModule::annotate_uav(..., rov: bool)` emitting the `IsROV` (`0x2000`) annotation flag on `dx.op.annotateHandle`. - `crates/xcl/src/gpu/dxil/shader.rs`: propagate `rov` into UAV resource bindings, heap UAV annotations, and `Feature::Rovs` emission when `rov` bindings or `has_rov_handle()` are present; add 3 `dxil.dll 1.8`-validated unit tests in `pops_rov_tests` (`pops_pixel_shader_marks_uavs_as_rov_and_validates`, `pops_pixel_shader_without_uavs_on_heap_windows_validates_cleanly`, `non_pops_pixel_shader_does_not_mark_rovs`). **Tested** - Hardware & toolchain: AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64), Windows 11 x64 (`10.0.22631.0`), `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, DXC `1.8.2502.11`, rebased onto `62265d3` (`1f8d4be`). - `cargo check --workspace --tests` and `cargo test -p xcl --lib pops` (3 passed, 0 failed; `dxil.dll 1.8` validation passing across all 3 `pops_rov_tests` cases). - Independent NVIDIA RTX 5070 Ti verification on `1f8d4be` (@⁠futurepro62, driver `621.40`, `rustc 1.100.0`, DXC `1.9.2602.17`): `XCL_REQUIRE_GPU=mesh cargo test --workspace` passed `979/0/43` (with pre-existing `#1651`/`fuzz_tests` skipped on both base and PR), including all 3 `pops_rov_tests`. - Independent NVIDIA RTX 3060 60 s `scripts/smoke.ps1` pair on `1f8d4be` vs `62265d3` (@⁠Anon64, driver `581.80`, release): `1610/1629` frames, `0` device removals, `0` crashes. **Regression run** 60 s `scripts/smoke.ps1` pair on NVIDIA GeForce RTX 3060 (Windows 11 26200, driver `581.80`, release, `XCL_NETWORK=0`), contributed by @⁠Anon64: main: ``` xcl-smoke v1 commit: 62265d3bbde2255f849fb650cc29872df91a4cf0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1629 (PresentX 1629) presents per 2 s (last 3): 60 60 47 device removals: 0 crashes: 0 peak commit: 23489 MB ``` PR: ``` xcl-smoke v1 commit: 1f8d4bec4eb6ae9beaaa9d03758cc99e05aab03b gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1610 (PresentX 1610) presents per 2 s (last 3): 60 41 48 device removals: 0 crashes: 0 peak commit: 24041 MB ``` **Not tested** - Independent AMD GPU verification and runtime GPU ordering execution of POPS pixel shaders on AMD / NVIDIA / Intel hardware, wave32-only AMD adapters, and Linux/Wine/vkd3d-proton. **AI use** - Antigravity (Claude Opus 4.6) assisted with implementation and DXIL validation tests; the author reviewed the diff and test output.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:06 +00:00
github manually merged commit 1f8d4bec4e into gh-pr/1949/base 2026-11-26 05:11:08 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 23:58 UTC · original · edited 2026-11-25 00:12 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 1f8d4be (on its base 62265d3).

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::dxil::fuzz_tests: 979 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: pops_pixel_shader_marks_uavs_as_rov_and_validates, pops_pixel_shader_without_uavs_on_heap_windows_validates_cleanly, non_pops_pixel_shader_does_not_mark_rovs.
  • 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: 988 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 62265d3 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (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-24 23:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1949#issuecomment-7147994526) · edited 2026-11-25 00:12 UTC Full-suite run, since this PR has no test report yet. Tested exact head `1f8d4be` (on its base `62265d3`). **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::dxil::fuzz_tests`: **979 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: `pops_pixel_shader_marks_uavs_as_rov_and_validates`, `pops_pixel_shader_without_uavs_on_heap_windows_validates_cleanly`, `non_pops_pixel_shader_does_not_mark_rovs`. - 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`: **988 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 `62265d3` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([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

@⁠Anon64 on GitHub · 2026-11-25 00:18 UTC · original

Regression run for this PR: head 1f8d4be, based on main 62265d3. 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 62265d3:

xcl-smoke v1
commit: 62265d3bbde2255f849fb650cc29872df91a4cf0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1629 (PresentX 1629)
presents per 2 s (last 3): 60 60 47
device removals: 0
crashes: 0
peak commit: 23489 MB

this PR:

xcl-smoke v1
commit: 1f8d4bec4eb6ae9beaaa9d03758cc99e05aab03b
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1610 (PresentX 1610)
presents per 2 s (last 3): 60 41 48
device removals: 0
crashes: 0
peak commit: 24041 MB

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

Not tested: the whole suite; the direct DXIL path this PR changes (these runs use the default HLSL path, XCL_DIRECT_DXIL unset).

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

**@⁠Anon64** on GitHub · 2026-11-25 00:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1949#issuecomment-7148373460) Regression run for this PR: head `1f8d4be`, based on `main` `62265d3`. 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 `62265d3`: ``` xcl-smoke v1 commit: 62265d3bbde2255f849fb650cc29872df91a4cf0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1629 (PresentX 1629) presents per 2 s (last 3): 60 60 47 device removals: 0 crashes: 0 peak commit: 23489 MB ``` this PR: ``` xcl-smoke v1 commit: 1f8d4bec4eb6ae9beaaa9d03758cc99e05aab03b gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1610 (PresentX 1610) presents per 2 s (last 3): 60 41 48 device removals: 0 crashes: 0 peak commit: 24041 MB ``` No device removals or crashes; 98 % of main's frames, 102 % of its peak commit. **Not tested:** the whole suite; the direct DXIL path this PR changes (these runs use the default HLSL path, `XCL_DIRECT_DXIL` unset). Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

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

@⁠Anon64 Thank you for the RTX 3060 60 s regression pair on 1f8d4be (1610/1629 frames, 0 removals/crashes) — absorbed into the PR description! Also thanks @⁠futurepro62 for the RTX 5070 Ti full-suite pass (979/0/43). Independent AMD verification is still invited before merging.

**@⁠raylitebull** on GitHub · 2026-11-25 00:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1949#issuecomment-7148412312) @⁠Anon64 Thank you for the RTX 3060 60 s regression pair on 1f8d4be (1610/1629 frames, 0 removals/crashes) — absorbed into the PR description! Also thanks @⁠futurepro62 for the RTX 5070 Ti full-suite pass (979/0/43). Independent AMD verification is still invited before merging.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 02:50 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 02:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/1949#issuecomment-7151257540) 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!
This discussion has been locked. Commenting is limited to contributors.
No description provided.