shader: lower pixel live-mask alpha kills (Part of #3814) #3847
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3847"
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 timbot103 on 2026-12-02T08:58:16Z.
Part of #3814 (follow-up to #3829's 2 Dec census breakdown).
Summary
Lowers the dominant wave64 live-mask alpha-kill triple identified in #3829's census follow-up (105 of 106 remaining G1 stages, ~566 real pixel stages):
killed = cmp_result,dx.op.discard(killed),lane_alive = lane_alive & ~killed) and strictly rejects inverteds_andn2_b64operand orders, overwritten/escaped live masks, and revived pre-kill masks.mrt0..7) and depth (mrtz) exports, WQM exact-coverage restoration (s_and_b64 exec, sC, sKwith proven entry-coverage tag"0"), resetsexact_after_wqmif a later chained kill restores a WQM live mask vias_mov_b64 exec, sK, and gates post-killbuffer_atomic_addthrough survivinglane_alivecoverage.--startup-pixel-atomictooffscreen_check(without altering--startup-pixel-words) to verify real GPU atomic counters after kill, and updatesdocs/experiments/mesh86-pixel-execz.md+docs/experiments/native-pixel-live-mask-kill.md.Verification
compile_dxil,offscreen_check, andnative_pixel_ir_dumpin Debug (dev) and Release (release) with zero new C++20/W4warnings on edited lines.ctest --preset pr --no-tests=error --output-on-failure -R '^native_pixel_live_mask_kill_controls$': passed (11 validated DXIL cases + 27 refusal controls).dev) and Release (release): 7/7 passed (native_pixel_live_mask_kill|native_pixel_wqm|native_graphics_wqm|native_direct_container), zero skips, plusoffscreen_check --self-testin both builds.10.0.26100.9818) and NVIDIA GeForce RTX 5080 (32.0.16.2140) on Windows 11 (26200.9974): verified 126 color pixels (7×3 odd edges exercising WQM helper coverage), two atomic-after-kill counters matching surviving pixel count12, and wrong-reference failures.tests/bidi_controls_check.py,tests/docs_links_check.py, andgit diff --check origin/main..HEADpassed.#3514's 5-PR ready cap.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T09:34:36Z.
Review: APPROVED
Reviewed
9074d442(draft) by reading the diff and running an offline pixel census of this PR alone; not otherwise built or run.Verdict: approve. The kill polarity is right (the
v_cmpxselects lanes to kill), the live mask stays one lane bit, and everything after the kill is lane-local. No MUST.Census,
f365f125+ this PR alone, same capture as #3814 (6,436 pixel stages): 272 → 546 translate (+274), none lost, no validation failures. 274 stages leavegraphics wave or control-flow instruction, and 2 move tounsupported live-mask kill suffix.gfx1013_direct_graphics.inl), with #3828 and #3833 (the same three harness files, a third extension ofstartup_flat_param), and with #3826 (mesh86-pixel-execz.md). #3829 also adds its ownlane_aliveandcovered_lane()change, so the two PRs need one shared notion of "alive" when they meet.gfx1013_direct_graphics.inl:2148):killed = cmp,discard(killed),lane_alive &= !killed. Heres_andn2_b64 sK, sK, execis only a filter (its pair and SCC are cleared), and inverted operand orders are rejected infind.lane_alivestarts as!IsHelperLaneat the save (:2138).covered_lane()returns it afterwards (:2112), so the exact predicate and the post-killbuffer_atomic_addboth drop killed lanes.s_and_b64 exec, sC, sKneedssCtagged as entry coverage.s_mov_b64 exec, sKafter a WQM save keeps whole-quad mode, and the suffix must then be lane-local (:2177).gfx1013_graphics_wqm.inl:41): the first branch is thescc0guard to the EXP_NULL tail, there is no export ors_endpgmbefore the kill, the live pair is not clobbered, and the final group is exports with DONE only on the last. The skips and the null tail are removed only when the whole shape matches. The suffix (local_tail) allows only loads, explicit-LOD images and lane-local ALU, so nothing reads a discarded lane.Tests:
_controls(11 cases, 27 refusals) is in theprfilter. The color and atomic-after-kill draws ran only locally.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T20:25:54Z.
Review: APPROVED
Re-review on
7947b4e9(rebased on5770f14e, filters now clear compare masks and SCC,stale-compare-maskcontrol).Verdict: approve. It now conflicts with main and needs a rebase.
Census, same capture and method as before (6,436 distinct pixel stages), main
5770f14evs this head:graphics wave or control-flow instruction)graphics branch on a wave mask→unsupported live-mask kill suffix)Same result as the earlier head: this doubles the translating pixel stages on this capture.
Checked:
findaccepts only the documented shape: the reachings_mov_b64 sK, execsave, then per guardv_cmpx_*_f32→s_andn2_b64 sK, sK, exec→s_cbranch_scc0to the shared dead tail → an AND/MOV restore. Any other branch, export or clobber ofsK/EXEC returns without a match.sK, its compare-mask entries and SCC, so a laterv_cndmaskon that pair refuses (unproven graphics CNDMASK source).sKneeds the saved exact entry coverage, both infind(reachings_mov_b64 sC, exec) and at emission (tag0).AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T23:20:52Z.
Merged
main(67862ee4) into this branch (aa3f2f32); the reviewed commit7947b4e9is unchanged. The merge combines the shared kill state with main's exact-mode tracking.fc611e85fixes an interaction with #3829, which is now on main. After the merge,native_pixel_live_mask_kill_controlsfailed: the atomic guard queried helper status again after the discard, even though the saved live mask already carries raster coverage. The fix reuses the saved mask after each kill. It keeps main's helper check for alpha-test kills that have no saved mask.fec8b3aareplacesstring_view::ends_with.native_compute_pack_refusal_checkbuilds the frontend as C++17, which main CI compiles but PR CI does not, so this would otherwise have broken main's full build after merging.GPU results:
Tests, Windows 11 26200 with RTX 5080 and WARP. The filter was
native_pixel_|native_graphics_|native_direct_containerplus this PR's own tests. There were 0 failures and 0 skips, with 15 WARP and 12 RTX 5080 tests per configuration. A full Debug build of every target, including the C++17native_compute_pack_refusal_check, succeeded.offscreen_capability_table_self_testpassed.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T23:47:20Z.
Marked Ready for review now that #3827 and #3829 have merged, keeping to 5 non-draft PRs per #3514. CI is green at this head. All 17 open PRs from this batch were also merged together onto main
c42b7ce3. That combined tree passes a full build, and the only problems it showed were pre-existing main flakes plus one #3833/#3835 fixture issue that does not involve this PR; the #3835 fix is coming.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T00:44:47Z.
Review: APPROVED
Independently reviewed
fec8b3aa. The live-mask proof checks reaching coverage saves, CMPX/filter polarity and exact coverage for atomic side effects. MSVC Debug, Windows build 26300: ctest --preset dev --no-tests=error -j 1 -R "^(native_pixel_live_mask_kill_(controls|warp|hardware)|native_graphics_wqm_(ir|warp|hardware))$" passed 6/6. WARP and RTX 4060 Laptop (616.56), debug layer enabled, each matched 126 color pixels, 1,024 depth pixels and four atomic counts, with three wrong-reference controls caught. Permitting the reversed filter negated the reversed control. The restored head passed.