shader: lower single forward exec-masked regions in pixel_aot #645
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/651"
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 MarlomMedeiros on 2026-11-22T17:39:50Z.
Refs #338. Implements option A: a single forward masked-if region lowered
to per-lane selects, keeping the straight-line API for plain instruction
lists while branch-bearing programs arrive as (offset, text) pairs.
Summary
s_and_saveexec_b64 s[..], vcc|s[..]after a trackedv_cmpopens aregion: the old EXEC mask is saved into an even SGPR pair and the
condition applies as the new mask.
s_or_b64 exec, exec, s[..]closesit. An optional adjacent
s_cbranch_execzmay skip to the matchingrestore, with the displacement validated as a signed 16-bit value
landing on an exact instruction boundary.
around each instruction rejects any scalar, memory, sampling,
interpolation, export, wait, EXEC-affecting, cross-lane or DPP side
effect, and REGION_DENIED filters the instruction shapes up front.
precise float aluN_dst = (cond ? inner : outer).Registers first written inside are marked conditional; post-merge reads
of a path-undefined value reject until an unconditional write.
save/restore, and nesting, second skips, invalid mask sources,
wrong-pair or later same-pair restore targets all reject cleanly.
Tests
and -1, complementary sequential regions, and the skip variant both as
offset pairs and as a real label-based program round-tripped through
llvm-mc and the LLVM 15 disassembler.
and reversed-predicate plus mask-free mutants mismatch on both
adapters. Negative controls cover every rejection path.
tests/pixel_aot_check.py,form_coverage_check.py,docs_links_check.py,bidi_controls_check.pyall pass.Evidence
ctest --preset dev -R '^pixel_aot_warp$' -V: pass on1f16321/9179318, Windows 11 build 26300.10075, zero debug errors.ctest --preset dev -R '^pixel_aot_hardware$' -V: pass, GeForce RTX5070, driver 32.0.16.2135, D3D12 debug layer enabled.
tests/pixel_aot_check.py binarypass.AI-assisted: yes. All reported checks ran locally on the adapter and driver listed.
Imported from R0Y00/Xbox2Windows. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-22T17:39:58Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T18:54:40Z.
Independent Windows 10 run on
1a252c8162df82a8f28ed19605e994b7a8529bfe. Windows 10 22H2 build19045.6466, MSVC19.44.35230, Windows SDK10.0.26100.0, DXC1.8.2502.11. D3D12 debug layer unavailable on both backends.10de:2414), driver621.24(32.0.16.2124via DXGI). Full suite passed.1414:008c), driver10.0.19041.5794. Full suite passed.I also ran
check_masked_drawdirectly on both backends. The forward region, empty-mask skip, and complementary regions each matched the reference at thresholds0.5,10.0, and-1.0. All nine draws matched all 4,096 pixels with zero absolute error. The reversed predicate and removed mask produced the expected first mismatches at(0, 0)and(40, 0), respectively, on both adapters.The base translator at
7009a7erejected the same forward-region program ats_and_saveexec_b64, so the base comparison ended before rendering.AI-assisted. All reported tests ran locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-22T19:16:10Z.
Thanks for the independent run, @rwZephyr — that's a nice complementary data point: RTX 3060 Ti + Windows 10 + in-box WARP
10.0.19041.5794on your side, RTX 5070 + Windows 11 + WARP10.0.26100.10068on ours, so the masked-region draws and the(0,0)/(40,0)negative-control first mismatches now hold on two NVIDIA generations, two OS builds, and two WARP versions. Thes_and_saveexec_b64rejection on base7009a7ealso confirms the program only renders through the new region lowering.AI-assisted: yes. All reported checks ran locally on the adapter and driver listed in the PR body.
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-22T19:50:02Z.
Independent Windows 10 run on
1a252c8162df82a8f28ed19605e994b7a8529bfe(PR head).Windows 10 Pro 22H2 (
10.0.19045), D3D12 debug layer enabled. Built with the dev preset and the default SDK DXC.pixel_aot_hardwarepassed on NVIDIA GeForce RTX 3060 (10de:2503), driver32.0.15.9636. Debug errors 0, debug warnings 0. Every reported draw hadmax_absolute_error=0(49 result lines at zero error).pixel_aot_warppassed on Microsoft Basic Render Driver (in-box WARP,1414:008c), driver10.0.19041.5794. Debug errors 0, debug warnings 0.reversedandunmaskedmutants are checked inside both GPU tests and must returnmismatchon each adapter. Both held on WARP and on hardware, and the 9 masked cases (3 programs at thresholds 0.5, 10 and -1) passed.tests/pixel_aot_check.py,tests/form_coverage_check.py,tests/docs_links_check.py(126 links) andtests/bidi_controls_check.pyall exit 0.tests/pixel_aot_check.py binarywith LLVM 15.0.7 (llvm-objcopy,LLVM-C.dll) exits 0.This comment only covers the Windows 10 box above. The Win11 / RTX 5070 run from the PR body was not repeated.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-22T19:52:56Z.
Thanks @rasptum — second independent box to confirm
1a252c8, and it adds a third adapter generation (RTX 3060) and another in-box WARP. Especially useful that thereversed/unmaskedmutants held on both your backends, since those are the controls proving the draws actually depend on the mask logic.AI-assisted: yes. All reported checks ran locally on the adapter and driver listed in the PR body.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T13:13:15Z.
I refreshed your branch in
ed2476fand kept the current main line's vector uniform tracking, low-half rules and gfx1030 binary features. The masked region accepts a small per-lane move and binary32 ALU set. Branch-position input now rejects duplicate, unaligned and mixed positioned/unpositioned instructions. The new GPU checks have their own CTest entries.The LLVM 15 binary regression and form coverage checks passed. On Windows build 26200.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656 each passed the nine mixed/full/empty-mask cases with the debug layer enabled. Both the reversed-predicate and mask-free controls mismatched as expected. GitHub CI is running on the updated head.