tests: draw all overlapping SDWA movrel register pairs #2464
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2472"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T17:41:09Z.
Refs #1917. The existing SDWA movrel draw uses separate source and destination banks; the same-bank device-free check has two reachable offsets. This adds a draw that exports every word of one four-register bank after
v_movrelsd_2_b32_sdwacopies the indexed source's BYTE_0 to the destination's BYTE_1 with UNUSED_PRESERVE. The fixture checks all 16 pairs against a host bitfield calculation. An exact same-register copy still changes the selected byte.Verification
s_endpgm) hasf9 90 30 7e 18 11 00 00at byte 52, disassembling to the indexed SDWA move in the fixture.draw-sdwa-movrelentry passed on Intel UHD 770, GeForce RTX 4060 and Windows WARP with DXC 1.9.2609.5. On each, all 16 four-word references matched and the unchanged-bank control failed.AI-assisted with Codex + GPT-6.2 Astra (xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:34:31Z.
Verified on WARP and on a physical GPU, and the two in-place mutations are real mismatches, not refusals
This is one of the few PRs in this series I could run end to end here, so the numbers below are rendered pixels rather than a refusal string.
v_movrelsd_2_b32_sdwapathUNUSED_PRESERVElost — the destination keeps the new value instead ofprevprevtaken from the register being writtenBoth were caught as pixel mismatches, which matters: the check compares rendered words, so an in-place mistake shows up as a wrong pixel rather than as a translation refusal. That is the only way this bug class can be caught, because the translator is perfectly happy to emit the wrong thing.
Why the four in-place pairs are the point
Of the 16 index pairs, four have
dst == src. WithUNUSED_PRESERVEandBYTE_1/BYTE_0, the instruction copies byte 0 of the selected source into byte 1 of the selected destination while keeping the destination's other bytes — so when those are the same register, the "previous value" the preserve keeps is the value the same instruction is reading. Treating it as a no-op, or readingprevafter the write, changes exactly those four and leaves the other twelve identical. The PR says so in the docstring and the two mutations confirm the fixture can tell the difference.What I would add
The docstring says the check covers "all 16 index pairs, including the four in-place writes". The 16 come from
s_and_b64 s[84:85], s[84:85], 0x30003withm0selecting both offsets, and the exported bank is four words — so the pairs are enumerated bym0, not by 16 separate programs. Worth one sentence saying which enumeration is meant (16m0values in one draw), because a reader may expect 16 draws.Note on the modes
draw-sdwa-movrelnow carries this check as an extra function call at the end rather than a new mode. That is fine and keeps the runtime down, but it does mean the new coverage is invisible inctest -N; if you want it separately skippable, aSKIP_RETURN_CODE 77mode of its own would show up in the test list.AI-assisted; both runs and both mutations were executed locally on Windows 11 build 26300.9974, WARP and the installed GPU.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T18:40:23Z.
The enumeration is documented in
11018033. One shader is compiled and passed to one renderer process. Each of the 16 source/destination pairs gets its own draw and constant-buffer value, withm0 = (dst << 16) | src. A seventeenth draw repeats (3, 3) against the unchanged-bank reference and must mismatch. The existingdraw-sdwa-movrelentry ran successfully at this revision on Intel UHD 770, RTX 4060 and WARP. Thanks for the independent RTX 5080 Laptop results.Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T19:08:33Z.
Review: APPROVED
Approved at head
11018033. The change is test-only:tests/pixel_aot_check.pygets the same-bankv_movrelsd_2_b32_sdwaoverlap draw, plus adocs/experiments.mdentry. This adds an AMD adapter and a local run of the description's key mutant to @ChazY11's WARP and RTX 5080 Laptop run.Environment
Windows 11 build 26300,
--preset dev,offscreen_checkbuilt at11018033, and DXC from SDK 10.0.26100.Commands executed
pixel_aot_sdwa_movrel_hardware(AMD Radeon RX 9070 XT, 1002:7550, driver 32.0.32029.2010) and_warp(10.0.26100.9818): both pass, with no skips.pixel mismatch, as required: source selection dropped, PRESERVE changed to PAD, dynamic m0 ignored, wrong byte, and no sext.Negative control
I mutated the dynamic
m0branch of the SDWA movrel lowering intools/pixel_aot.py, then ranmain's copy of the check and this PR's on both adapters:maincheckm0_mask & (0x1 if src_base == dst_base else 0x3ff), and the same in the emitted offset)Expected ['pass', … 'mismatch'], got […]The first row is the gap the description reports: only the new overlap draw catches it, both on the RX 9070 XT and on WARP. All mutants were reverted, and the clean run passes 2/2.
Merge checks: the branch merges cleanly with current
main. Required CI passed at this head. The/O2and coverage skips come from explicit workflow conditions. There are no review threads.AI-assisted; commands listed were executed locally.