Bridge subgroup ballot bit extraction to HLSL #650

Merged
R0Y00 merged 1 commit from upstream-pr/656 into main 2026-11-22 18:18:03 +00:00
R0Y00 commented 2026-11-22 18:02:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T18:02:40Z.


Lower OpGroupNonUniformBallotBitExtract in the named uint32 SPIR-V profile for HLSL emission. Select the ballot vector component by index / 32 and test index modulo 32. Refs #218.

The source-built fixture compares 128 bit positions and 192 guard words. An adjacent-bit swap across 31/32 must produce exactly two mismatches. On Windows build 26200.9974 with the debug layer enabled, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818 both matched the positive reference and detected both wrong bits. Both runs reported zero debug errors.

Reproduce with ctest --preset dev --no-tests=error -R spirv_ballot_extract -V with SPIRV-Tools and SPIRV-Cross installed. The Linux job independently assembles, validates and cross-compiles the fixture.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6545812634 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/656). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T18:02:40Z. --- Lower OpGroupNonUniformBallotBitExtract in the named uint32 SPIR-V profile for HLSL emission. Select the ballot vector component by index / 32 and test index modulo 32. Refs #218. The source-built fixture compares 128 bit positions and 192 guard words. An adjacent-bit swap across 31/32 must produce exactly two mismatches. On Windows build 26200.9974 with the debug layer enabled, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818 both matched the positive reference and detected both wrong bits. Both runs reported zero debug errors. Reproduce with `ctest --preset dev --no-tests=error -R spirv_ballot_extract -V` with SPIRV-Tools and SPIRV-Cross installed. The Linux job independently assembles, validates and cross-compiles the fixture.
upstream-sync closed this pull request 2026-11-24 06:44:10 +00:00
rwZephyr commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T18:57:40Z.


Independent AMD verification on upstream main at edc2e54e7e75fcd7c0f13e98b47ba119d9a08268. AI-assisted report, tests run locally from unmodified Xbox2Windows source.

Windows 11 25H2 x64 build 26200.9974, MSVC 19.44.35230, Windows SDK 10.0.26100, DXC 1.8.2502.8, Python 3.12.10. The renderer selected the discrete RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP (1414:008c, 10.0.26100.9818). Both reported debug_layer=unavailable.

I built SPIRV-Tools v2025.5 with its pinned headers and SPIRV-Cross 57e4efc from Khronos source archives. With those tools on PATH, $intakePython pointing to the local Python environment, and the debug CRT DLLs staged beside the renderer:

cmake --preset dev "-DINTAKE_PYTHON=$intakePython"
cmake --build --preset dev --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT'
ctest --preset dev --no-tests=error -R '^spirv_(address_window|ballot_extract)_(hardware|warp)$' -V

Both spirv_ballot_extract tests passed. Vulkan 1.2 validation and the HLSL/DXIL steps completed. Each adapter matched all 320 words (128 output bits and 192 guards). Swapping the 31/32 references produced exactly two mismatches on each, with the first at word 31 (expected=00000000 actual=00000001). No unexpected mismatches or capability skips.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7083999606 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/656#issuecomment-7083999606). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T18:57:40Z. --- Independent AMD verification on upstream `main` at `edc2e54e7e75fcd7c0f13e98b47ba119d9a08268`. AI-assisted report, tests run locally from unmodified Xbox2Windows source. Windows 11 25H2 x64 build `26200.9974`, MSVC `19.44.35230`, Windows SDK `10.0.26100`, DXC `1.8.2502.8`, Python `3.12.10`. The renderer selected the discrete RX 9070 XT (`1002:7550`, driver `32.0.32029.2010`) and WARP (`1414:008c`, `10.0.26100.9818`). Both reported `debug_layer=unavailable`. I built [SPIRV-Tools v2025.5](https://github.com/KhronosGroup/SPIRV-Tools/releases/tag/v2025.5) with its pinned headers and [SPIRV-Cross `57e4efc`](https://github.com/KhronosGroup/SPIRV-Cross/tree/57e4efcc84112abcd426dc5ec248b5339bee04f2) from Khronos source archives. With those tools on `PATH`, `$intakePython` pointing to the local Python environment, and the debug CRT DLLs staged beside the renderer: ```powershell cmake --preset dev "-DINTAKE_PYTHON=$intakePython" cmake --build --preset dev --target offscreen_check $env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT' ctest --preset dev --no-tests=error -R '^spirv_(address_window|ballot_extract)_(hardware|warp)$' -V ``` Both `spirv_ballot_extract` tests passed. Vulkan 1.2 validation and the HLSL/DXIL steps completed. Each adapter matched all 320 words (128 output bits and 192 guards). Swapping the 31/32 references produced exactly two mismatches on each, with the first at word 31 (`expected=00000000 actual=00000001`). No unexpected mismatches or capability skips.
R0Y00 commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T19:06:34Z.


