Tests: verify heap-window GPU equivalence and graphics validation #2408

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

@⁠emusynths on GitHub · 2026-11-25 18:01 UTC · original
emusynths:heap_windows_correctness_tests → main · +250 −0 · 1 files · 1 commits · merged 2026-11-25 19:43 UTC

Adds GPU output-equivalence and multi-stage validation tests for XCL_HEAP_WINDOWS=1 across both the HLSL and direct DXIL paths. Part of #2088 (Workstream 5 correctness gates); test-only and orthogonal to #1695, #1743, and #2383.

What is in it

  • crates/xcl/src/gpu/recomp/heap_window_tests.rs:
    • gpu_heap_windows_divergent_lanes_match_switch_form: executes divergent per-lane window indexing (NonUniformResourceIndex: window 0, window 1, and out-of-UMA aliasing w0 in the same wave) for loads, stores, and 32-bit atomics, verifying bit-for-bit agreement across HLSL switch, HLSL heap, direct DXIL switch, and direct DXIL heap.
    • gpu_heap_windows_64bit_atomics_match_switch_form: executes GLOBAL_ATOMIC_ADD_X2 (carrying across the 32-bit boundary) and GLOBAL_ATOMIC_CMPSWAP_X2 in window 1 plus out-of-UMA 64-bit atomics across all four variants (skips via skip_test if AtomicInt64OnDescriptorHeapResourceSupported is unsupported).
    • heap_windows_graphics_stages_validate: validates 4- and 16-window HEAP_WINDOWS shaders across VS, PS, and MS in both direct DXIL and HLSL+DXC (GS is covered separately in #2383).

Tested

  • Hardware: NVIDIA GeForce RTX 5090 32 GB (driver 621.01, wave32-only), Ryzen 9 5950X, 64 GB RAM, Windows x64, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, debug.
  • cargo test -p xcl --lib heap_window_tests: 4 passed, 0 failed, 0 ignored (default and with XCL_HEAP_WINDOWS=1).
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1287 passed, 5 failed, 46 ignored.
    • The 5 failures are pre-existing on main 50a9fde on this adapter/DXC: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState: 0x8007000E) and gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier.
    • SKIPPED: wave64-only GPU tests (no wave64 on RTX 5090), per-lane f16 refused tests, heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows in default run), pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off).

Not tested

  • AMD / Intel GPUs and native wave64 hardware.
  • Retail title runtime run (test-only diff; no runtime code changed).

AI use

  • Antigravity with Gemini 4 Neon: wrote the tests and PR description, and ran the test suite. I reviewed the diff and results.
**@⁠emusynths** on GitHub · 2026-11-25 18:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2408) `emusynths:heap_windows_correctness_tests` → `main` · +250 −0 · 1 files · 1 commits · merged 2026-11-25 19:43 UTC Adds GPU output-equivalence and multi-stage validation tests for `XCL_HEAP_WINDOWS=1` across both the HLSL and direct DXIL paths. Part of #2088 (Workstream 5 correctness gates); test-only and orthogonal to #1695, #1743, and #2383. **What is in it** - `crates/xcl/src/gpu/recomp/heap_window_tests.rs`: - `gpu_heap_windows_divergent_lanes_match_switch_form`: executes divergent per-lane window indexing (`NonUniformResourceIndex`: window 0, window 1, and out-of-UMA aliasing `w0` in the same wave) for loads, stores, and 32-bit atomics, verifying bit-for-bit agreement across HLSL switch, HLSL heap, direct DXIL switch, and direct DXIL heap. - `gpu_heap_windows_64bit_atomics_match_switch_form`: executes `GLOBAL_ATOMIC_ADD_X2` (carrying across the 32-bit boundary) and `GLOBAL_ATOMIC_CMPSWAP_X2` in window 1 plus out-of-UMA 64-bit atomics across all four variants (skips via `skip_test` if `AtomicInt64OnDescriptorHeapResourceSupported` is unsupported). - `heap_windows_graphics_stages_validate`: validates 4- and 16-window `HEAP_WINDOWS` shaders across VS, PS, and MS in both direct DXIL and HLSL+DXC (GS is covered separately in #2383). **Tested** - Hardware: NVIDIA GeForce RTX 5090 32 GB (driver 621.01, wave32-only), Ryzen 9 5950X, 64 GB RAM, Windows x64, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC 1.9.2609.5, debug. - `cargo test -p xcl --lib heap_window_tests`: 4 passed, 0 failed, 0 ignored (default and with `XCL_HEAP_WINDOWS=1`). - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: 1287 passed, 5 failed, 46 ignored. - The 5 failures are pre-existing on `main` `50a9fde` on this adapter/DXC: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`CreateComputePipelineState: 0x8007000E`) and `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`. - `SKIPPED`: wave64-only GPU tests (no wave64 on RTX 5090), per-lane f16 refused tests, `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows in default run), `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode off). **Not tested** - AMD / Intel GPUs and native wave64 hardware. - Retail title runtime run (test-only diff; no runtime code changed). **AI use** - Antigravity with Gemini 4 Neon: wrote the tests and PR description, and ran the test suite. I reviewed the diff and results.
Add correctness-gate tests for XCL_HEAP_WINDOWS=1 in heap_window_tests.rs:
- divergent per-lane window indexing (NonUniformResourceIndex: w0, w1, OOB)
  comparing HLSL switch/heap and direct DXIL switch/heap bit-for-bit on GPU,
