Slot 86 (Mesh86) pixel stages: first refusal per stage, and what clears it #3816
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#3816
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@lukaslw-lab on GitHub · 2026-12-02 02:35 UTC · original
Refs #3642, #3643, #3705.
The Mesh86 work in #3705 tracks the mesh halves. The pixel halves of the same pipelines have their own walls. This
is an offline census of every captured slot 86 pixel stage through
compile_dxil gfx1013-mesh86-ps, the sametranslate_graphics_containercall the runtime makes for a Mesh86 pair.Capture: one arm-B run (
X2W_NATIVE_MESH86=1) of the local case-study package, main158ef794. Counts only, noshader bytes. 6,436 distinct
.ps86+.root(24,817 requests); 11 are empty (depth-only, 2,958 requests) and arerefused before translation. (#3805 counts requests with no pixel stage in another cache, 987 of 3,876
.m86; thistable counts distinct stages from one run, so the two numbers do not compare directly.) The remaining 6,425 real
pixel stages:
s_mov_b64 s[4:5], exec; v_cmpx_*; s_cbranch_execz ELSE; …; ELSE: s_andn2_b64 exec, s[4:5], exec; s_cbranch_execz JOIN; …; JOIN: s_mov_b64 exec, s[4:5]):pixel_readonly_armsonly matched theone-armed skip. #3817 adds the flat form. On this census 322 stages (574 requests) move on; they next stop at
"looping graphics shader uses an entry input operation after a branch" (315) and readfirstlane (9). The 24 pixel
stages of the Mesh86 draws selected in the run all pass every CMPX region.
loads or WQM tails, SAVEEXEC fed by
s_xor/s_ormasks, a CMPX if nested inside an arm, and uniformvccnz/sccbranches inside an arm.validate_raster_link(ms, ps)andmake_native_mesh86_rooton the pair.Command:
ps86_census.py <compile_dxil> <dxc> <cache> <out> 0 6(every distinct stage, 6 jobs). The script is alocal helper; I can add it under
tools/if that is useful.AI-assisted.
s_bitset1_b32, then stop at a scalar loop #3705s_bitset1_b32, then stop at a scalar loop #3705@lukaslw-lab on GitHub · 2026-12-02 04:52 UTC · original · edited 2026-12-02 21:54 UTC
Work split on main
0dd65da1Same capture and method as above. Main now includes #3817: 272 of 6,425 real pixel stages translate. #3821 (WQM complementary arms) changes no first refusal on this capture: its shape is not the first one any of these stages reach.
The two largest refusals, split by the instruction shape at the refusal (offline disassembly of the refusing stages; only the refusal site and its branch target are classified, not the arm contents):
graphics branch on a wave mask(3,048 stages). Shares from a 600-stage random sample, scaled to 3,048:s_and_b64 exec, exec, sN(coverage re-applied)s_xor_b64 sN, sM, -1mask ("if not")s_wqm_b64(WQM re-entered after the arm)s_or_b64/s_and_b64masks_andn2_wrexec_b64+ backwards_cbranch_execnz, withv_readfirstlanegraphics wave or control-flow instruction(728 stages, all classified):v_mul_legacy_f32/v_fract_f32, thenv_cmpx_lt/gt_f32)s_and_b64 exec, exec, sNafter interpolation (coverage mask)v_writelane_b32(SGPR spill to a VGPR lane)s_and_b64 vcc, exec, vccOther first refusals: DPP8 quad selection 844, branch into a masked region 363 (and into a CMPX region 53) (timbot103, #3851 draft), lane-local vector arithmetic in a masked region 344 (timbot103, #3842 draft), looping shader reads an input after a branch 315 (timbot103, #3833 merged), EXEC read at entry (
undefined graphics register 126) 212 (timbot103, #3836 draft), scalar memory addressing 116 (timbot103, #3835 draft: DLC/GLC part), scalar condition on a varying input 73 (timbot103, #3847 draft), smaller ones 70.5770f14e(2 Dec): still 272 translate, of 6,436 stages run. With #3849 (draft,7947b4e9) on top: 546, none lost.f365f125+ #3827 + #3828, #3830, #3831 still translates 272 (0 gained, 0 lost); 118 stages change their first refusal. Most G1 kills use a live-mask form that #3831 does not accept yet (details on #3831).AI-assisted.
@timbot103 on GitHub · 2026-12-02 06:42 UTC · original
Claiming three independent pixel-stage slices from the
0dd65da1split above (each as its own focused PR with dedicated source-built DXIL + GPU readback fixtures):v_cmpx_*lane kill without saved EXEC, post-interpolation coverage re-application (s_and_b64 exec, exec, sN), and one-armed CMPX skips followed by coverage re-application.s_and_saveexec_b64fed bys_xor_b64 sN, sM, -1/s_not_b64("if not") ands_or_b64/s_and_b64/s_andn2_b64compare-mask combinations.@timbot103 on GitHub · 2026-12-02 07:27 UTC · original
All three claimed slices are now open for review:
s_and_saveexec_b64lane-mask expressions): #3828v_cmpx_*kills,s_and_b64 exec, exec, sNcoverage re-application, and combined one-armed CMPX coverage restore): #3831@timbot103 on GitHub · 2026-12-02 07:45 UTC · original
Claiming three more disjoint
#3814slices (will stage as Draft PRs per #3516 until our active review slots open, each with source-built DXIL + WARP/RTX 5080 hardware tests):looping graphics shader uses an entry input operation after a branch(~315 stages — the main second wall uncovered by #3817):emit_graphics_loopsentry interpolation / barycentric handling.unsupported scalar memory addressing(~116 stages): safe read-only graphics SMEM addressing forms.undefined graphics register 126(entry EXEC reads, ~212) + G3 (v_writelane_b32, 21) + G4 (s_and_b64 vcc, exec, vcc, 16) (~249 stages).@timbot103 on GitHub · 2026-12-02 08:04 UTC · original
Wave 1 Draft PRs opened (and claiming 2 more disjoint
#3814slices to stage as Drafts per #3516):pixel_readonly_armsandemit_graphics_loops):masked graphics region requires lane-local vector arithmetic(~344 stages): extend safe lane-local ops inside flattened masked regions (GraphicsMaskRegions).PixelWaterfalls(src/gfx1013_pixel_waterfall.inl) fors_clause,v_cmp_eq_* + s_and_saveexec_b64partition form, explicit-LOD / additional image ops, non-in-places_lshl_b32, and constant descriptor offsets.@timbot103 on GitHub · 2026-12-02 08:23 UTC · original
Draft PRs opened & claiming next disjoint
#3814slice (staged as Draft per #3516):v_writelane_b32+ G4s_and_b64 vcc, exec, vcc), #3841 (W6 pixel descriptor waterfall extensions — updating link once created).graphics scalar condition depends on a varying input(73 stages — safe wave/quad-uniform scalar branch proofs and per-lane scalar-compare reconvergence where sound).@timbot103 on GitHub · 2026-12-02 08:35 UTC · original
Wave 2 Draft PRs opened & claiming next unclaimed
#3814slices (staged as Drafts per #3516):s_mov_b64 sK, exec->v_cmpx_*->s_andn2_b64 sK, sK, exec->s_cbranch_scc0 L->s_and_b64 exec, sC, sKform noted on #3831, ~566 stages).branch enters a masked graphics region(363) +branch enters a CMPX region(53) (416 stages).s_wqm_b64(WQM re-entered after the arm).@timbot103 on GitHub · 2026-12-02 08:44 UTC · original
Early Wave 3 Draft PR opened & claiming W7 (staged as Drafts per #3516):
shader/pixel-varying-scalar-cond— varying pixelVCCZshortcuts + uniform VGPR comparisons, 73 stages; 21 WARP + RTX 5080 draws).pixel_readonly_arms, building on #3817).@timbot103 on GitHub · 2026-12-02 09:01 UTC · original
Wave 3
#3814Draft PRs opened (staged as Drafts per #3516):shader/pixel-live-mask-kill): live-mask G1+G2 alpha kills (s_mov_b64 sK, exec->v_cmpx_*->s_andn2_b64 sK, sK, exec->s_cbranch_scc0->s_and_b64 exec, sC, sK, ~566 stages) +--startup-pixel-atomicatomic-after-kill GPU readback +mesh86-pixel-execz.mdupdate.shader/pixel-w5-wqm-reentry): W5 whole-quads_wqm_b64EXECZ joins (~270 stages).shader/pixel-branch-masked-region): structured branches & shared restores in masked/CMPX pixel regions (416 stages).shader/pixel-w7-cmpx-ifelse): W7 extended two-armed CMPX if/else arms (~130 stages).@lukaslw-lab on GitHub · 2026-12-02 23:27 UTC · original
Claiming
graphics readfirstlane requires a wave-uniform reaching valuewhere the read is in a loop (332 stages / 612 requests stop at this refusal on main517854f0b; not a row on the board above).v_readfirstlane_b32. Uniform facts are not recorded for general vector ALU inside loops.finish_loop_dependencies(), as the loop branch conditions already are.unsupported wave64 scalar mask operation(s_cselect_b64 sN, exec, 0in the 24); 10 stay, not looked at. 0 gained, 0 lost: this only exposes the next wall.v_readfirstlane_b32inside a CMPX arm (#3852), and thes_cselect_b64wall behind it.AI-assisted.
@lukaslw-lab on GitHub · 2026-12-02 23:38 UTC · original · edited 2026-12-03 04:42 UTC
Work split on main
517854f0bSame capture and method as above. 272 of 6,436 stages translate (unchanged since
0dd65da1). The merged slices moved stagesonward without new passes. Shapes come from offline disassembly of the refusing stages. They are classified by the instruction at the
refusal and its branch target only, not by the arm contents. Item names are new; the
0dd65da1items are linked where the shape isthe same.
graphics readfirstlane requires a wave-uniform reaching value: loop counter carried over the back edges_cselect_b64 sN, exec, 0in a loop: next refusal of 322 of L1's stagesundefined graphics register 126:s_cselect_b64 sN, exec, 0(118 of 224) ands_mov_b64 sN, exec(100)graphics wave or control-flow instruction: alpha killv_cmpx_gt/lt_f32with no saved EXEC (573 of 648)5770f14e: +274 OK)v_writelane_b32(23),s_and_b64with EXEC (30)DPP8 requires repeating quad-local selections:v_min_u32_dpp(≈ 515) andv_or_b32_dpp(≈ 330) withdpp85770f14e: 252 moved, 0 OK)unsupported exact-mask operation after whole-quad entry(76 moved here fromgraphics wave or control-flow instructionsince5770f14e)graphics branch on a wave mask(2,636). 600-stage random sample, 496 in the 25 most common shapes, scaled to 2,636:s_and_b64 exec, …(the W1 shape)s_xor_b64 sN, sM, -1(W3 shape)s_or_b64/s_and_b64(W4 shape)s_andn2_b64 exec(W7 shape)5770f14e)s_wqm_b64(W5 shape)5770f14e)validate_raster_link(ms, ps)andmake_native_mesh86_rooton the pair.517854f0b; a new census follows.AI-assisted.
@R0Y00 on GitHub · 2026-12-03 04:36 UTC · original
Main now includes #3842 (
d1d727f1) and #3836 (368a045d). The first extends lane-local operations in flattened pixel arms and keeps the incoming value when a write covers fewer lanes than the eventual read. The second adds wave64 EXEC-mask combines and dedicated scalar lane spills. Independent Windows Debug fixtures for both passed together on WARP and RTX 4060 Laptop. The new exact-coverage refusal and an altered spill read both caught the intended regressions. The 6,436-stage census has not been repeated on these commits, so the counts above still correspond to their recorded baselines.@lukaslw-lab on GitHub · 2026-12-03 05:00 UTC · original
Pixel census on main
9dfe168a0Same capture and method as the work split: every distinct slot 86 pixel stage, one first refusal each. Rerun after the 3 Dec merges (#3835, #3836, #3841, #3842, #3847, #3849, #3906).
548 of 6,436 translate (272 on
517854f0b). 274 of the 276 new passes come from #3849's alpha kills; the other two stopped atunsupported pixel entry VGPR 6before. The other merges moved stages to later refusals without new passes, and #3835, #3842 and #3847 moved none of the stages in their own rows.517854f0bgraphics branch on a wave mask(shapes B1–B6 on the split)DPP8 requires repeating quad-local selectionsgraphics wave or control-flow instruction, what #3849 leftunsupported wave64 scalar mask operation:s_cselect_b64 sN, exec, 0in a loop, after #3906masked graphics region requires lane-local vector arithmeticundefined graphics register 126(#3836 moved 49 on)unsupported scalar memory addressinggraphics scalar condition depends on a varying input(12 moved in from K)unsupported exact-mask operation after whole-quad entryunsupported packed FP16 interpolation operandsgraphics readfirstlane …left after #3906AI-assisted.
s_bitset1_b32, then stop at a scalar loop #3705@timbot103 on GitHub · 2026-12-03 10:05 UTC · original
Claiming L2,
unsupported wave64 scalar mask operation, thes_cselect_b64 sN, exec, 0in a loop (322) on the9dfe168a0census. Your note says all 24 Mesh86 draw partners now stop there, so this looks like the next pixel gate for #3643. If you already planned it as a follow-up to #3906, say so and I'll pick another row.All fixtures will be source-built, with Windows Debug and Release readbacks on WARP and the RTX 5080. A few normalized loop shapes would help us match the real form. In particular: where the selected mask is consumed, and whether the loop exits on SCC or on an EXECZ test.
@timbot103 on GitHub · 2026-12-03 10:32 UTC · original
L2 is up for review. It lowers
s_cselect_b64 sN, exec, 0in wave64 pixel loops when SCC is proven wave-uniform, along with the SAVEEXEC/EXECZ gate and thes_and_b64consumers. Everything else stays refused. The census delta, including the 24 Mesh86 pixel partners, is still to be measured.@timbot103 on GitHub · 2026-12-03 10:33 UTC · original
Also taking what is left of E1,
undefined graphics register 126(175). Its shapes ares_cselect_b64 sN, exec, 0ands_mov_b64 sN, execoutside loops, which sit next to the L2 lowering in #3920.