shader: run SPIR-V subgroup compaction at Shader Model 6.0 #821

Manually merged
github merged 1 commit from gh-pr/821/head into gh-pr/821/base 2026-11-26 22:21:12 +00:00
Owner

@⁠Jess-Doit on GitHub · 2026-11-23 08:48 UTC · original
Jess-Doit:test/spirv-compaction-sm60 → main · +59 −30 · 5 files · 1 commits · merged 2026-11-23 09:08 UTC

## Change

Build the source-built SPIR-V subgroup compaction fixture and its direct HLSL control as cs_6_0 so the test can run on Windows 10 in-box D3D12. Gate only --spirv-compaction on SM 6.0 and WaveOps, and report the missing capability before creating a pipeline.

Use one thread to write the shared wave-width word. Validate each negative control against the complete mutated CPU reference, including guards, and treat a bad lane map at a supported width as a readback failure. Refs #768 and #791.

Verification

Tested commit 4ace7968090f11f16114681a804368fd71f1fa37 on Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230, SDK 10.0.26100.0, DXC 1.9.2602.17, and LunarG Vulkan SDK 1.4.363.0 SPIR-V tools.

Backend Observed width Debug and Release
GTX 1060 (32.0.15.6094) 32 Passed
In-box WARP (10.0.19041.5794) 4 Passed
App-local WARP 1.0.22 with Agility 1.620.2 8 Passed

Both masks matched all 328 words on the bridge and direct HLSL paths. Repeats were identical. The controls diverged from the original reference at words 65 and 257, and matched every word of their mutated references. All 72 compaction dispatches had zero D3D12 warnings and errors with the debug layer enabled.

With Python, DXC and the SPIR-V tools configured as in the experiment instructions, run the in-box checks:

$env:XBOX2WINDOWS_ADAPTER = 'GTX 1060'
$filter = '^(spirv_(compaction|sampler_views|ballot_extract|address_window|compare_sampler)_(hardware|warp)|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|docs_links)$'
foreach ($preset in @('dev', 'release')) {
    cmake --build --preset $preset --parallel 4 --target offscreen_check
    ctest --preset $preset --no-tests=error -V -R $filter
}

Each in-box configuration had seven passes, six expected SM 6.6 skips (address window, ballot extraction and comparison samplers on each adapter), and zero failures.

With separate out/build/app-local-dev and out/build/app-local-release builds configured using OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR, run:

$env:X2W_REQUIRE_SPIRV_TOOLS = '1'
$filter = '^(spirv_(compaction|sampler_views|ballot_extract|address_window|compare_sampler)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$'
foreach ($preset in @('dev', 'release')) {
    $build = "out/build/app-local-$preset"
    cmake --build $build --parallel 4 --target offscreen_check
    ctest --test-dir $build --no-tests=error -V -R $filter
}

App-local WARP passed all seven checks per configuration. python -B tests/docs_links_check.py, python -B tests/bidi_controls_check.py and git diff HEAD^ HEAD --check passed.

Evidence and follow-up

The source-built fixture and existing CPU reference are from #791. The intra-wave 31/32 boundary still needs a 64-lane adapter. The original replay tracked by #768 still needs its own observed width and intermediate readback.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact commands and results for the verification matrix.
  • I verified the existing negative controls.
  • I updated the experiment documentation.
  • I used only source-built fixtures.

AI-assisted.

**@⁠Jess-Doit** on GitHub · 2026-11-23 08:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/821) `Jess-Doit:test/spirv-compaction-sm60` → `main` · +59 −30 · 5 files · 1 commits · merged 2026-11-23 09:08 UTC ## Change Build the source-built SPIR-V subgroup compaction fixture and its direct HLSL control as `cs_6_0` so the test can run on Windows 10 in-box D3D12. Gate only `--spirv-compaction` on SM 6.0 and WaveOps, and report the missing capability before creating a pipeline. Use one thread to write the shared wave-width word. Validate each negative control against the complete mutated CPU reference, including guards, and treat a bad lane map at a supported width as a readback failure. Refs #768 and #791. ## Verification Tested commit `4ace7968090f11f16114681a804368fd71f1fa37` on Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230, SDK 10.0.26100.0, DXC 1.9.2602.17, and LunarG Vulkan SDK 1.4.363.0 SPIR-V tools. | Backend | Observed width | Debug and Release | | --- | ---: | --- | | GTX 1060 (32.0.15.6094) | 32 | Passed | | In-box WARP (10.0.19041.5794) | 4 | Passed | | App-local WARP 1.0.22 with Agility 1.620.2 | 8 | Passed | Both masks matched all 328 words on the bridge and direct HLSL paths. Repeats were identical. The controls diverged from the original reference at words 65 and 257, and matched every word of their mutated references. All 72 compaction dispatches had zero D3D12 warnings and errors with the debug layer enabled. With Python, DXC and the SPIR-V tools configured as in the [experiment instructions](docs/experiments.md#spir-v-subgroup-compaction-across-lane-widths), run the in-box checks: ```powershell $env:XBOX2WINDOWS_ADAPTER = 'GTX 1060' $filter = '^(spirv_(compaction|sampler_views|ballot_extract|address_window|compare_sampler)_(hardware|warp)|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|docs_links)$' foreach ($preset in @('dev', 'release')) { cmake --build --preset $preset --parallel 4 --target offscreen_check ctest --preset $preset --no-tests=error -V -R $filter } ``` Each in-box configuration had seven passes, six expected SM 6.6 skips (address window, ballot extraction and comparison samplers on each adapter), and zero failures. With separate `out/build/app-local-dev` and `out/build/app-local-release` builds configured using `OFFSCREEN_AGILITY_620_DIR` and `OFFSCREEN_WARP_DIR`, run: ```powershell $env:X2W_REQUIRE_SPIRV_TOOLS = '1' $filter = '^(spirv_(compaction|sampler_views|ballot_extract|address_window|compare_sampler)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$' foreach ($preset in @('dev', 'release')) { $build = "out/build/app-local-$preset" cmake --build $build --parallel 4 --target offscreen_check ctest --test-dir $build --no-tests=error -V -R $filter } ``` App-local WARP passed all seven checks per configuration. `python -B tests/docs_links_check.py`, `python -B tests/bidi_controls_check.py` and `git diff HEAD^ HEAD --check` passed. ## Evidence and follow-up The source-built fixture and existing CPU reference are from #791. The intra-wave 31/32 boundary still needs a 64-lane adapter. The original replay tracked by #768 still needs its own observed width and intermediate readback. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact commands and results for the verification matrix. - [x] I verified the existing negative controls. - [x] I updated the experiment documentation. - [x] I used only source-built fixtures. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:21:11 +00:00
github manually merged commit 4ace796809 into gh-pr/821/base 2026-11-26 22:21:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.