Repository navigation
Conversation
6ecff0c to
d0a5e3d
Compare
Part of R0Y00#3814 (items G1, G2 and W1); refs R0Y00#3640, R0Y00#3641, R0Y00#3703. G1: a wave64 pixel v_cmpx_* outside every recognised EXEC region is an alpha-test kill when no later EXEC write can return its lanes. A new pre-pass (PixelLaneKills) accepts it only when everything after it keeps each lane to itself: no DPP, LDS, quad compare, implicit-LOD sample, image store/atomic, lane or wave operation, store, quadmask or s_wqm; EXEC is only narrowed, read by an arm's anchor save, or restored from a pair saved after the kill. No export may precede it, it must lie on every path to the code after it, and the program has no loop. It lowers to dx.op.discard of the failing lanes, with or without WQM, and in exact mode under the covered predicate. A following EXECZ (only lane-local work between) is proven: it is taken only by a wave with no surviving lane. Its target is a later instruction or the EXP_NULL block, which is dropped when every branch to it is such a skip. Coverage tests AND in the surviving lanes explicitly. G2: s_and_b64 exec, exec, sN (either order) with sN the saved entry coverage now leaves whole-quad mode where it is not the terminal mask, in the prologue or at the start of the unique post-dominating branch-free tail (exact_tail), and is a no-op in exact mode or without WQM entry. The exact-mode transition shared with s_mov_b64 exec, sN moves into enter_exact. W1: the plain one-armed CMPX skip followed by the coverage AND already translated; it now combines with G1 before or after. pixel_readonly_arms also takes a one-armed CMPX whose restore is the coverage saved before s_wqm_b64 exec, exec, and lowers that join as the exact transition. Every new rule accepts or ignores a shape. An ignored CMPX or skip keeps its existing refusal; a kill that does not dominate the code after it is refused by name. tests/native_pixel_alpha_kill_check.py: 16 accepted shapes (DXIL shape and a WARP/hardware readback of an 8x2 draw, each with wrong references that must differ) and 16 refusal controls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d0a5e3d to
b24a8d8
Compare
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed b24a8d8a by reading the diff; not built or run.
Verdict: approve. The discard matches the guest kill wherever lane_local_after accepts the code after it. Every shape it ignores keeps its old refusal. No MUST.
- SHOULD No fixture pins the one store-like form allowed after a kill.
lane_local_afteracceptsbuffer_atomic_add(gfx1013_direct_graphics.inl:1508). Killed lanes skip it only becausecovered_lane()now ANDslane_alive(:2287), which the atomic uses as its predicate (:3193). One draw with a kill and then an atomic add, checking the count of surviving pixels only, would keep that from silently regressing. - SHOULD No docs update. G1, G2 and W1 change what
docs/experiments/mesh86-pixel-execz.mdsays about CMPX and coverage handling. - SHOULD No measured stage count. 566 / 86 / ≈620 is the #3814 shape tally. A
ps86census onf365f125before and after would give the real gain. This can come in a follow-up. - NIT CI runs only
_controls:native_pixel_alpha_kill_warpis not in theprpreset filter. - NIT #3826, #3828 and this PR all change
pixel_readonly_arms. Two of them will need a rebase. - Checked, no finding:
- Killed lanes cannot come back. A restore of a pair saved before the kill is refused (
saved_after), and so is an arm anchored before the kill, because the backward anchor search stops at the kill's EXEC write. - With implicit-LOD samples, DPP, LDS, quad and lane ops refused, nothing reads a discarded lane. The no-op EXECZ skips and the dropped EXP_NULL block cut only code that runs with EXEC = 0.
exact_taillies after every branch andthen_fallthroughsedge, and is disabled by a backward branch or an earlys_endpgm.
- Killed lanes cannot come back. A restore of a pair saved before the kill is refused (
Tests: _controls compiles 16 shapes and 16 refusals (e.g. a restore that revives killed lanes). _warp/_hardware read back with wrong-reference and all-killed controls. CI runs _controls only (in progress at review time).
|
Census follow-up for the SHOULD in my review: on the #3814 capture, this PR does not yet move the G1 stages, because their kill uses a live-mask form that
Same capture and method as #3814. 6,436 distinct stages, run through In a 120-stage sample of the 648 that remain, 106 still stop at the
AI-assisted. |
|
@lukaslw-lab Thanks for the approval and the exact census breakdown of the live-mask G1+G2 kill form ( To keep this approved PR clean and ready to land without restarting review, I will follow up in a dedicated PR (staged as Draft under #3514) adding:
|
Lowers wave64 pixel alpha-test
v_cmpx_*lane kills without a saved EXEC restore, post-interpolation coverage re-application (s_and_b64 exec, exec, sNin either operand order), and combined one-armed CMPX skips with coverage restore/re-application (items G1, G2, and W1 of #3814).Part of #3814. Refs #3640, #3641, #3703.
Summary
PixelLaneKillsinsrc/gfx1013_direct_graphics.inl):v_cmpx_*as a lane kill when the program is acyclic, no export precedes it, it dominates all code after it (no crossing branch orthen_fallthroughsedge, no earliers_endpgm), and all subsequent instructions are lane-local (no DPP/DPP8, LDS, quad compare, implicit-LOD sample, image store/atomic0x08..0x1f,quadmask,s_wqm, lane/mbcnt/store/sendmsg/barrier ops, non-buffer_atomic_addatomics,EXEC/EXECZreads outside recognized arm anchors, or non-narrowingEXECwrites outside restores from pairs saved strictly after the kill).dx.op.discard(!keep)in WQM, exact mode, or non-WQM, updatinglane_alive(andcovered/graphics_predicatewhen active) socovered_lane()explicitly ANDs in surviving lanes rather than relying on post-discardIsHelperLane.s_cbranch_execzskip (with only lane-local quiet ops between and no branch entering the span) to either a later instruction or a terminalEXP_NULLblock (droppingEXP_NULLonly when every branch targeting it is such a skip).s_and_b64 exec, exec, sN&enter_exact):enter_exact.s_and_b64 exec, exec, sN(both operand orders) whensNis proven entry coverage (invariant_entry_masksor tag"0"): leaves WQM in the prologue or in the unique post-dominating branch-free tail (exact_tail, disabled on any backward branch or earliers_endpgm), and acts as a no-op when already in exact mode or outside WQM.pixel_readonly_armsso a one-armed CMPX skip whose restore is the entry coverage saved immediately befores_wqm_b64 exec, execlowers its join viacoverage_restores->enter_exact.tests/native_pixel_alpha_kill_check.py+tests/cmake/native_pixel_alpha_kill.cmake:s_endpgm).Verification
Host: Windows 11 (
10.0.26200.9974), MSVC C++20/W4(zero new warnings), inbox WARP (10.0.26100.9818), NVIDIA GeForce RTX 5080 (32.0.16.2140).dev) & Release (release):native_pixel_alpha_kill_controls: passed in both configs (16 accepted + 16 refusals).native_pixel_alpha_kill_warp: passed in both configs (WARP readback + wrong-reference mismatch controls + all-killed draws).native_pixel_alpha_kill_hardware: passed in both configs (RTX 5080 readback + wrong-reference mismatch controls + all-killed draws).native_direct_container,native_pixel_dxil,native_graphics_wqm_{warp,hardware,ir},native_graphics_vertex_vcc_join_{warp,hardware},native_pixel_cmpx_{discard_warp,if_else_controls,if_else_warp},native_pixel_compare_mask_{warp,hardware,container,ir}.tests/bidi_controls_check.py,tests/docs_links_check.py,git diff --check origin/main..HEAD: all clean.