Skip to content

GPU tests: verify wave32 VCC_HI compares under a partial EXEC mask - #8621

Closed
vgineer wants to merge 1 commit into
ProjectLeonida:mainfrom
vgineer:vgineer/wave32-vcc-hi-gpu-readback
Closed

vgineer wants to merge 1 commit into
ProjectLeonida:mainfrom
vgineer:vgineer/wave32-vcc-hi-gpu-readback

Conversation

@vgineer

@vgineer vgineer commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: wave32 VCC_HI hardware readback

Depends on: #8448

What and why

Add a hand-written wave32 compute shader to both GPU test runners. It initializes VCC_HI to all ones, compares under a sparse EXEC_LO, and then restores EXEC_LO before reading the result. A scalar equality check observes the entire high word. Two per-lane conditional moves independently observe VCC_HI and VCC_LO. A destination alias, stale bits outside EXEC, or a wrong lane mask changes the output.

Tested

AI-assisted: yes (Codex).

  • The fixture is hand-written. All three changed files contain only test code.

@ErayOzdayioglu

Copy link
Copy Markdown

Tested f9c7624 with #8448 (47494e7) merged on top, as the description says, on an RDNA2 GPU (the description's run was a Turing card) plus a second NVIDIA card. Windows 11 26200, MSVC 14.51 (VS 2026), llvm-mc 23.1.6. The test programs were built from main 867d922. pass

GPU native LEONIDA_W64_EMULATE=1
Radeon iGPU, Ryzen 5 7600 (RDNA2, subgroup 32..64, AMD 32.0.21042.62) pass pass
RTX 5070 (617.42, subgroup 32) pass pass

AI-assisted: yes

@Kev-Ball

Copy link
Copy Markdown

Tested f9c762435 with its #8448 dependency (47494e725) on an RTX 3080 Ti, NVIDIA 620.73.04, CachyOS, native subgroup size 32. The stock cs_w32_vcc_hi_compare translated, passed spirv-val, and passed the public GPU runner (1/1). An independent buffer readback matched the expected result in all 32 lanes. The 32 guard words beyond the output retained their initial fill.

I also checked whether the fixture detects an incorrect high mask bit even though the runner compares only the first eight output words. In a scratch copy I changed the second compare’s active lanes and threshold to produce VCC_HI = 0x800015 instead of 0x15. That preserves the low eight mask bits and sets bit 23. I left the fixture’s scalar equality check and the runner’s expected values unchanged.

The mutated shader still passed spirv-val. Its first eight output words changed from 9 8 11 8 9 8 8 8 to 1 0 3 0 1 0 0 0, and the public runner correctly reported FAIL, 0/1, exit 1. The independent readback matched all 32 predicted mutant outputs, including lane 23, with all guard words intact. This confirms the scalar full-word check makes a high-bit error visible to the runner on Ampere.

Synthetic fixtures only. AI-assisted QA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants