Repository navigation
fix(shader): use guest lane for compute masks - #25404
DonRyuzaki wants to merge 4 commits into
Conversation
Host subgroup IDs wrap at eight on llvmpipe, so scalar VCC writes alias guest lanes 8-31. Use the workgroup index only when one host invocation carries one guest compute lane. Refs boykopovar#25298
GPU test run: ✅ no new failures or validation errors on Windows / NVIDIABasis: built and ran · this PR's head Checked
Findings: none from this run; this is a GPU run, not a code review. AI-assisted test run (Claude Code) · head |
|
I reproduced two mask regressions with the shader delta from head
The two standalone regression fixtures use AI-assisted: yes |
|
Independent macOS check of
Not tested with a title. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The compute lane mapping change is supported by the focused regression fixture; no verified defect blocks merging.
What I ran
Reviewed head f432125076f9bde43be50ad34fef2f5e8ad04d75. I read the prepared description, commits, manifest and diff, all three changed files, and the relevant lane ID emitter, input declaration and execution-test registration code through repo_read.py. No build or tests were run during this review.
Results
| Check | Result | Note |
|---|---|---|
| Changed code and context | passed | Three changed files and targeted callers read |
| Build and tests | not run | Author reports the focused fixture passed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the build, CTest, conventions check or debt-fold check; their reported results are from the PR description. I did not verify physical GPU or console behavior. All files listed as reviewed in the manifest were read; no changed files were excluded.
To get this to a good state
Nothing is required.
|
NVIDIA run on Linux: the new Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base 851212f, head is f432125.
Every Vulkan test's log selects the RTX 3070 and shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
Follow-up on the buffer-fed VCC case from #25660. I compared its GitHub test merge Windows, lavapipe Mesa 26.2.6 / LLVM 23.1.4 (software Vulkan subgroup 8), three identical repeats per arm:
Both builds returned the correct raw scalar for all 45 lanes and left the inactive output intact. The literal mask also passes with the hunk. Both revised ReadFirstLane tests and the EXEC-lane control pass in every run. This reproduces the earlier ballot/SCC regressions on the newer base while showing exactly which remaining dynamic case the guest-lane index fixes. On Intel UHD and RTX 4070 Laptop, both at subgroup 32, all seven tests passed in all three runs per adapter and build. Every run required Vulkan with shader caching off and loaded the Khronos validation layer. There were no VUID or synchronization diagnostics. AI-assisted: yes |
Preserve the readback fixtures from a05bcb6.
Using the guest lane for every mask drops ballot-derived bits above the first host subgroup. Use it for scalar mask bit tests whose words do not depend on subgroup ballots.
|
I applied the exact #25404 production delta from Windows 11, pinned lavapipe LLVM 23.1.4 (subgroup 8), WinLibs Release, forced Vulkan, shader and pipeline caches disabled, Khronos Validation 1.4.369. Three runs per arm used byte-identical fixtures and the same exchange lab gate.
The new ballot fixture had zero scalar or selected-bit mismatches in both guest waves. The SCC and EXEC controls remained unchanged and passed in both arms, so the earlier ballot/SCC regressions did not recur on this stack. The historical 45-thread case remains unchanged from the previous result. Its raw scalar words are correct for the full and 13-lane partial guest waves, but VCC selection stays For the disabled-exchange control I changed only its lane-8 sentinel so host-local and guest-lane indexing differ. Both arms retained the host-local result All 48 targeted Vulkan invocations selected llvmpipe subgroup 8 and inserted Khronos Validation. There were no skips, missing-layer messages, VUIDs, or synchronization diagnostics. The latest delta fixes the literal/user-data mask and ballot fixture failures while preserving the unavailable-exchange fallback. Could you update the PR's What section to describe the provenance-limited rewrite, and note that the buffer-fed AI-assisted: yes. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the author’s reported results are consistent with the code I reviewed.
What I ran
Reviewed head 446e5b0a132930dffcf8f311f517099ea926d479. I did not run commands or tests. The author reports a focused CTest on Ubuntu 24.04 WSL2 with GCC 13.3 and Mesa llvmpipe, including a failing baseline and passing final branch; these were not run by me.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | All seven changed files read |
| Build and tests | not run | Author-reported results only |
| Physical console behavior | not run | No console or physical GPU reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I reviewed all seven files listed in the manifest, and none were excluded by the review bundle. I did not independently verify the author’s test output, run a build or test, or verify behavior on a physical GPU or PS5 title.
To get this to a good state
Nothing is required.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
For a compute shader whose guest Wave32 spans 8-lane Vulkan subgroups,
EmitLaneIdused the host subgroup invocation ID. A scalars_mov_b32toVCC_LOthen selected bits 0–7 again for guest lanes 8–31. This changes the compute path with one host invocation per guest lane to usegl_LocalInvocationIndexmodulo the guest wave size. Other shader stages keep their existing mapping.The regression fixture was posted by mihiii1337 on #25298; its original commit and authorship are preserved as the first commit in this branch. The added debt fragment narrows the existing small-subgroup limitation to the remaining non-compute cases. Cross-subgroup ballots and shuffles are outside this change.
Tested
Ubuntu 24.04 WSL2, GCC 13.3, Release, Mesa llvmpipe LLVM 20.1.2 (software Vulkan device, subgroup 8). Built
agc_driver_wave32_scalar_vcc_mask_testson upstream851212fb98plus the fixture, then with this patch. The focused CTest usedANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,APS5_NO_PIPELINE_JOURNAL=1, the lavapipe ICD,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, andVK_LOADER_DEBUG=layeron both sides.0xa5a5a5a5, expected0x96a596a5.0x96a596a5.VUID-lines.tools/check_conventions.py --base upstream/mainandgit diff --checkpass against current upstream27646a6172f.tools/debt_fold.py --checkremains blocked by two unrelatedlibkernel_sysfragments already on main (#25307); this branch'sshaderfragment produces no fold error.No PS5 title or physical GPU was run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)