You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shader: slot 86 mesh programs set the root SRV stride with s_bitset1_b32, then stop at a scalar loop #3703
On a local start-up capture (main1c634037, X2W_REFUSE_FIXED_MESH=1, X2W_NATIVE_MESH86=1), 24 slot 86 mesh pipelines become placeholders before they reach binding:
The translator already maps s_or_b32 <high>, 0x10000 to root_stride_one_high; s_bitset1_b32 <high>, 16 sets the same bit and is not recognised. #3702 adds it.
Offline (compile_dxil <dxc> <out> gfx1013-container-ms-texture-heap <request>.m86 <out>.cso), the next refusals with that change:
#3718 added the committed-buffer root SRV resolver and range-control fixture. #3807 added indexed raw table SRV binding to the native Mesh86 path, covering a supported record stride, wrong stride and unbacked descriptors with source-built mesh and pixel fixtures. #3764 fixed staged primitive index decoding. The remaining scene geometry stream and rasterization checks are tracked at #3763 and #3641.
Offline chain for the 24 programs, on #3702 (1c634037 + 22ba8dbe). To see past a refusal, a local copy of each request replaces the refused word: the loop back edge with s_nop 0, v_cvt_i32_f32 with v_cvt_u32_f32, v_mad_f32 with v_fma_f32. This changes what the programs compute; it only measures how far they get.
v_mad_f32 (×4) → raw buffer load needs offen with zero scalar offset and no modifiers
R
3
raw buffer load needs offen with zero scalar offset and no modifiers
What lies beyond the image load and the idxen offen load is not measured.
The loop is the same in all 18 programs apart from register numbers: one header, one back edge, 15 instructions, scalar only.
i = 0 ; bound n = dword 0 of root SRV 3 (#3639); n == 0 skips the loop
loop: flags = s_buffer_load_dword(table 1 slot 0 buffer, i * 0x130 + 0x50)
if (flags & 2) goto found_a
if (flags & 64) goto found_b
i += 1 ; if (i < n) goto loop ; s_add_i32, s_cmp_ge_u32, s_cbranch_scc0 <back>
none / found_a / found_b each set two VGPRs, then join at one block
The body has no VALU, VMEM, LDS, EXEC write or export. The loop sits inside a forward s_cbranch_execz region, and every exit branches forward into that region.
Proposed lowering, for the maintainer to accept or reject. In lower_mesh, admit a uniform scalar loop:
One header H and one back edge B (s_cbranch_scc0/scc1/s_branch to H).
[H, B] holds only SALU, SMEM, s_waitcnt and s_nop.
Every other branch in [H, B] goes forward past B and stays inside the enclosing EXECZ region. Nothing branches into [H, B] except at H.
Emit it as a DXIL loop:
A header block with a phi for each SGPR the body writes, and for SCC.
Exit edges carry their SGPR state into the existing forward-join merge.
Symbol state at H is the entry state joined with the back-edge state; every SGPR the body writes becomes numeric-unknown.
The trip count comes from guest data, the same as on the console; no cap. The graphics stages already build loops with block phis (gfx1013_direct_graphics.inl, loop_dependencies); the mesh emitter is forward-only today.
Fixture idea: a source-built mesh program with this shape that searches a small root or table buffer, with one case per outcome (none / bit 2 / bit 64) checked on WARP. Controls:
a VALU instruction in the body;
two back edges;
an exit into [H, B];
a back edge on VCC from a per-lane compare.
Work split. Comment here to claim an item, one PR each. Items 1 and 2 are independent of each other; item 3 can be done in parallel.
#
Item
Programs (first reached)
Size
Notes
1
Uniform scalar loop in lower_mesh, as above
18
large
design above
2
v_cvt_i32_f32 and v_mad_f32 in the mesh VALU list (the shared ALU already lowers both, gfx1013_direct_compute.inl:3389)
21
small
taking this one (said above)
3
buffer_load_dword ... idxen offen offset:N in the raw-load decoder (gfx1013_compute_native.cpp:285)
6
small–medium
4
2D image_load through a descriptor-table texture in the mesh path, plus its SRV in the slot 86 root (native_mesh86.inl). Today only the 1D heap slot map is accepted (gfx1013_direct_mesh.inl:1298).
Item 2 is in #3704 (independent of #3702). With both applied, the 3 v_mad_f32 requests reach the idxen offen load (item 3), and the 18 loop requests no longer stop at v_cvt_i32_f32 after the loop. Items 1, 3 and 4 are still open.
Taking item 3 (idxen offen raw loads through a table buffer V#, the graphics branch of the raw-load decoder). It doesn't change #3631's compute branch.
Taking item 1 (uniform scalar loop in lower_mesh), built to the design above. Loop-carried SGPRs and SCC go through local slots, so the single forward pass stays as it is; anything outside the narrow shape keeps the refusal. PR will follow; happy to change direction if the design is rejected.
Taking item 5: the "if not VCC" region in the C++ mesh frontend (s_xor_b64 sX, vcc, -1, then s_and_saveexec_b64, then s_cbranch_execz). It is next to the SAVEEXEC shapes of #3668, so I'll extend that path: accept the inverted VCC mask as the region condition, keep refusing any other operand to the s_xor_b64. Source-built fixture with WARP readback plus negative controls; PR stacks on nothing, and I'll report how far the 6 requests get on top of #3702/#3704/#3705.
Item 5 is in #3706. s_xor_b64 sD, vcc, -1 now goes through the mesh mask-complement path, so the following SAVEEXEC (in-skip if/else, paired, or if-only) takes it as an ordinary lane-mask pair. vcc_hi and any operand other than -1 still refuse. I haven't measured the 6 requests yet; I couldn't do a Mesh86 capture run on this host today. @lukaslw-lab, if you rerun your reach probe with #3702/#3704/#3705 + #3706, I'd like to see what comes next.
Item 6 (new, open): with #3702, #3704, #3705 and #3706 applied, the 6 idxen offen requests pass the "if not VCC" open. They stop at its first load with graphics register undefined on an incoming path: 274 / 276 / 278 (v18 / v20 / v22, the load's index VGPR). That VGPR is written under an earlier EXEC region, closed by s_mov_b64 exec, s[20:21] just before the s_xor_b64. So the join at that restore does not treat it as defined on every path. Details in #3706. Not claimed.
Status: item 1 (loop) in progress on our side; items 2/3/5 are in #3704 / #3705 / #3706; 3b waits for #3639; item 4 is open.
Thanks for the reach run, @lukaslw-lab. Taking item 6: the index VGPR (v18/v20/v22) written under the earlier EXEC region and read in the "if not VCC" arm after s_mov_b64 exec, s[20:21]. Same family as #3671: keep the partial write across the restore only where the reading mask is provably within the lanes that wrote it, and keep refusing every other read. Fixture with positive and negative controls; I'll stack it on #3706 and report the reach on the same 6 requests.
Item 1 is in #3707 (independent of #3702 / #3704 / #3705 / #3706). With #3702 and #3704 applied, the 18 loop requests pass the loop without any stand-in and stop at item 4 (mesh image load lacks a remapped Texture1D heap contract). Items 4 and 3b remain; 6 is with @mumba17.
Taking item 4: 2D image_load through a descriptor-table texture in the mesh frontend, routed to the shared image_io. The slot 86 runtime already binds 2D table textures (from #3638), so I expect no runtime change and nothing in the root-SRV path of #3639.
Census: every slot 86 program from a native Mesh86 run
This is wider than the 24 above, in case it helps choose what to do next. Counts only; request bytes stay local.
Capture.main1c634037, run with run_preset.py --console x --gpu nvidia --set translate=false, X2W_REFUSE_FIXED_MESH=1 and X2W_NATIVE_MESH86=1, 600 s from a saved profile, RTX 3090. It recorded 2,873 .m86 requests, 1,569 of them distinct by content. Each went through compile_dxil … gfx1013-container-ms-texture-heap.
First refusal per program, on main and with #3708:
Taking v_rcp_iflag_f32 in the mesh frontend. The shared ALU lowering already exists; I'll check its IEEE-flag semantics against the compute path and add tests. Item 6 stays mine too, after this.
v_rcp_iflag_f32 (371) is in #3709, together with v_ashrrev_i32 (50, same lane ALU list). Measured on top of #3708, those 421 programs now stop at v_and_or_b32 (144, already in @SimSalabimse's #3659), mesh heap slot lacks masked root constant provenance (142), s_cmp_le_u32 (85) and the offen raw-load form (51). Next for me is item 6.
Item 6: #3710. In my census, the undefined on an incoming path refusals come from a nested CMPX skip inside the vertex skip, where both exit to the same EXEC restore. The #3671 lane-limit tag was skipped there, so the restore erased the position VGPRs. With #3710, 32 more programs translate on main (267 → 299), and 65 more with #3706/#3708/#3709 stacked (389 → 454). No regressions.
One caveat, @lukaslw-lab: your 6 requests read v18/v20/v22 as a load index in the "if not VCC" arm, not in a count-guarded export. I can't reproduce them here because they need #3702/#3704/#3705 first. #3710 may not cover that read. If your probe still shows it with #3710 applied, I'll take that shape as a follow-up.
Opened #3827 for the claimed mesh small ALU cluster (v_cmpx_<p>_f32, s_cmpk_*, s_bcnt0/1_i32_b32, v_min_f32, v_bfi_b32) + v_pack_b32_f16 constant sources.
Claiming three disjoint #3703 mesh slices from the 0dd65da1 census (will stage as Draft PRs per #3514 until our active review slots open, each with source-built DXIL + verification fixtures):
unsupported image dimension or D16 (609 programs): D16image_load (and direct image dimension/D16 forms) in decode and lowering.
mesh vertex outputs do not share the position mask (308 programs): mesh vertex export mask matching when POS0 and PARAM exports have sound masks.
Activity
lukaslw-lab commentedon Dec 1, 2026
Offline chain for the 24 programs, on #3702 (
1c634037+22ba8dbe). To see past a refusal, a local copy of each request replaces the refused word: the loop back edge withs_nop 0,v_cvt_i32_f32withv_cvt_u32_f32,v_mad_f32withv_fma_f32. This changes what the programs compute; it only measures how far they get.v_cvt_i32_f32(×2) →mesh image load lacks a remapped Texture1D heap contractv_mad_f32(×4) →raw buffer load needs offen with zero scalar offset and no modifiersraw buffer load needs offen with zero scalar offset and no modifiersWhat lies beyond the image load and the
idxen offenload is not measured.The loop is the same in all 18 programs apart from register numbers: one header, one back edge, 15 instructions, scalar only.
The body has no VALU, VMEM, LDS, EXEC write or export. The loop sits inside a forward
s_cbranch_execzregion, and every exit branches forward into that region.Proposed lowering, for the maintainer to accept or reject. In
lower_mesh, admit a uniform scalar loop:s_cbranch_scc0/scc1/s_branchto H).[H, B]holds only SALU, SMEM,s_waitcntands_nop.[H, B]goes forward past B and stays inside the enclosing EXECZ region. Nothing branches into[H, B]except at H.Emit it as a DXIL loop:
The trip count comes from guest data, the same as on the console; no cap. The graphics stages already build loops with block phis (
gfx1013_direct_graphics.inl,loop_dependencies); the mesh emitter is forward-only today.Fixture idea: a source-built mesh program with this shape that searches a small root or table buffer, with one case per outcome (none / bit 2 / bit 64) checked on WARP. Controls:
[H, B];Work split. Comment here to claim an item, one PR each. Items 1 and 2 are independent of each other; item 3 can be done in parallel.
lower_mesh, as abovev_cvt_i32_f32andv_mad_f32in the mesh VALU list (the shared ALU already lowers both,gfx1013_direct_compute.inl:3389)buffer_load_dword ... idxen offen offset:Nin the raw-load decoder (gfx1013_compute_native.cpp:285)image_loadthrough a descriptor-table texture in the mesh path, plus its SRV in the slot 86 root (native_mesh86.inl). Today only the 1D heap slot map is accepted (gfx1013_direct_mesh.inl:1298).Related open work, none of which covers these items:
Taking item 2 only. Items 1, 3 and 4 are open. The reach probe can be rerun on any branch.
AI-assisted.
lukaslw-lab commentedon Dec 1, 2026
Item 2 is in #3704 (independent of #3702). With both applied, the 3
v_mad_f32requests reach theidxen offenload (item 3), and the 18 loop requests no longer stop atv_cvt_i32_f32after the loop. Items 1, 3 and 4 are still open.lukaslw-lab commentedon Dec 1, 2026
Taking item 3 (
idxen offenraw loads through a table buffer V#, the graphics branch of the raw-load decoder). It doesn't change #3631's compute branch.lukaslw-lab commentedon Dec 1, 2026
Item 3 is in #3705 (translator part). With #3702, #3704 and #3705 applied, the 6 requests pass the
idxen offenload. Two follow-ups:indexed_raw_srv: accept the view kind innative_mesh86.inland check the descriptor stride against the reflected one, asd3d12_draw.inldoes for VS/PS. It's in the material binder that resolve the 128-byte mesh root SRV for slot 86 #3639 is changing, so I'll do it after resolve the 128-byte mesh root SRV for slot 86 #3639 lands, unless the resolve the 128-byte mesh root SRV for slot 86 #3639 work takes it.s_xor_b64 s[20:21], vcc, -1, thens_and_saveexec_b64, thens_cbranch_execz(an "if not VCC" region). Close to the SAVEEXEC shapes of shader: lower VCC-mask and if-only mesh SAVEEXEC shapes in a lane skip (Part of #2413) #3668; not claimed.AI-assisted.
lukaslw-lab commentedon Dec 1, 2026
Taking item 1 (uniform scalar loop in
lower_mesh), built to the design above. Loop-carried SGPRs and SCC go through local slots, so the single forward pass stays as it is; anything outside the narrow shape keeps the refusal. PR will follow; happy to change direction if the design is rejected.mumba17 commentedon Dec 1, 2026
Taking item 5: the "if not VCC" region in the C++ mesh frontend (
s_xor_b64 sX, vcc, -1, thens_and_saveexec_b64, thens_cbranch_execz). It is next to the SAVEEXEC shapes of #3668, so I'll extend that path: accept the inverted VCC mask as the region condition, keep refusing any other operand to thes_xor_b64. Source-built fixture with WARP readback plus negative controls; PR stacks on nothing, and I'll report how far the 6 requests get on top of #3702/#3704/#3705.AI-assisted.
mumba17 commentedon Dec 1, 2026
Item 5 is in #3706.
s_xor_b64 sD, vcc, -1now goes through the mesh mask-complement path, so the following SAVEEXEC (in-skip if/else, paired, or if-only) takes it as an ordinary lane-mask pair.vcc_hiand any operand other than -1 still refuse. I haven't measured the 6 requests yet; I couldn't do a Mesh86 capture run on this host today. @lukaslw-lab, if you rerun your reach probe with #3702/#3704/#3705 + #3706, I'd like to see what comes next.AI-assisted.
lukaslw-lab commentedon Dec 1, 2026
Item 6 (new, open): with #3702, #3704, #3705 and #3706 applied, the 6
idxen offenrequests pass the "if not VCC" open. They stop at its first load withgraphics register undefined on an incoming path: 274 / 276 / 278(v18 / v20 / v22, the load's index VGPR). That VGPR is written under an earlier EXEC region, closed bys_mov_b64 exec, s[20:21]just before thes_xor_b64. So the join at that restore does not treat it as defined on every path. Details in #3706. Not claimed.Status: item 1 (loop) in progress on our side; items 2/3/5 are in #3704 / #3705 / #3706; 3b waits for #3639; item 4 is open.
mumba17 commentedon Dec 1, 2026
Thanks for the reach run, @lukaslw-lab. Taking item 6: the index VGPR (v18/v20/v22) written under the earlier EXEC region and read in the "if not VCC" arm after
s_mov_b64 exec, s[20:21]. Same family as #3671: keep the partial write across the restore only where the reading mask is provably within the lanes that wrote it, and keep refusing every other read. Fixture with positive and negative controls; I'll stack it on #3706 and report the reach on the same 6 requests.AI-assisted.
lukaslw-lab commentedon Dec 1, 2026
Item 1 is in #3707 (independent of #3702 / #3704 / #3705 / #3706). With #3702 and #3704 applied, the 18 loop requests pass the loop without any stand-in and stop at item 4 (
mesh image load lacks a remapped Texture1D heap contract). Items 4 and 3b remain; 6 is with @mumba17.lukaslw-lab commentedon Dec 1, 2026
Taking item 4: 2D
image_loadthrough a descriptor-table texture in the mesh frontend, routed to the sharedimage_io. The slot 86 runtime already binds 2D table textures (from #3638), so I expect no runtime change and nothing in the root-SRV path of #3639.mumba17 commentedon Dec 1, 2026
Census: every slot 86 program from a native Mesh86 run
This is wider than the 24 above, in case it helps choose what to do next. Counts only; request bytes stay local.
Capture.
main1c634037, run withrun_preset.py --console x --gpu nvidia --set translate=false,X2W_REFUSE_FIXED_MESH=1andX2W_NATIVE_MESH86=1, 600 s from a saved profile, RTX 3090. It recorded 2,873.m86requests, 1,569 of them distinct by content. Each went throughcompile_dxil … gfx1013-container-ms-texture-heap.First refusal per program, on main and with #3708:
s_not_b32/s_bfe_i32/s_brev_b32v_rcp_iflag_f32unbound numeric SGPR s1(root SRV stride bit)indexed raw load needs a reflected table SRVv_cmpx_ne_u32graphics register undefined on an incoming pathbuffer_load_format_xv_ashrrev_i32mesh SAVEEXEC then arm depends on EXEC(nested SAVEEXEC)v_mad_f32Taking
v_rcp_iflag_f32in the mesh frontend. The shared ALU lowering already exists; I'll check its IEEE-flag semantics against the compute path and add tests. Item 6 stays mine too, after this.AI-assisted.
mumba17 commentedon Dec 1, 2026
v_rcp_iflag_f32(371) is in #3709, together withv_ashrrev_i32(50, same lane ALU list). Measured on top of #3708, those 421 programs now stop atv_and_or_b32(144, already in @SimSalabimse's #3659),mesh heap slot lacks masked root constant provenance(142),s_cmp_le_u32(85) and theoffenraw-load form (51). Next for me is item 6.AI-assisted.
shader: keep a mesh lane limit across a nested CMPX skip that closes …
mumba17 commentedon Dec 1, 2026
Item 6: #3710. In my census, the
undefined on an incoming pathrefusals come from a nested CMPX skip inside the vertex skip, where both exit to the same EXEC restore. The #3671 lane-limit tag was skipped there, so the restore erased the position VGPRs. With #3710, 32 more programs translate on main (267 → 299), and 65 more with #3706/#3708/#3709 stacked (389 → 454). No regressions.One caveat, @lukaslw-lab: your 6 requests read v18/v20/v22 as a load index in the "if not VCC" arm, not in a count-guarded export. I can't reproduce them here because they need #3702/#3704/#3705 first. #3710 may not cover that read. If your probe still shows it with #3710 applied, I'll take that shape as a follow-up.
AI-assisted.
55 remaining items
shader: lower pixel alpha-test kills and coverage re-application
timbot103 commentedon Dec 2, 2026
Opened #3827 for the claimed mesh small ALU cluster (
v_cmpx_<p>_f32,s_cmpk_*,s_bcnt0/1_i32_b32,v_min_f32,v_bfi_b32) +v_pack_b32_f16constant sources.tests: rename native_mesh_small_alu_pack to native_mesh_small_alu_pac…
tests: expect the lane-0 broadcast for a non-uniform mesh READFIRSTLANE
timbot103 commentedon Dec 2, 2026
Claiming three disjoint
#3703mesh slices from the0dd65da1census (will stage as Draft PRs per #3514 until our active review slots open, each with source-built DXIL + verification fixtures):unsupported image dimension or D16(609 programs):D16image_load(and direct image dimension/D16 forms) in decode and lowering.mesh vertex outputs do not share the position mask(308 programs): mesh vertex export mask matching whenPOS0andPARAMexports have sound masks.mesh heap slot lacks masked root constant provenance(544 programs, shapes beyond shader: prove packed root selectors for mesh heap reads (Part of #3703) #3719) +mesh scalar memory needs a verified guest root mapping: s_load_dwordx4(77 programs).timbot103 commentedon Dec 2, 2026
Wave 1 Draft PR opened & claiming next disjoint
#3703slice (staged as Draft per #3514):mesh vertex outputs do not share the position mask, 308 programs).unproven mesh entry register N(392 programs): safe mesh entry ABI registers / system SGPR & VGPR handling insrc/gfx1013_direct_mesh.inl.timbot103 commentedon Dec 2, 2026
Wave 1 Draft PRs opened & claiming 3 more disjoint
#3703mesh slices (staged as Drafts per #3514):s_load_dwordx4), plusmesh-image-load-d16finishing final build verification.v_readfirstlane_b32inside narrowedexec_skip/ active-lane broadcast (unclaimed part of 813 programs, extending shader: broadcast lane-0 value for full-EXEC mesh v_readfirstlane_b32 (Part of #2413, #3416) #3793).mesh SAVEEXEC then arm depends on EXEC(84) +mesh SAVEEXEC VCC test requires an immediate VCC branch(77) (161 programs).VCC branch without a whole-wave mask(35) (94 programs).timbot103 commentedon Dec 2, 2026
Draft PR opened & claiming next
#3703mesh slice (staged as Draft per #3514):D16image_load/image_load_mip), shader: lower proven mesh entry wave-info reads (Part of #3703) #3838 (entryWaveInSubgroups3[27:24]projections + FSSM range/width checks).mesh image load lacks a remapped Texture1D heap contract(193 programs — non-D16dmask/dim/ bound-table /image_load_mipmesh image loads).timbot103 commentedon Dec 2, 2026
Claiming the next unclaimed wall noted in the 2 Dec stack check (staged as Draft per #3514):
buffer_load_format_xyzw(164 programs in the stacked mesh census; plus multi-componentbuffer_load_format_xy/xyz/xyzwinsrc/gfx1013_direct_mesh.inl).timbot103 commentedon Dec 2, 2026
Wave 2 + early Wave 3 Draft PRs opened (staged as Drafts per #3514):
shader/mesh-packed-rows-vcc-branch): packed mesh signature rows (1–4 reflected FP16 rows, targeting the 264-program stacked wall) + whole-wave VCC branches (35 programs).shader/mesh-readfirstlane-skip): active-lanev_readfirstlane_b32broadcast under narrowed EXEC & whole-wave skips (part of 813 programs; 48 WARP + RTX 5080 draws).shader/mesh-saveexec-exec-vcc): meshSAVEEXECTHEN-arm EXEC handling (84) + scheduled/SCC VCC tests (77).shader/mesh-image-load-contract): meshimage_load&image_load_mipdmask/bound-table/Texture1D contracts (193 programs).timbot103 commentedon Dec 2, 2026
Opened Draft PR for
buffer_load_format_x/_xy/_xyz/_xyzw(164-program stacked mesh wall, staged as Draft per #3514):shader/mesh-buffer-load-format-xyzw— 46 validated DXIL modules + 26 refusals).shader: lower pixel SAVEEXEC lane-mask expressions (#3826)
shader: keep a mesh lane limit across a nested CMPX skip that closes …
shader: carry exact mesh lanes through nested CMPX skips to an EXEC r…
tests: expect the lane-0 broadcast for a non-uniform mesh READFIRSTLANE