Skip to content

shader: accept the e64 spellings of v_interp_p1_f32, v_interp_p2_f32 and v_nop in pixel_aot - #757

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
rasptum:shader/e64-leftover-spellings
Nov 23, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
rasptum:shader/e64-leftover-spellings

Conversation

@rasptum

@rasptum rasptum commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Change

Three VOP3 (e64) spellings were unrecognised by pixel_aot: v_interp_p1_f32_e64, v_interp_p2_f32_e64 and v_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.x to 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 and attr0. 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:

  • a negated or absolute source (-v0, |v0|, -|v0|)
  • clamp
  • output modifiers (mul:2, div:2)
  • an SGPR source
  • an attribute other than attr0
  • a missing attribute operand, a p2 that reads the wrong barycentric, and a p2 whose component differs from its p1

No-op. v_nop_e64 is accepted wherever v_nop is: entry mask, before the export, no operand. LLVM 15 prints both encodings of the no-op as v_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 refuse v_nop_e64 with an operand, after the export, and under the whole-quad mask.

Three programs are drawn, each with one v_nop_e64:

Program Interpolation Reference Must report a mismatch
sampled fixture both whole-quad pairs in e64 renderer's texture reference, rgba the same draw against bgra
sampled fixture, channels swapped e32 for p1, e64 for p2 renderer's texture reference, bgra the same draw against rgba
entry-mask attribute fixture all eight interpolations in e64 per-pixel CPU reference (1 - v, 0.25 + 0.5u, u, v) over 32 by 32 pixels a zeroed channel at one interior pixel, once per channel (4 draws), each reported at that pixel

That 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 0 in place of v_nop_e64.

The draws are registered as their own CTest entries, pixel_aot_e64_spellings_hardware and pixel_aot_e64_spellings_warp (tests/pixel_aot_check.py draw-e64-spellings), each with its own FORM_COVERAGE_RECORD, so nothing is added to pixel_aot_hardware. The three programs are added to the LLVM 15 round trip, tests/form_coverage_check.py asserts the three forms, tools/scan_unsupported_shaders.py accepts the same two spellings (with a test in tests/rdna2_tools_check.py), and docs/experiments.md has 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 main at 356a7be as 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: main is currently broken by a NameError in check_scalar_carry_chain_draw (since #695), which fails pixel_aot_predicate_rounding_* and the combined draw run for every branch. #752 is the one-line fix. I will rebase this PR once main is green.

Rebased onto main at cfb2600 as 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.py and tests/docs_links_check.py (all pass). The full ctest run and the coverage count below are from 09c3c7c, the same change on main at fd2486f.

Run at 09c3c7c, on main at fd2486f. Windows 10 Pro 22H2 (10.0.19045.6466), Windows SDK 10.0.26100.0 DXC, Debug build, debug layer enabled in every run.

cmake --preset dev
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^pixel_aot_'

28 tests ran. 27 passed, 1 failed, 0 skipped.

WARP (Microsoft Basic Render Driver, 10.0.19041.5794):

Test Result
pixel_aot_e64_spellings_warp Passed, 1.0 s
the other 13 pixel_aot_*_warp tests, including pixel_aot_warp Passed

Hardware (NVIDIA GeForce RTX 3060, 10de:2503, driver 32.0.15.9636):

Test Result
pixel_aot_e64_spellings_hardware Passed, 3.4 s
12 of the other 13 pixel_aot_*_hardware tests Passed
pixel_aot_blend_scalar_hardware Failed. It also fails on untouched main on this machine and this change does not touch it.

In both new tests the three matching draws report max_absolute_error=0 and debug_errors=0 debug_warnings=0, and the six wrong references each report pixel_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).
  • The 22 pure-Python checks listed in 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 of fd2486f and once from this change. tools/form_coverage.py on the JUnit file of the run above reports the same totals.

gfx1013 gfx1030 (RDNA2)
main at fd2486f 528 of 1968 522 of 1863
this change 531 of 1968 525 of 1863

The forms added are exactly v_interp_p1_f32_e64, v_interp_p2_f32_e64 and v_nop_e64, in both lists. None is removed. docs/coverage/dashboard.svg is not regenerated here.

What this does not show:

  • That the VOP3 encoding of the interpolation pair computes what the VINTRP encoding does on the console. That is taken from LLVM's instruction definitions, not measured. The draws show only that the translated shader is the e32 one, compared with the references the e32 fixtures use.
  • Anything about the modifiers the VOP3 encoding adds. They are refused.
  • The v_nop_e64 text from a disassembler. LLVM 15 prints v_nop for 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 the check_binary fixture 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

…ixel_aot

v_interp_p1_f32_e64 and v_interp_p2_f32_e64 are accepted only in the operand
shape of the e32 form (plain VGPR source, attr0) and lower to the same
shader. Source modifiers, clamp, output modifiers, an SGPR source and other
attributes stay refused. v_nop_e64 is accepted wherever v_nop is.

Three programs are drawn on WARP and hardware with six mismatching
references, as their own CTest entries with their own coverage record, and
are added to the LLVM 15 round trip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@rasptum

rasptum commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main at aeb45da (after #752 repaired the NameError) as 2dc5e13. 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 full pixel_aot_check.py draw run on WARP, and this PR's own draw test on WARP and hardware. All pass.

@rasptum
rasptum force-pushed the shader/e64-leftover-spellings branch from d688f11 to 2dc5e13 Compare November 23, 2026 01:13
@R0Y00
R0Y00 merged commit c51284d into R0Y00:main Nov 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants