shader: lower the plain VOP1/VOP3 v_movrel* forms in pixel_aot #1785
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1785
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1785/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@legacy-code-archaeologist on GitHub · 2026-11-24 18:38 UTC · original
legacy-code-archaeologist:shader/plain-movrel→main· +199 −16 · 4 files · 1 commits · merged 2026-11-24 19:47 UTCRefs #1739. I built this before the issue had a maintainer reply; if you want the scope narrowed, I'll adjust.
What
tools/pixel_aot.pynow lowers the plain VOP1 (_e32) and VOP3 (_e64) encodings of the four relative VGPR-indexing moves:v_movreld_b32,v_movrels_b32,v_movrelsd_b32,v_movrelsd_2_b32;v_movrels_b32_e32 v12, v24/_e64for both gfx1013 and gfx1030. I checked this withLLVMDisasmInstructionon both targets: words7e1885/87/89/91…andd5c2/c3/c4/c8….They go through the existing DPP movrel block (
PLAIN_MOVREL_PATTERN). The block uses the samem0indexing with no quad swizzle (perm=None), so each lane reads and writes its own VGPRs. Everything else is the DPP forms' code:m0;The DPP path is unchanged: its
op == "…_dpp"comparisons becamekind == …, withkind == opfor DPP. Refusal messages for the plain forms name the plain instruction, for exampleUnsupported m0 value for v_movrels_b32.Not in this PR:
v_swaprel_b32, the SDWA forms and the scalars_movrel*.Evidence
PLAIN_MOVREL_BODY(tests/pixel_aot_check.py) runs each move once with a dynamicm0and once with a staticm0. The dynamicm0comes froms_bfe_u32, or froms_and_b64 … 0x30003forv_movrelsd_2.check_plain_movrel_drawdraws it twice: as written (_e32dynamic,_e64static), and with the spellings exchanged. So all eight forms run with both kinds ofm0, on the twoDPP_MOVREL_SETS. Their channel results differ between the sets: (60, 133, 805, 193) and (80, 84, 233, 165).pixel_mismatch:m0replaced by 0, separately forv_movrels,v_movreldandv_movrelsd;m0halves swapped forv_movrelsd_2(0x20001→0x10002).pixel_aot_check.pyrun:dpp_soff/dpp_doff) and noQuadRead;v_movrelsd_2_b32_e32 v12, v12;interp_basem0, an unbounded dynamicm0, a static offset past v255, an indexed VGPR past v255, and an undefined indexed source.check_binaryfixture list.Windows 11 Pro 26100.9168, DXC 10.0.26100, debug layer unavailable, commit eef8bc21 on
b4c961cd:Other runs:
pixel_aot_dpp_movrel_{warp,hardware}still pass.python -B tests/pixel_aot_check.py(controls) exits 0.ctest --preset dev -E '_hardware$'before the rebase: 781/781.tools/form_coverage.py --gaps gfx1030no longer lists the eight VOP1/VOP3 movrel forms.Not run locally:
tests/pixel_aot_check.py binary. This PC has nollvm-mc, so the LLVM 15 assemble/disassemble round trip of the new bodies relies on the Ubuntu job.🤖 Generated with Claude Code
The VOP1 (_e32) and VOP3 (_e64) encodings of v_movreld_b32, v_movrels_b32, v_movrelsd_b32 and v_movrelsd_2_b32, which LLVM 15 prints with two VGPR operands for gfx1013 and gfx1030 alike, now lower through the existing DPP movrel m0 indexing without a quad swizzle: each lane reads and writes its own VGPRs. Static and bounded-dynamic m0, source-before-destination reads for overlapping banks, the entry-mask requirement and the refusals are the DPP forms' code path. v_swaprel_b32, the SDWA forms and s_movrel* stay outside. PLAIN_MOVREL_BODY runs each move with a dynamic and a static m0 and is drawn twice, as written and with _e32/_e64 exchanged, so all eight forms see both kinds of m0, on the two DPP_MOVREL_SETS constant sets. Four mutations per variant (dynamic m0 ignored for three moves, swapped static m0 halves for v_movrelsd_2) must produce a pixel mismatch. The translation controls check the bounded selects, an overlapping bank and five refusals; both variants join the check_binary round trip. Windows 11 26100: pixel_aot_plain_movrel_warp (WARP 10.0.26100.8972) and _hardware (Quadro M1000M, 32.0.15.7371, debug layer unavailable) pass, 4096 pixels with zero error for both sets and variants; every mutation mismatched. pixel_aot_dpp_movrel_{warp,hardware} still pass. Full dev suite without _hardware: 781/781. check_binary was not run locally (no llvm-mc here). Refs #1739 Co-Authored-By: Claude Opus 5.5 <[email protected]>@tedin7 on GitHub · 2026-11-24 18:50 UTC · original
This PR currently has merge conflicts with
mainateef8bc2113bb08253313ad1e8648e9b414f26fdb; could you please rebase it onto the latestmainso we can verify and review it?AI-assisted.
@KelboLive on GitHub · 2026-11-24 18:51 UTC · original · approved these changes
Overview
Excellent PR. The approach of normalizing through
kindto reuse the DPP movrel indexing logic is elegant, and the test coverage is outstanding for a 199-line change.Specific observations
kind = op if op.endswith("_dpp") else f"{op}_dpp"correctly maps plain forms to the same indexing rule. The subsequentkind == "v_movreld_b32_dpp"checks then work for both encodings without duplication.v_movrels,v_movreld,v_movrelsd,v_movrelsd_2) with distinct m0 sources, and both constant sets produce different channel outputs to catch incorrect indexing._e32and_e64are hardware-interchangeable for these instructions.v_swaprel_b32, SDWA forms,s_movrel*) are well-documented.Minor notes
docs/experiments.mdentry is dense but matches the existing style.Verdict
No blocking issues. Scope is well-contained -- 4 instruction encodings with ~20 lines of code changes. Ready to merge.
@tedin7 on GitHub · 2026-11-24 19:29 UTC · original · reviewed
Review of
eef8bc21(head of this PR). Comment only, no approval.Verdict: no correctness problems found. One test gap (P3) and one note.
Semantics (tools/pixel_aot.py). The plain
_e32/_e64forms are routed into the existing DPP movrel code by mapping the op to its_dppname (kind). So the indexing is the same code the DPP forms already use:v_movreldwrites VGPR[dst + m0],v_movrelsreads VGPR[src + m0],v_movrelsddoes both,v_movrelsd_2reads with m0[9:0] and writes with m0[25:16]. That matches the public RDNA 2 ISA text the PR cites. Operand order (dst first, src second), the 0..255 base check, the static and bounded-dynamic m0 rules and the read-all-sources-before-any-write rule are all inherited unchanged. With no swizzle the source is used asasuint(vN), a bit-exact copy. The regex only matches two plain VGPR operands, soe64spellings with a source modifier, clamp or omod do not match and fall to the generic refusal.plainis only read in the branch where it was assigned (walrus in theor), so there is no unbound-name path.Commands run locally (worktree at the exact SHA above, Linux)
python3 -B tests/pixel_aot_check.py(no arguments, the device-free controls): passed.python3 -B tests/rdna2_tools_check.py: 148 tests, OK (18 skipped).git diff --check origin/main...HEAD,tests/docs_links_check.py(17 files, 366 links),tests/bidi_controls_check.py: clean.tools/pixel_aot.py, each followed by the controls and then reverted withgit checkout -- .(tree clean afterwards):v_movrelsstatic branch swapped to write instead of read: caught (Unbound vector operand v33).Expected a numeric VGPR at v32).raiseattools/pixel_aot.py:5191removed): not caught, controls still pass.P3 – missing control. The plain branch has its own
mask != "entry"refusal attools/pixel_aot.py:5191, but no control exercises it, as the mutation above shows. The docs say the mask refusals are "shared with the DPP forms", which is true of the DPP message at line 5183 but not of this new line. One short control (a plainv_movrels_b32_e32inside a non-entry exec region, expectingoutside entry mask) would cover it.Note. The control list does not include an
_e64form with a modifier or an SGPR operand. I believe the regex refuses them, but I did not add a probe.Not run by me:
pixel_aot_plain_movrel_{warp,hardware}(needs Windows with DXC andoffscreen_check); I rely on the PR text for the GPU results.AI-assisted; commands listed were executed locally.