shader: lower v_subrev_f32_dpp and more v_writelane_b32 shapes #3487
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3487
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3485"
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?
@Leyukaka on GitHub · 2026-11-29 17:25 UTC · original
Leyukaka:shader-gfx2hlsl-late-gaps→main· +146 −16 · 4 files · 1 commits · openRefs #3480 (items 1 and 2).
What changes
tools/startup/gfx2hlsl.py:v_subrev_f32_dpp: no new lowering. The existing table entry and the DPP pair/broadcast path already giveF(v2) - F(v256)(SRC1 minus the permuted SRC0). What refused these shaders was as_mov_b64 exec, exec/s_mov_b32 exec_lo, exec_lobetween thes_wqmand the read. A move of EXEC to itself without modifiers is no longer counted as an EXEC writer byquad_flow_refusals, and in a pixel stage_lowerreturns before touching the EXEC/WQM state (the instruction writes neither EXEC nor SCC). The other users ofwrites_execare unchanged.v_writelane_b32, lanes k and k+32 of one VGPR: accepted in straight-line code when everyv_readlane_b32of the slot follows a last write to the same lane, and at least one such reload exists. Wave32 (slotk & 31) and wave64 (lanek) then read the same write. A read with no prior write, or after a write to the other lane, is still refused.v_mov_b32 vN, <SGPR or immediate>without modifiers, no instruction in the program writes EXEC, and no lane read or write follows.formatted_descriptor_from_blockproves its local table load. A copied word (s_mov_b32) is refused.The existing refusal messages and conditions remain for every shape outside these proofs.
Tests
Two new
late-gaps <llvm-mc>modes (startup_gfx2hlsl_dpp_quad_broadcast_check.py,startup_gfx2hlsl_sgpr_spill_check.py), registered intests/cmake/startup_gfx2hlsl_late_gaps.cmakewhenllvm-mcis found. They assemble the accept and refuse controls for each shape above.These two modes did not run on our host:
llvm-mcis not installed there, so CTest did not register them. The Linux CI job has LLVM 15 and should run them. Until it does, the new accept/refuse controls are unexecuted, and no mutation was run against them.Passed on our host (pure-Python modes, 0 FAIL): dpp_quad_broadcast, sgpr_spill, dpp_pair, dpp_quad_flow, dpp_quad_swap, spill_branches, compute_spill, compute_mask_spill, mesh57_lane_spill, mesh57_skeleton, mesh57_depth_only, mesh57_loop, mesh57_loop_refusal, gfx2hlsl_refusals, gfx2hlsl_op_refusals, triage_run, refusal_census. The 11 registered ctest entries for these passed.
Not covered
gfx2hlsl.py. They merge without conflict; the combined tree was not tested.@lukaslw-lab on GitHub · 2026-11-30 08:25 UTC · original · reviewed
Reviewed
18434d7cby reading the diff; not built or run.Verdict: comment. I found no defect in the four proofs, but none of the new accept/refuse controls has run yet. No MUST.
late-gapsmodes ran nowhere at this head. In run 46289500579, the gfx1013 job runssgpr_spill_check.pyonly asbinaryand does not rundpp_quad_broadcast_check.py. The Linux job runssgpr_spill_check.pywith no arguments, and the Windows job registers no*_late_gapstest (nollvm-mcfound). So the three widened shapes have no executed test and no mutation. One local run with LLVM 15llvm-mc, pasted here, would settle it.writes_execchecks destinations, so only the exacts_mov_b64 exec, exec/s_mov_b32 exec_lo, exec_lowithout modifiers leaves the writer list (gfx2hlsl.py:4989). The early return in_loweris pixel-only and comes after the fetch-call check.spill_operandsrefuses register lanes (:9556), so no write to an unknown slot can slip in.last_write[lane & 31] == laneat each read means wave32 and wave64 read the same write. Pairs still refuse with branches (quad_flow_straight) or with no observed reload.v_mov_b32 v<n>, <non-VGPR>with no modifiers, no instruction in the program writes EXEC, and no lane op follows. Vertex, compute and mesh keep the old refusal (self.kind != 'ps').formatted_descriptor_from_block.provencomes fromspill_word_provenas in compute. #3488 does not change the block proof, so the two PRs do not interact here.Tests: CI ran only
sgpr_spill_check.pyin its old modes (no arguments,binary), both ok. Neither reaches the new lines, since every new control lives inlate-gaps.@R0Y00 on GitHub · 2026-12-02 12:21 UTC · original · requested changes
On
18434d7c, LLVM 15.0.7 ran the SGPR spilllate-gapsmode successfully. The DPPlate-gapsmode fails incheck_late_gapsattests/startup_gfx2hlsl_dpp_quad_broadcast_check.py:329:ps_hw_inputs=PACKEDpasses an integer wherePipelineexpects(enable, address). In an isolated copy, changing that argument tops_hw_inputs=(PACKED, PACKED)(the same pair used by this file's other pipeline constructor) makes all six DPP controls pass, including both subtraction results and the EXEC refusals. Please commit that fixture fix and make these LLVM modes run in the gfx1013 CI job so a future signature change reaches them.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.