Full-package follow-up for #218. Replayed all 26,503 archive records through the frontend with the original four-entry address window, SM 6.6 and native 16-bit types. The table tracks the 2,168 records whose previous first blocker was BallotBitExtract. Records retain their archive multiplicity. Overall, 26,474 records generated HLSL, with all former HLSL successes retained. The 29 remaining frontend errors were PS records rejected for a MinLod texture operand.

Stage HLSL DXIL DXC errors DXC timeouts Hardware pipelines WARP pipelines Hardware output passed / tested WARP output passed / tested
PS 1361 257 1104 0 257 257 0/0 0/0
CS 807 29 736 42 29 27 1/1 0/1

Pipeline outcomes below distinguish time and memory limits from explicit API errors. DXC had 90 seconds per shader. Pipeline probes had a 45-second and 1,400 MiB limit.

  • PS — hardware: ok = 257; warp: ok = 257.
  • CS — hardware: ok = 29; warp: memory budget = 2, ok = 27.

For one package CS, two inputs exercised compaction, preserved slots and the atomic count. Both complete 1,024-word hardware readbacks matched, and the altered reference caught the count error. WARP differed at 57 and 65 words. The cause remains open. No independent expected pixels were established for this PS cohort. Pipeline creation alone does not measure rendered output.

The source-built mask fixture independently matched all 128 bit positions and 192 guards on both adapters. Swapping the expectations for bits 31 and 32 produced exactly two mismatches on each. Windows build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, debug layer enabled for the readbacks.

Most frequent first DXC diagnostic by stage:

  • PS — 850 records: no matching member function for call to 'Sample'. Across all first DXC errors, 1104 involved a call with a comparison sampler.
  • CS — 702 records: no matching member function for call to 'SampleLevel'. Across all first DXC errors, 736 involved a call with a comparison sampler.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084115192 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/656#issuecomment-7084115192). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T19:06:34Z. --- Full-package follow-up for #218. Replayed all 26,503 archive records through the frontend with the original four-entry address window, SM 6.6 and native 16-bit types. The table tracks the 2,168 records whose previous first blocker was BallotBitExtract. Records retain their archive multiplicity. Overall, 26,474 records generated HLSL, with all former HLSL successes retained. The 29 remaining frontend errors were PS records rejected for a MinLod texture operand. | Stage | HLSL | DXIL | DXC errors | DXC timeouts | Hardware pipelines | WARP pipelines | Hardware output passed / tested | WARP output passed / tested | |---|---:|---:|---:|---:|---:|---:|---:|---:| | PS | 1361 | 257 | 1104 | 0 | 257 | 257 | 0/0 | 0/0 | | CS | 807 | 29 | 736 | 42 | 29 | 27 | 1/1 | 0/1 | Pipeline outcomes below distinguish time and memory limits from explicit API errors. DXC had 90 seconds per shader. Pipeline probes had a 45-second and 1,400 MiB limit. - PS — hardware: ok = 257; warp: ok = 257. - CS — hardware: ok = 29; warp: memory budget = 2, ok = 27. For one package CS, two inputs exercised compaction, preserved slots and the atomic count. Both complete 1,024-word hardware readbacks matched, and the altered reference caught the count error. WARP differed at 57 and 65 words. The cause remains open. No independent expected pixels were established for this PS cohort. Pipeline creation alone does not measure rendered output. The source-built mask fixture independently matched all 128 bit positions and 192 guards on both adapters. Swapping the expectations for bits 31 and 32 produced exactly two mismatches on each. Windows build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, debug layer enabled for the readbacks. Most frequent first DXC diagnostic by stage: - PS — 850 records: `no matching member function for call to 'Sample'`. Across all first DXC errors, 1104 involved a call with a comparison sampler. - CS — 702 records: `no matching member function for call to 'SampleLevel'`. Across all first DXC errors, 736 involved a call with a comparison sampler.
rwZephyr commented 2026-11-24 06:48:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:08:30Z.


The reported CS SampleLevel diagnostic matches the one I reproduced with a source-built shader in #670. The sampler-split prototype compiles that fixture and matches all outputs and guards on RX 9070 XT and WARP. That evidence is limited to the public fixture. The effect on the 807-record CS cohort and the separate WARP readback discrepancy remain open. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084140664 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/656#issuecomment-7084140664). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:08:30Z. --- The reported CS `SampleLevel` diagnostic matches the one I reproduced with a source-built shader in [#670](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084034682). The [sampler-split prototype](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084115150) compiles that fixture and matches all outputs and guards on RX 9070 XT and WARP. That evidence is limited to the public fixture. The effect on the 807-record CS cohort and the separate WARP readback discrepancy remain open. AI-assisted.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!650
No description provided.