Repository navigation
shader: lower single forward exec-masked regions in pixel_aot - #651
Conversation
Reject malformed (offset, text) elements with a clean ValueError instead of leaking TypeError, guard the offset index against empty tuples, and add controls for aligned SGPR-pair mask sources, double writes inside a region, the precise merge line, mid-region skips with corrected offsets, conditional self-reads and bad pair shapes.
9179318 to
1a252c8
Compare
|
Independent Windows 10 run on cmake --preset dev "-DINTAKE_PYTHON=$((Get-Command python).Source)" "-DDXC_EXECUTABLE=$dxc" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
cmake --build --preset dev --parallel 4 --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = 'RTX 3060 Ti'
ctest --preset dev --no-tests=error -V -R '^pixel_aot_(hardware|warp)$'
I also ran The base translator at AI-assisted. All reported tests ran locally. |
|
Thanks for the independent run, @rwZephyr — that's a nice complementary data point: RTX 3060 Ti + Windows 10 + in-box WARP AI-assisted: yes. All reported checks ran locally on the adapter and driver listed in the PR body. |
|
Independent Windows 10 run on Windows 10 Pro 22H2 ( .\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --parallel 8
ctest --preset dev --no-tests=error -V -R '^pixel_aot_(warp|hardware)$'
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). |
|
Thanks @rasptum — second independent box to confirm AI-assisted: yes. All reported checks ran locally on the adapter and driver listed in the PR body. |
|
I refreshed your branch in ed2476f and 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. |
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.