Repository navigation
SHADER-503: zero inactive source lanes in DS_SWIZZLE_B32 - #2780
Conversation
Neighbor colors can remain in a disabled lane. Use the same masked lane read as backward permute so an active fragment gets zero for a disabled or absent neighbor while a disabled destination keeps its previous value.
# Conflicts: # docs/design.md
Both DS callers pass a decoded VGPR operand to the destination writer.
|
Code read of AI-assisted review (Claude Code). |
|
Tested on Linux (WSL2 Ubuntu, Python 3.12) and native Windows 11 (Python 3.13.1), CPU only: pass. Merges cleanly with main. tests/semantic/test_ds_permute.py: Linux 6 tests OK, Windows 6 tests OK, 0 skips on both. Negative control (tools/rdna2spirv.py restored to main, Linux): fails (2 failures, 2 errors), so the new test covers the change. Trial merges with #2739, #2742, #2722 and #2778 are clean; the docs/design.md row it edits is also edited by many other open PRs, so expect rebases there. |
|
Independent DS swizzle Vulkan A/B ( Synthetic inputs only. AI-assisted (Codex). |
|
Tested 2c87d6d on AMD Radeon RX 9070 XT (RADV GFX1201) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
|
Tested 2c87d6d on Steam Deck LCD (AMD Custom GPU 0405 "Van Gogh" / RDNA2, RADV Mesa 26.2.0-devel, Vulkan 1.4.350, SteamOS 3.9.5): pass.
AI-assisted (OpenCode). |
|
Checked
Review of the change:
Not covered here: on a 32-wide subgroup the GPU tests cannot reach the new path (no absent lane), so the EXEC-off source case rests on the CPU interpreter test, and the narrow pixel-shader case (Intel subgroups of 8 or 16) is still unmeasured on hardware. AI-assisted. |
|
Tested at the head on Windows 11 / Python 3.13.0: The rule matches the hardware record: Nits:
Approve. AI-assisted review, no game files, no GPU. |
The hardware runs control EXEC in full waves. The seven-invocation interpreter case instead selects an absent lane. Distinguish those observations so the CPU fixture cannot be mistaken for a measurement on silicon.
|
The hardware record confirms that an existing source lane disabled by EXEC supplies zero on gfx1036 and gfx1150. In the separate CPU case there are only seven invocations, and lane 6 selects the absent lane 7. That fixture verifies the translator's zero fallback. The corresponding hardware result is unknown. I corrected the contract, test comment and PR description, and linked the hardware measurements. The fixture specifically uses |
|
SHADER-517: AI-assisted synthetic RTX5070 / driver616.56 validation of #2780 with emulated Wave64 and asymmetric EXEC masks (low0x536db7c9, high0xa9c656b3). Parent ec8ec4c matched QUAD reversal46/64 and BITMASK XOR17 52/64. Requested2c87d6db and currentdc612fdc both matched64/64 for each. All30 parent failures were active destinations reading disabled sources (QUAD9+9, BITMASK7+5 across halves); both heads returned zero. All56 disabled destinations preserved their values and all42 enabled-source copies matched on every revision. All six modules passed spirv-val Vulkan1.2. This covers existing but EXEC-disabled source lanes, not absent hardware invocations. No game inputs; raw readbacks private. |
Keep the targeted regression and the intervening upstream changes together for review.
|
Independent synthetic A/B on Windows 11 build 26300, NVIDIA RTX 5070 Ti / driver 621.24, Python 3.12, LLVM 21.1.8. I reran the reported SHADER-678 case with the same
This is one NVIDIA wave32 case, not an independent AMD hardware-oracle measurement or a full-corpus result. No game files were used. — LocalFirst-AI |
ps_bitmask_perm is skipped when a driver runs the wave32 pixel shader narrower than 32 lanes (#1318), because the "pippi" pattern reads lanes 16-31, which then do not run and have no defined value. The skip excused the whole test, including the sources that do run: at 16 lanes wide every lane reads lane ^ 9, which is inside the running lanes for lanes 0-7, so a wrong word there went unnoticed on Intel. The skip now excuses only the sources that are not there. Where the source lane runs, its word has to be right, so a narrow run is judged instead of skipped. At 8 lanes wide every "pippi" source is lane 8 or above, nothing can be judged, and the test still skips. The translator change this depends on is #2780: a source lane that is not running reads 0 instead of an undefined value, which is what makes the narrow run judgeable at all. Until it lands the note in docs/testing.md describes a behaviour that main does not have yet. Tested: python -I tests/test_shader_checks.py (70 tests, OK, on main 1628210). No GPU, no game files. AI-assisted.
Claimed in the coordination issue as SHADER-503.
What and why
A fragment that swizzles in a disabled neighbor's color could receive the old VGPR contents. If the source invocation was absent, the subgroup shuffle produced an undefined value. Use the same guarded read as backward permute for both DS swizzle patterns. A disabled destination keeps its previous color. The published gfx1036 and gfx1150 measurements confirm that a source disabled by EXEC supplies zero.
Related tracker item SHADER-207 links to #618, the closed Intel subgroup-width report. The full-width reproduction here exercises a disabled source within an otherwise complete subgroup. The seven-invocation CPU case models an absent source. Its result on hardware is unverified.
Tested
AI-assisted with Codex.
Checklist