shader: accept the e64 spellings of v_interp_p1_f32, v_interp_p2_f32 and v_nop in pixel_aot #751
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/757"
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 rasptum on 2026-11-23T01:02:09Z.
Change
Three VOP3 (e64) spellings were unrecognised by
pixel_aot:v_interp_p1_f32_e64,v_interp_p2_f32_e64andv_nop_e64. Each is a second encoding of an instruction the translator already lowers.Interpolation pair. LLVM 15 assembles
v_interp_p1_f32_e64 v8, v0, attr0.xto the two-word VOP3 form (D6000008 00020000) and prints it back with the suffix. The translator now accepts the e64 spelling only in the operand shape of the e32 form: a plain VGPR source andattr0. It goes through the existing branch, under the same pairing and mask rules, and produces the same shader as the e32 spelling. The two encodings may be mixed within a pair. The change is a regex suffix.The VOP3 encoding can also carry things the e32 encoding cannot. None is lowered, because nothing here establishes how they apply to an interpolation. The controls check that each of these is refused:
-v0,|v0|,-|v0|)clampmul:2,div:2)attr0No-op.
v_nop_e64is accepted whereverv_nopis: entry mask, before the export, no operand. LLVM 15 prints both encodings of the no-op asv_nop, so a decoded binary already reached that branch. The new spelling is what an assembly fixture writes to select the VOP3 encoding (D5800000 00000000); the round trip assembles it and lowers the decoded text to the same shader. The controls refusev_nop_e64with an operand, after the export, and under the whole-quad mask.Three programs are drawn, each with one
v_nop_e64:rgbabgrabgrargbaThat is 3 matching draws and 6 mismatching ones from three compiles. The other mix (e64 for p1, e32 for p2) is checked statically to give the same shader. For every program the controls assert that the translated shader equals the one for the e32 spelling with
s_nop 0in place ofv_nop_e64.The draws are registered as their own CTest entries,
pixel_aot_e64_spellings_hardwareandpixel_aot_e64_spellings_warp(tests/pixel_aot_check.py draw-e64-spellings), each with its ownFORM_COVERAGE_RECORD, so nothing is added topixel_aot_hardware. The three programs are added to the LLVM 15 round trip,tests/form_coverage_check.pyasserts the three forms,tools/scan_unsupported_shaders.pyaccepts the same two spellings (with a test intests/rdna2_tools_check.py), anddocs/experiments.mdhas a paragraph.This advances instruction-form coverage of the pixel translator by three forms on gfx1013 and three on gfx1030.
Verification
Update before opening: rebased onto
mainat356a7beas d688f11. On that commit I reran the LLVM 15 round trip,tests/form_coverage_check.py, the static controls, and this PR's own draw test (draw-e64-spellings) on WARP and on the RTX 3060: all pass. Other results below are from the commits named there.Known red check, not from this PR:
mainis currently broken by aNameErrorincheck_scalar_carry_chain_draw(since #695), which failspixel_aot_predicate_rounding_*and the combineddrawrun for every branch. #752 is the one-line fix. I will rebase this PR oncemainis green.Rebased onto
mainatcfb2600as 4320e65. The four commits that landed in between (#627, #740) touch no shader file. On the rebased commit I reran the two new tests on WARP and on hardware, the controls, the LLVM 15 round trip,tests/form_coverage_check.py,tests/rdna2_tools_check.pyandtests/docs_links_check.py(all pass). The fullctestrun and the coverage count below are from 09c3c7c, the same change onmainatfd2486f.Run at 09c3c7c, on
mainatfd2486f. Windows 10 Pro 22H2 (10.0.19045.6466), Windows SDK 10.0.26100.0 DXC, Debug build, debug layer enabled in every run.28 tests ran. 27 passed, 1 failed, 0 skipped.
WARP (Microsoft Basic Render Driver, 10.0.19041.5794):
pixel_aot_e64_spellings_warppixel_aot_*_warptests, includingpixel_aot_warpHardware (NVIDIA GeForce RTX 3060, 10de:2503, driver 32.0.15.9636):
pixel_aot_e64_spellings_hardwarepixel_aot_*_hardwaretestspixel_aot_blend_scalar_hardwaremainon this machine and this change does not touch it.In both new tests the three matching draws report
max_absolute_error=0anddebug_errors=0 debug_warnings=0, and the six wrong references each reportpixel_mismatch.Other checks, all passed:
python -B tests/pixel_aot_check.py binary <llvm-mc> <llvm-objcopy> <LLVM-C.dll>with LLVM 15.0.7.python -B tests/pixel_aot_check.py(controls).AGENTS.md.Evidence and follow-up
Coverage, counted with
tools/form_coverage.py's matching rule from the union of the record-writing shader tests run on WARP, once from a clean copy offd2486fand once from this change.tools/form_coverage.pyon the JUnit file of the run above reports the same totals.mainatfd2486fThe forms added are exactly
v_interp_p1_f32_e64,v_interp_p2_f32_e64andv_nop_e64, in both lists. None is removed.docs/coverage/dashboard.svgis not regenerated here.What this does not show:
v_nop_e64text from a disassembler. LLVM 15 printsv_nopfor both encodings, so the spelling is exercised from assembly source only.Overlap with open pull requests: the diffs of the open shader pull requests (34 read) were searched for the three form names on added lines; none adds them. #713 (draft, mine) adds a separate branch for the 16-bit interpolation forms and does not change the 32-bit branch edited here. It adds a scanner pattern on the line after the one this change edits in
tools/scan_unsupported_shaders.py, so a small textual conflict there is expected with whichever lands second. This pull request appends one line to thecheck_binaryfixture list, as every open shader pull request does, so a textual conflict there is also expected and trivial.AI-assisted (Claude Code). The Windows results were measured locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-23T01:13:24Z.
Rebased onto
mainataeb45da(after #752 repaired theNameError) as2dc5e13. Rerun on this commit, Windows 10 22H2, WARP 10.0.19041.5794 and RTX 3060: LLVM 15 round trip,tests/form_coverage_check.py, the fullpixel_aot_check.py drawrun on WARP, and this PR's own draw test on WARP and hardware. All pass.