AGC: scalar Wave32 VCC mask repeats on 8-lane Vulkan subgroups #25298

Open
opened 2026-11-21 21:47:25 +00:00 by mihiii1337 · 0 comments
mihiii1337 commented 2026-11-21 21:47:25 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-21T21:47:25Z.


The current-main reproduction uses a scalar s_mov_b32 to VCC_LO and plain v_cndmask_b32. The original SDWA clamp reproduction below is historical after #25300.

What happens

agc_driver_integer_sdwa_output_modifiers returns 0xffff7fff for lane 8's v_cndmask_b32 clamp; the expected value is 0x00000080. The same lane and values fail on the 8-lane software adapter in Linux CI and in a local Windows comparison.

Title, test or build step

agc_driver_integer_sdwa_output_modifiers

AnyPS5 commit

  • Linux CI built main at d8ecf92a4e69e86b2f8b6aedecdbc9129709cf48.
  • Local Windows comparison used the same built executables and libraries in all nine runs. It used the existing e60b2f74ad native build with the shader recompiler source tree and the test fixture taken from d8ecf92a4e.

System

Linux CI selected llvmpipe (LLVM 21.1.8), subgroup size 8. Locally, Windows 11 build 26300, i7-14650HX, WinLibs GCC 15.2 Release. The software run used the checksum-pinned Mesa 26.2.6 Windows asset from the project's workflow. The Vulkan validation layer was 1.4.369.

Steps to reproduce

Build agc_driver_integer_sdwa_output_modifiers_tests on the CI commit. Select an 8-lane lavapipe ICD for the process (I used VK_DRIVER_FILES for the Windows software run). Set ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer and run:

ctest --test-dir build -R '^agc_driver_integer_sdwa_output_modifiers$' -V

The local software runs fail within one second. Verify the Selected GPU log names llvmpipe and shows subgroup=8.

Log

Selected GPU name=llvmpipe (LLVM 23.1.4, 256 bits) vendor=0x10005 device=0x0 subgroup=8
AGC graphics: integer sdwa output modifiers: lane 8 v_cndmask_b32 clamp of 0x00000080, 0xffff7fff is 0xffff7fff, expected 0x00000080

What was checked

Selected Windows adapter Subgroup size Result
RTX 4070 Laptop (10de:2860), 621.01 32 3/3 passed
Intel UHD / Raptor Lake-S Mobile (8086:a78b), 31.0.101.5081 32 3/3 passed
lavapipe / llvmpipe (LLVM 23.1.4) 8 0/3 passed, identical lane 8 mismatch

All nine logs show the Khronos layer inserted and zero VUID- or SYNC-HAZARD messages. No title was needed.

The fixture uses a 32-thread wave and writes 0x96a596a5 into VCC_LO. Bit 8 is clear and bit 0 is set. The returned value is exactly lane 8's second input. This is consistent with the second 8-lane host subgroup using local lane 0 when selecting the bit. The source path uses threadBit(LaneId()) on the VCC_LO write and emits SubgroupLocalInvocationId for this non-spanned compute shader. This accounts for the observed mismatch; I did not test other instructions that read the VCC mask.

The exact test and error text led to merged #19566. I found no open issue or PR covering this 8-lane case.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6534807441 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/25298). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-21T21:47:25Z. --- The [current-main reproduction](https://github.com/boykopovar/AnyPS5/issues/25298#issuecomment-7071194396) uses a scalar `s_mov_b32` to VCC_LO and plain `v_cndmask_b32`. The original SDWA clamp reproduction below is historical after #25300. ### What happens `agc_driver_integer_sdwa_output_modifiers` returns `0xffff7fff` for lane 8's `v_cndmask_b32 clamp`; the expected value is `0x00000080`. The same lane and values fail on the 8-lane software adapter in Linux CI and in a local Windows comparison. ### Title, test or build step `agc_driver_integer_sdwa_output_modifiers` ### AnyPS5 commit - [Linux CI](https://github.com/boykopovar/AnyPS5/actions/runs/44947807350/job/136981534866) built `main` at `d8ecf92a4e69e86b2f8b6aedecdbc9129709cf48`. - Local Windows comparison used the same built executables and libraries in all nine runs. It used the existing `e60b2f74ad` native build with the shader recompiler source tree and the test fixture taken from `d8ecf92a4e`. ### System Linux CI selected llvmpipe (LLVM 21.1.8), subgroup size 8. Locally, Windows 11 build 26300, i7-14650HX, WinLibs GCC 15.2 Release. The software run used the checksum-pinned Mesa 26.2.6 Windows asset from the project's workflow. The Vulkan validation layer was 1.4.369. ### Steps to reproduce Build `agc_driver_integer_sdwa_output_modifiers_tests` on the CI commit. Select an 8-lane lavapipe ICD for the process (I used `VK_DRIVER_FILES` for the Windows software run). Set `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `APS5_NO_PIPELINE_JOURNAL=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer` and run: ```sh ctest --test-dir build -R '^agc_driver_integer_sdwa_output_modifiers$' -V ``` The local software runs fail within one second. Verify the `Selected GPU` log names llvmpipe and shows `subgroup=8`. ### Log ```text Selected GPU name=llvmpipe (LLVM 23.1.4, 256 bits) vendor=0x10005 device=0x0 subgroup=8 AGC graphics: integer sdwa output modifiers: lane 8 v_cndmask_b32 clamp of 0x00000080, 0xffff7fff is 0xffff7fff, expected 0x00000080 ``` ### What was checked | Selected Windows adapter | Subgroup size | Result | | --- | ---: | ---: | | RTX 4070 Laptop (10de:2860), 621.01 | 32 | 3/3 passed | | Intel UHD / Raptor Lake-S Mobile (8086:a78b), 31.0.101.5081 | 32 | 3/3 passed | | lavapipe / llvmpipe (LLVM 23.1.4) | 8 | 0/3 passed, identical lane 8 mismatch | All nine logs show the Khronos layer inserted and zero `VUID-` or `SYNC-HAZARD` messages. No title was needed. The fixture uses a 32-thread wave and writes `0x96a596a5` into VCC_LO. Bit 8 is clear and bit 0 is set. The returned value is exactly lane 8's second input. This is consistent with the second 8-lane host subgroup using local lane 0 when selecting the bit. The source path uses `threadBit(LaneId())` on the VCC_LO write and emits `SubgroupLocalInvocationId` for this non-spanned compute shader. This accounts for the observed mismatch; I did not test other instructions that read the VCC mask. The exact test and error text led to merged #19566. I found no open issue or PR covering this 8-lane case. AI-assisted: yes
Sign in to join this conversation.
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
boykopovar/AnyPS5#25298
No description provided.