shader: lower the plain bfrev, ffbh and ffbl forms in pixel_aot #749
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/755"
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 JB2WIN on 2026-11-23T00:58:22Z.
Change
tools/pixel_aot.pynow lowers the plain VOP1 forms ofv_bfrev_b32,v_ffbl_b32,v_ffbh_u32andv_ffbh_i32, in both the_e32and_e64encodings. These forms were already accepted as quad-local DPP; this adds the plain spellings. Following your note in #735,v_xnor_b32is left to #728. The fixtures still use it as a fourth lane.INTEGERtable and reuse the DPP lowering only where the semantics are the same:reversebitsforv_bfrev_b32;firstbitlowforv_ffbl_b32, which gives0xfffffffffor zero, as the DPP path does;dpp_ffbh_u32anddpp_ffbh_i32helpers forv_ffbh_*. A newINTEGER_HELPERSmap requests them, and each is emitted once, only when used.ValueError: source modifiers,clamp, wrong operand counts andv256. SDWA, 64-bit and 16-bit variants are out of scope.INTEGERtable; no scanner edit was needed.Refs #735. AI-assisted (Claude Code).
Verification
Environment: Windows 11 10.0.26200.9974, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818. The D3D12 debug layer was enabled. The head is rebased on
356a7be.Draw
draw-plain-bitscan(pixel_aot_plain_bitscan_{hardware,warp}):_e32and_e64with a literal source.s44..s47directly, so no input passes through a float VGPR.0,0xffffffff,0x80000000,1,0x7fffffff,0xffff,0xaaaaaaaa,0x12345678and0xfffffffethrough every source register. That covers the zero/all-ones sentinels and sign-only inputs for every op.Mutations: four controls must each report a mismatch. On both adapters, the mismatching cases were:
ffbh_i32→ffbh_u32(signed vs unsigned control)ffbl_b32→ffbh_u32xnor_b32→xor_b32bfrev_b32→not_b32Before any draw runs, a Python check confirms that each mutation changes its own lane.
Dev-time check (not committed): with the new
INTEGERentries removed, both the controls andform_coverage_check.pyfail.Results:
ctest --preset dev --no-tests=error -R "^pixel_aot_plain_bitscan_": 2/2 passed, in 7.9 s on the hardware adapter and 2.6 s on WARP.ctest --preset dev --no-tests=error: 328 of 330 passed. The two failures arepixel_aot_predicate_rounding_{hardware,warp}, caused by theNameErrorincheck_scalar_carry_chain_drawthat is already onmainand that #752 fixes; it is not related to this change. The skips arebvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warp, the same as onmain.tests/pixel_aot_check.py binarywith LLVM 15.0.7 exits 0, including the_e64literal.llvm-mcruns locally through aclang -cc1asshim.form_coverage_check.py,rdna2_tools_check.py,pso_readiness_check.pyanddocs_links_check.pypass.Notes
check_bfm_draw.int_operand, an untracked VGPR source raisesKeyErrorinstead ofValueError.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-23T01:42:09Z.
I rebased this on
37ed46dand squashed it into one commit,v_xnor_b32stays out of scope.pixel_aot_plain_bitscan_{hardware,warp}passes 2/2 (5.9 s / 1.8 s), the controls and the LLVM 15 binary round trip pass, and the full suite has 332 of 333 passing.The one failure is
pixel_aot_predicate_rounding_hardware, which hits its 60 s timeout on this RTX 3080 even when run on its own. This change does not touch that mode. On another branch from the same base it passed in 56.4 s, so on this adapter it now sits right at the 60 s limit onmain.Imported from R0Y00/Xbox2Windows. Originally posted by FZNull on 2026-11-23T01:53:08Z.
Verified on
d3649785737e4e04a5330a30c1f47dc184d4cccf(rebased onto main37ed46d) on an NVIDIA GeForce RTX 4060 (driver 32.0.16.2124, Windows 11 build 26300) and on WARP (Microsoft Basic Render Driver, driver 10.0.26100.10068). The D3D12 debug layer is unavailable on this host.37ed46d: clean fast-forward, no conflicts.ctest --test-dir out/build/wt-pr755 --no-tests=error -R '^pixel_aot_' -V: 32/32 passed in 346.5 s, and no test hit CTest's 60 s cap in this run, so the out-of-ctest fallback was not needed.pixel_aot_plain_bitscan_hardware: passed in 5.94 s on the RTX 4060. The fixture compares its nine rotated-word cases against the Python bit-loop reference and asserts all four mutations.pixel_aot_plain_bitscan_warp: passed in 1.43 s on WARP with the same cases and mutations.pixel_aot_hardware: passed in 52.72 s,max_absolute_error=0;pixel_aot_warp: passed in 10.35 s,max_absolute_error=0.python -B tests/form_coverage_check.py: passed in 6.5 s. The new records listv_bfrev_b32,v_bfrev_b32_e64,v_ffbh_u32,v_ffbh_u32_e32,v_ffbh_u32_e64,v_ffbh_i32,v_ffbl_b32_e32,v_xnor_b32andv_xnor_b32_e64; the out-of-scope e64 spellings (v_ffbl_b32_e64,v_ffbh_i32_e64) stay uncovered, as the PR states.After the run
mainmoved tof714d2f;git merge-treereports this head still merges without conflicts there, though the suite was not re-run on that tip.AI-assisted.