- 64-bit atomics (GLOBAL_ATOMIC_ADD_X2 carry, GLOBAL_ATOMIC_CMPSWAP_X2, OOB),
- 4- and 16-window HEAP_WINDOWS validation across VS, PS, and MS stages.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:59 +00:00
github manually merged commit e41528c7c3 into gh-pr/2408/base 2026-11-26 05:30:01 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-25 18:20 UTC · original

AMD native wave64 run (listed as untested), plus an RTX 3060: all three new tests run (no skip on either card, so both have the 64-bit heap atomic caps) and pass.

Head 8bc8128 applied on main 569f0fc, debug, Windows 11 Pro 26200, cargo test -p xcl --lib -- heap_window --test-threads=4:

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010, waves 32..64): 8 passed, 0 failed, no SKIPPED. gpu_heap_windows_divergent_lanes_match_switch_form, gpu_heap_windows_64bit_atomics_match_switch_form and heap_windows_graphics_stages_validate ok.
  • RTX 3060 (driver 32.0.16.1088): the same 8 passed, 0 failed, no SKIPPED.

Not tested: Intel, XCL_HEAP_WINDOWS=1 in a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-25 18:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2408#issuecomment-7170782097) AMD native wave64 run (listed as untested), plus an RTX 3060: all three new tests run (no skip on either card, so both have the 64-bit heap atomic caps) and pass. Head `8bc8128` applied on `main` `569f0fc`, debug, Windows 11 Pro 26200, `cargo test -p xcl --lib -- heap_window --test-threads=4`: - **RX 9070 XT** (RDNA4, driver 32.0.32029.2010, waves 32..64): 8 passed, 0 failed, no SKIPPED. `gpu_heap_windows_divergent_lanes_match_switch_form`, `gpu_heap_windows_64bit_atomics_match_switch_form` and `heap_windows_graphics_stages_validate` ok. - **RTX 3060** (driver 32.0.16.1088): the same 8 passed, 0 failed, no SKIPPED. Not tested: Intel, `XCL_HEAP_WINDOWS=1` in a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

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

