Repository navigation
rdna2spirv: lower rotate and FFT wave swizzles - #4245
thatirishguyyy wants to merge 4 commits into
Conversation
|
Tested 90c18f3 (merged with main aa2988c). The numeric path is correct: One regression: LLVM 20+ disassembles these offsets symbolically for gfx9+ (gfx1013 included), as
Main refuses these forms, while this PR translates them into a wrong lane mapping. Suggested fix: when Repro (from AI-assisted (Devin), CPU-only. |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 90c18f34 on Windows 11 with LLVM 21 and the SDK tools on the environment: python -I -m pytest tests/test_swizzle_numeric.py -q -> 7 passed; compileall and git diff --check clean. (Without the tools the module skips, which is the intended requires_tools behavior.)
The translator now decodes the numeric ds_swizzle_b32 offset: forms: 0xC000 rotates the low 5 lane bits by the encoded amount (with the direction bit), 0xE000 is the FFT butterfly (bit-reverse, then shift down by 27 + popcount(mask)), and both preserve the high lane bits and the mask bit. The new tests exercise the encoded offsets; the existing textual swizzle(...) and BITMASK paths still pass. No blocking issue.
|
Re-tested at d4faae7: the symbolic-operand fix works. One problem in the new test file: on its own it no longer collects.
AI-assisted (Devin), CPU-only. |
Flyander
left a comment
There was a problem hiding this comment.
At b98edb9 the root-level test import issue is fixed, and the symbolic ROTATE/FFT operands decode to the same lane arithmetic as their numeric encodings in the added cases. Independent review found no remaining actionable issue.
|
Tested |
|
Full-corpus check on the game copy (Xbox Series 1.0.2.1; Windows 11, RX 9070 XT). Counts only, no shader names or data. PR head Result: byte-identical to main.
No shipped shader is refused on main either: 26,503 of 26,503 translate. So the game corpus never reaches the rotate/FFT |
Claimed in the coordination issue.
What and why
LLVM 18 emits numeric
ds_swizzle_b32offsets for rotate and FFT on synthetic gfx1013 inputs. This change lowers those encodings, selects lanes within each 32-lane half, and reuses the lane-read helper. Related to #3126, which covers inactive source lanes. Lane mapping reference: omonkeyz/xbox-emulator#186.Tested
aa2988c, minimal rotate and FFT shaders were refused withds_swizzle pattern. Both translate and passspirv-valwith this change.Checklist
docs/design.mdcontract table.AI-assisted (Codex).