shader: pin compressed EXP enable-mask decoding across all 16 raw EN values #428
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/434"
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 abilliontokens on 2026-11-22T02:42:37Z.
Owner-requested decoding fixture for #361 (comment 7072921152). Stacked on #398, which stacks on #363; review the base PRs first.
Change
Generate the reference compressed export from source (
exp mrt0 v16, v16, v17, v17 done compr vmassembles to0f 1c 00 f8 10 11 00 00: EN is the low nibble of byte 0, byte 1 carries compr/done/vm, and the source VGPRs v16/v17 sit in bytes 4/5). Then independently replace only the four EN bits in the instruction word and exercise all 16 raw masks through the normal binary → disassemble → lower path.The new
check_exp_en_decodingruns as part of the CPU binary gate (tests/pixel_aot_check.py binary) and asserts, for every raw value:off; raw EN=0x5 printsv16, off, v17, off.lower(return_write_mask=True)reports that mask. 0x0 round-trips byte-wise but enables no pair and stays refused.does not enable whole packed pairs) instead of the generic fall-through; the fixture pins that message. Form coverage counts only accepted programs, so non-pair compressed masks remain excluded.Measured re-encodings, individually
The rule is pair-first-operand presence: a packed pair survives reassembly exactly when its first operand (VSRC0/VSRC2) is enabled; the duplicated high-half operand never enables its pair. That is why
0x2 → 0x0and0xa → 0x0(only the duplicated high-half operand is enabled, so the pair is lost) while0x5 → 0xf(both first operands enabled). A pairwise OR over both operands of each pair would mispredict the first two as0x3and0xf; the fixture asserts the measured values instead.Evidence
Verification
LLVM 15.0.7 gfx1013 tools; no C++ changed.
CI covers the hardware draws.
Refs #361
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T06:44:51Z.
I pushed
fd0d8ccafter #398 landed, preserving the author’s full 16-value fixture. The local gfx1013 binary suite passed with LLVM 15.0.7. It checks the raw nibble, the disassembly/reassembly mapping and rejection during lowering of unsupported masks. The raw experiment does not establish native channel-write behavior for those masks.