Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 4f760c1a on Windows 11, all eight affected suites:
test_wave32_pixel_subgroup64.py3 OK (new),test_control_flow_exec.py13 OK,test_control_flow_vcc.py24 OK,test_mbcnt_lo_hi.py28 OK,test_salu_wqm32.py7 OK,test_scalar_alu_abs_neg.py36 OK,test_scalar_bitcmp.py21 OK,test_vs_readfirstlane.py5 OK.compileallandgit diff --checkclean.
The approach is consistent: a wave32 PS maps its logical lane to subgroup_lane & 31, maps a source lane back into the invocation's 32-lane half (half | (lane & 31)), takes the matching word of a 64-lane ballot, and limits votes/ballot-mask operations to that half. EXEC/VCC masks and cross-lane ops stay per-half, which is the documented wave32-in-64-lane-subgroup rule. I cannot run the 64-lane fragment case on this NVIDIA host (32-wide only); the new semantic cases drive it through the interpreter. No blocking issue.
|
Apple M2 data point for the stricter checker. Tested head 4f760c1 on Apple M2 (Mac14,3), macOS 26.4, MoltenVK 1.4.2 (direct), subgroup 4..32, llvm-mc 23.1.6, clean full build on AppleClang 17 (exit 0).
AI-assisted. |
|
Tested
From the raw frames:
Synthetic shader only, no game files. |
|
Tested 4f760c1 on NVIDIA GeForce RTX 3070 (fragment subgroup 32..32), driver 617.42, Windows 11 24H2. That's the other side of this change: a wave32 PS already gets exactly 32 lanes there, so the half-isolation must be neutral. It is.
No 64-lane fragment subgroup here, so the AMD Windows case itself isn't exercised. This only shows the change costs nothing on a 32-wide driver. No game files. AI-assisted (Claude). |
Claimed as SHADER-731: #3918 (comment)
First refusal released to me: #3918 (comment)
Current tracking: #4084. Finding and hardware measurements: #3982.
What and why
A wave32 pixel shader can run in a 64-lane fragment subgroup on AMD Windows RDNA2, where the fragment stage cannot request subgroup size 32. Treating that subgroup as one guest wave leaks ballots, votes and lane reads across the two logical wave32 halves. The old
ps_bitmask_permchecker judged only lanes 0–31 and could hide the other half's wrong results.This keeps wave32 fragment operations local to their 32-lane half:
SubgroupLocalInvocationId & 31; shuffle sources retain the caller's physical half.ps_bitmask_permpixel. Synthetic semantic tests compare one 64-lane subgroup with two independent 32-lane subgroups using different inputs in each half.Validation on this PR head
Base:
mainaa2988c. Head: 4f760c1. Windows, RX 5700 XT, driver 32.0.21045.5002. Synthetic fixtures only; no game files or corpus run.ps_bitmask_perm: 4,096/4,096 pixels exact, translation andspirv-valpassed, with Vulkan validation and synchronization validation enabled. Used the existing main-compatible Vulkan harness; no C++ runtime changes are made here. This device reports default subgroup size 64 and cannot pin fragment size; the CPU tests explicitly exercise 64 lanes, so the GPU result is not presented as a live-width measurement.test_run_gpu_pixel_checks,test_run_gpu_tests,test_run_gpu_wavemask).git diff --check: passed.Existing main suite failures are separate
An additional diagnostic run of the full semantic suite with SHADER-731 plus local compatibility repairs completed 7,459 tests in 768.937 seconds: OK (1 skipped, 1 expected failure), zero failures/errors. Those repairs address the already-open #3883 (mutation anchor), #3885 (f64 malformed operands) and #3995 (outlined helper calls / structured emulation tests).
Those compatibility repairs are deliberately excluded from this PR to avoid duplicating their owners' work. The full-suite diagnostic is not a clean-full-suite claim for this PR head alone: the known baseline failures remain until those separate fixes land.
spirv-asandspirv-valmust also be on PATH for the validation-dependent test.No Tier 3 work is included.