shader: admit per-lane binary32 VALU forms in pixel_aot masked regions #969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/976"
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 MasterDomino on 2026-11-23T19:25:28Z.
Change
Implements #975, the region-body stage first proposed on #932 (stage one closed with #957). The masked-region body (
REGION_ALU) admitted onlyv_mov_b32and binary32add/sub/subrev/mul/min/max. That blocked almost every region the console compiler emits, even with #957'sv_cmpxopener.This PR admits the per-lane binary32 forms
lower()already handles outside regions, in the encodings measured in real regions:v_fmac_f32_e32,v_mac_f32_e32v_mul_legacy_f32_e32and_e64v_cvt_f32_ubyte0..3_e32v_rcp_f32_e32,v_rsq_f32_e32,v_sqrt_f32_e32v_fma_f32,v_mad_f32,v_med3_f32These are 14 forms, admitted under both openers (
s_and_saveexec_b64andv_cmpx).REGION_ALUpattern.lower()refuses a body instruction that changes anything but VGPRs (scalar state, SCC, pending loads, export state).rcp/rsq/sqrt.fmac/macread their destination, so a destination still conditional from an earlier region rejects, as reads already do._e64of the VOP1/VOP2 forms), other operations (e.g.v_exp,v_log,v_cvt_f32_f16,v_fma_mix,v_max3), and scalar instructions (s_nop,s_mov_b32,s_waitcnt, loads).Fixes #975
Refs #932
Verification
Upstream
mainatb3af628(with #957), Fedora 45 x86_64, Python 3.15.2, LLVM 15.0.7.Both exit 0, and so do the 26 platform-independent checks,
tests/form_coverage_check.py,tests/rdna2_tools_check.pywith LLVM,tests/compute_store_check.py binaryandtests/ffx_dispatch_aot_check.py.check_region_body_controls):Instruction cannot run in a masked region.v_fmacon a destination left conditional by an earlier region rejects withRead of a register defined only on the masked path.rcp,fmacandmed3across two registers merges each register once.check_region_body_drawran with the Linux DXC 1.9.2609 release and only the D3D12 batch call replaced by a recorder: all 14 shaders compile, and 56 well-formed cases are written (42pass, 14mismatch).Not run here:
pixel_aot_region_body_warp. It needs Windows; this PR's CI run is the first WARP result.v_cmpxregion on mixed (0.5), full (10) and empty (-1) masks.0x04030201, 2.0,g + 1.0.rcp,rsqrtandsqrtan error, so their integer results (8, 4 and 4) and the outer value are rounded after the region with +0.5 and floor, as in the existing SDWA unary draws.No
_hardwarerun is reported.Evidence and follow-up
Impact on one local input (the 12,101 PS records from #932; aggregates only), on the regions #957 accepts structurally (save + f32/i32/u32
_e32v_cmpx+ restore of the same pair):main)That matches #975, now measured with the branch's own
REGION_ALU. A record also needs everything outside its regions to translate, so these count regions, not translatable shaders.Next blockers after this stage: scalar instructions in the body (
s_mov_b32,s_waitcnt, scalar loads), nesting, and else (s_andn2_b64 exec, saved, exec).Checklist
docs/experiments.md, "Exec-masked pixel regions".)AI-assisted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B48PpcRN2Er51keRf2DsS5
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T19:55:16Z.
6d5072aresolves the test registration conflict after #964. Static checks and the complete LLVM 15 binary run passed. The masked-region body and 64-bit shifts each passed on both WARP and RTX 4060 Laptop, keeping the no-mask reference mutation and old shift controls. The updated head is waiting for Windows CI.Imported from R0Y00/Xbox2Windows. Originally posted by lantiumBot on 2026-11-23T21:56:59Z.
First
_hardwareresult for this draw on RDNA 4. Data only.pixel_aot_region_body_hardwarepassed on an AMD Radeon RX 9060 XT, andpixel_aot_region_body_warppassed on in-box WARP, at mergedmain.44c7a7b, clean tree,devpreset (Debug)Two runs on hardware (one alone, one in the full
_hardwareset), one on WARP, 0 capability skips. CTest verdict only; the test prints no per-case lines on success.AI-assisted (Claude Code - Fable 5.2); runs executed locally on the adapter above.