Independent AMD RDNA4 (native wave64) test report on exact head 8bc8128ba5cde78bd2baa3ba6430ca7b2f6e16c2 (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: 1289 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.
    • All 3 PR tests passed (no skips): gpu::recomp::heap_window_tests::gpu_heap_windows_divergent_lanes_match_switch_form, gpu_heap_windows_64bit_atomics_match_switch_form, and heap_windows_graphics_stages_validate.
    • 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: 8bc8128ba5cde78bd2baa3ba6430ca7b2f6e16c2
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13923 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:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2408#issuecomment-7170814551) Independent AMD RDNA4 (native wave64) test report on exact head `8bc8128ba5cde78bd2baa3ba6430ca7b2f6e16c2` (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`: **1289 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. - All 3 PR tests passed (no skips): `gpu::recomp::heap_window_tests::gpu_heap_windows_divergent_lanes_match_switch_form`, `gpu_heap_windows_64bit_atomics_match_switch_form`, and `heap_windows_graphics_stages_validate`. - 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: 8bc8128ba5cde78bd2baa3ba6430ca7b2f6e16c2 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1603 (PresentX 1603) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13923 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/2408#issuecomment-7172337258) 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

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

Independent Windows/NVIDIA check of clean e41528c, the current test-only head of #2408. RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, SDK DXC/DXIL 1.8.2502.11. Offline Cargo, XCL_ADAPTER=RTX 3080 Ti, XCL_NETWORK=0, no sample data.

Tested

  • cargo test --offline --locked -p xcl --lib heap_window_tests --jobs 6 -- --test-threads=1 --nocapture, with XCL_D3D12_DEBUG=1: 4 passed, 0 failed, 0 ignored, 0 skipped. The divergent-window and 64-bit-atomic cases executed on the GPU and compared HLSL/direct DXIL, switch/heap outputs. The graphics-stage case validated shaders; it did not render a frame.
  • cargo build --offline --locked --workspace --jobs 6: passed.
  • cargo test --offline --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --nocapture, with the debug-layer override unset: 1,368 passed, 0 failed, 46 ignored, including 26 runtime skip notices. The four heap-window tests passed again.

Not tested: AMD/Intel, retail runtime, or performance. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2408#issuecomment-7172356377) Independent Windows/NVIDIA check of clean [e41528c](https://github.com/xcl-dev/xcl/commit/e41528c7c333168bb6c3dc04e2e4b83e3a1e4a93), the current test-only head of #2408. RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, SDK DXC/DXIL 1.8.2502.11. Offline Cargo, `XCL_ADAPTER=RTX 3080 Ti`, `XCL_NETWORK=0`, no sample data. **Tested** - `cargo test --offline --locked -p xcl --lib heap_window_tests --jobs 6 -- --test-threads=1 --nocapture`, with `XCL_D3D12_DEBUG=1`: **4 passed, 0 failed, 0 ignored, 0 skipped**. The divergent-window and 64-bit-atomic cases executed on the GPU and compared HLSL/direct DXIL, switch/heap outputs. The graphics-stage case validated shaders; it did not render a frame. - `cargo build --offline --locked --workspace --jobs 6`: passed. - `cargo test --offline --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --nocapture`, with the debug-layer override unset: **1,368 passed, 0 failed, 46 ignored**, including **26 runtime skip notices**. The four heap-window tests passed again. **Not tested:** AMD/Intel, retail runtime, or performance. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:43 UTC · original

Merging: the GPU compares switch and heap windows, on HLSL and direct DXIL, for divergent lanes and 64-bit atomics, and validates the graphics stages.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug: main 06055a7 with #2333, #2097, #2368, #2408 and #2383 merged locally. Whole suite: 1422 passed, 2 failed, 46 ignored, 7 SKIPPED. With XCL_DIRECT_DXIL=1, cargo test -p xcl --lib -- gpu:: hle::d3d12x: 952 passed, 2 failed, 24 ignored. The two failures are fuzz_validate_and_gpu_1 and _3, which fail the same way on main here. The new tests ran here without a skip. a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, reported above, is not from this PR: its check was fixed on main by #2420.

AI use: Claude Code (Claude Opus 5.5) read the diff and the thread, ran the tests and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 19:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2408#issuecomment-7172681893) Merging: the GPU compares switch and heap windows, on HLSL and direct DXIL, for divergent lanes and 64-bit atomics, and validates the graphics stages. Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug: `main` `06055a7` with #2333, #2097, #2368, #2408 and #2383 merged locally. Whole suite: 1422 passed, 2 failed, 46 ignored, 7 SKIPPED. With `XCL_DIRECT_DXIL=1`, `cargo test -p xcl --lib -- gpu:: hle::d3d12x`: 952 passed, 2 failed, 24 ignored. The two failures are `fuzz_validate_and_gpu_1` and `_3`, which fail the same way on `main` here. The new tests ran here without a skip. `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, reported above, is not from this PR: its check was fixed on `main` by #2420. AI use: Claude Code (Claude Opus 5.5) read the diff and the thread, ran the tests and wrote this on the maintainer's behalf.
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/2408#issuecomment-7180741069) 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 discussion has been locked. Commenting is limited to contributors.
No description provided.