shader: lower flat and global dwordx3 loads in pixel AOT #3687
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!3687
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3685"
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?
@timbot103 on GitHub · 2026-12-01 01:38 UTC · original
timbot103:shader-pixel-dwordx3-loads→main· +159 −23 · 4 files · 1 commits · merged 2026-12-01 08:49 UTCLower
flat_load_dwordx3andglobal_load_dwordx3 ... offon the pixel title alias-table profile. FLAT requiresflat_global_only=True. The caller guarantees that effective FLAT addresses exclude the scratch and LDS apertures.Each load makes one 12-byte
TitleLookuprequest and reads the matching alias withLoad3. A miss returns0xdeadbeefin all three destinations. The three destinations share onevmcntoperation. The existing title-load fixture checks three distinct words in order, preservation of the fourth output, offset carry and borrow, and misses in all three words for holes and one- or two-word straddles. It follows #2386 and #2419.Refs #319
Verification
Run the commands from the repository root. The red runs used
a3bfd019with the new fixtures and the original lowering. The green and mutation runs used commita2ca1113.The two configurations and focused builds passed. Release uses
/O2.Red then green
All four red checks failed with
Unsupported instruction 23: flat_load_dwordx3 v[12:14], v[20:21] offset:2036. The binary check stopped at the shared controls. The Python controls, Release WARP, and LLVM 15 round trip then passed with the lowering. The LLVM checks used the CI runner with the pixel entry and argv shown above. The passing dev WARP command is in the coverage sequence below.The x3 fixture covers 19 shader and address cases in 35 draws. Each nonzero-offset shader runs nine cases and four deliberate mismatches, each followed by a passing replay. One zero-offset FLAT draw at
0x2_0000_0000checks that equality does not cause a carry. The Python controls also check thatvmcnt(2)leaves the older DWORD pending in both segments and that x3 followed by x2 emits both helpers.Coverage
Run the baseline block at
a3bfd019with its original test and lowering. Read both reports before running CTest on the branch. CTest writes the fixture record to the same path in both blocks.Run this block on the branch.
Both CTest runs passed 1/1. All four coverage commands exited 0. Output filtered to the two x3 forms follows.
This measures recorded coverage from the selected fixture for both ISA inventories. The LLVM 15 fixtures assemble for gfx1013.
WARP and physical GPU readback
Ran locally on this branch. Run the two hardware commands from a PowerShell session initialized by
.\tools\dev.ps1.Each run had zero draw errors and zero capability skips. The D3D12 debug layer was unavailable on this host.
Mutations
Each row is an independent edit to
tools/pixel_aot.py. The clean checks passed before and after the edits.address, 12, slot→address, 8, slotLoad3(byteOffset);→Load3(byteOffset).zyx;uint3({miss:#x}u, {miss:#x}u, {miss:#x}u)→uint3({miss:#x}u, {miss:#x}u, 0u)title_loads_x3 |= count == 3→title_loads_x3 = False+ (low < base.x ? 1u : 0u)title_loads_x3 |= count == 3→if count == 3: title_loads_x3 = True; dests.append(f"v{int(dests[-1][1:]) + 1}"); values.append(values[-1])low < base.x→low <= base.x0x2_0000_0000.title_loads_x3 |= count == 3→title_loads_x3 = count == 3title_loads_x3 |= count == 3→if count == 3: title_loads_x3 = True; vector_loads += 2vmcnt(2)wrongly makes the older DWORD readable.Neighboring checks
All five neighboring WARP tests, Python coverage checks, and documentation link checks passed. Git reported no whitespace errors.
Environment
Prepared with AI assistance; all commands above were run locally.
@lukaslw-lab on GitHub · 2026-12-01 02:33 UTC · original · approved these changes
Reviewed
a2ca1113by reading the diff; not built or run.Verdict: approve. The x3 lowering follows the existing x2/x4 path exactly. No MUST, no SHOULD.
TITLE_MEMORY_X3(tools/pixel_aot.py:789) matches the x2/x4 helpers: the same carry into the high word, one 12-byteTitleLookup, a three-word miss, andLoad3.TitleLookupalready accepts any size that is a multiple of 4 and refuses a misaligned address (src/title_va_lookup.hlsli:35), so 12 needs no change there.registers(..., 3), sov[12:13]andv[12:15]are refused as a width mismatch. Themask != "entry", VGPR ≤ 255 and pending-destination guards apply unchanged.vector_loadsissue. Thevmcnt(1)/vmcnt(2)controls show that the older DWORD retires first and that all three x3 words stay pending until the wait.lds, a missing or misplacedoff, and offsets just outside the 11-bit FLAT / 12-bit signed GLOBAL ranges stay refused. The x3 entries were removed from the old neighbour lists, not left behind as stale refusals.experiments.mdparagraph match the code (flat_global_only, one issue, all-or-nothing miss).Tests:
check_title_load_x3_controlsproves the helper text, the profile and offset refusals, the width checks and the vmcnt ordering. The x3 fixtures prove the words on WARP: first and last word of a range, one- and two-word straddles, holes, and carry/borrow across the 32-bit boundary, with planted wrong references. CI ranpixel_aot_check.pyat this head (windows.yml:50). Thepixel_aot_title_loads_warp/_hardwaredraws are outside theprfilter. They rest on the author's local WARP, RTX 5080 and Radeon runs.