Repository navigation
Backlog
Description
Follow-up to #1760. The source-built slices merged so far (#1913, #1779) cover bounded runtime geometry and multi-primitive lowering. A census of mesh-stage programs from a private corpus (aggregate counts only; about 4,000 distinct programs in the group form: LDS, group barriers, per-lane ranges, v_readfirstlane) shows which constructs still stop a translation. Each row is a separate piece of work that one person can take with a source-built fixture.
Constructs (pick one, say so in a comment)
| Item | Construct | Programs stopped first by it | Notes |
|---|---|---|---|
| A | Branch on an SCC that depends on a wave lane mask ("any lane active") | about 1,190 | Needs a group-uniform form: each wave publishes its bit to shared memory, then a barrier, then a uniform branch with exec guards. |
| B | Scalar spills: v_writelane_b32 / v_readlane_b32 used as spill slots for scalar registers, including saved exec masks |
about 220 | A spill slot is per wave, not per lane. Only the constant-lane spill / reload idiom needs recognising; anything else can stay refused. #1543 covers cross-lane operations for compute only. |
| C | Exec mask restored inside a per-lane range (non-spill forms: a copy made before the branch, moved between registers, or joined from several paths) | about 120 | |
| D | Descriptor identity that differs between the two arms of a join | about 270 | Typically a per-material view, or a null descriptor in one arm. Needs a bounded selection carried through the join. |
| E | Sampler state loaded from a descriptor instead of a static sampler | about 260 | Related: #1143. |
| F | Second position export (pos1): clip and cull distances |
about 200 | Maps to SV_ClipDistance / SV_CullDistance; the component count comes from pipeline state. |
| G | Scalar written inside a skipped range and live after it | about 160 | |
| H | Waves of one group reaching a different number of group barriers | about 125 | |
| I | Loops (back-edges through the LDS / barrier structure, loop-carried exec masks) | about 720 programs contain loops; their first refusals are not yet separated from A-H | A census of the loop-specific refusals is itself a useful contribution. |
What a contribution needs
- A source-built mesh pipeline (or a hand-assembled program) that contains the construct, with pixel or buffer read-back and a negative control. No bytes from any retail software.
- A differential check against an independent CPU model of the wave where the construct changes control flow.
- LLVM / Mesa semantics cited for each instruction lowered.
- Refuse precisely what the change does not cover.
Notes
- Fused and unfused multiply-adds must keep the console rounding (fused: one rounding; unfused: two). Otherwise positions differ between a depth pre-pass and the colour pass that tests depth EQUAL. Measured locally: letting the compiler choose gave differences of more than 1,000 ulp on a position component in one program; the explicit rule gave 0.
- Counts are first refusals; closing one row exposes the next for some programs.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]help wanted: mesh-program constructs still without a lowering (spills, lane-mask branches, descriptor joins, clip distances, loops)[/-][+]help wanted: GPU translation, part 2 (mesh shaders)[/+]avt0m4t48 commentedon Nov 24, 2026
I’ll take item B, the constant-lane scalar spill and reload pattern in the bounded mesh path. The source-built wave64 fixture covers a selected lane outside EXEC and a saved EXEC high word that changes control flow. I’m checking pixel readback before submitting the patch.
avt0m4t48 commentedon Nov 24, 2026
I’m releasing my claim on item B so someone else can take it. The source-built CPU and DXIL checks passed locally. Pixel readback is still open.
R0Y00 commentedon Nov 24, 2026
Item B is available again. If the source-built spill/reload fixture is shareable, please link the source revision and its CPU/DXIL test commands here so the next contributor can start at the GPU readback. The remaining discriminator is a wave64 case that recovers a selected lane outside EXEC and a saved high word whose removal changes the fenced pixel result. Use the existing bounded mesh draw fixture and report capability skips separately.
Leyukaka commentedon Nov 25, 2026
Item F (clip and cull distance exports): what blocks it in the mesh tools, from reading
tools/mesh_entry_aot.pyandtools/mesh_dynamic_aot.pyat5a0b0aa. Nothing was run.prim,pos0andparam0only (mesh_entry_aot.py, the export regex). Any other target raises "Unsupported mesh export".mesh_dynamic_aot.pyinherits that parser throughRuntimeWave(Wave).decode_meshtakes the limits from PSV0 and the code from the DXIL chunk.PA_CL,CLIP_DIST,CULL_DIST,CCDIST,ClipDistanceorCullDistancefinds nothing.PA_CL_VS_OUT_CNTL:CLIP_DIST_ENA_0..7,CULL_DIST_ENA_0..7,VS_OUT_CCDIST0/1_VEC_ENA, plusVS_OUT_MISC_VEC_ENAand theUSE_VTX_*bits. As far as I know, in Mesa's layoutpos1is the misc vector (point size, layer, viewport) when that is enabled, and the distance vectors then move topos2/pos3. Sopos1is not always a distance vector, and any guessed layout is wrong for some mix of enables. I have not checked whether the hardware mandates that numbering.SV_ClipDistanceN/SV_CullDistanceNfields, write the export operands in ascending index order, and refuse unknown or contradictory layouts with the target and reason.AI-assisted.
akimfomin commentedon Nov 25, 2026
Item B independent GPU readback on Leyukaka's exact #2127 head
2dc58a8bdf7e. Thanks to avt0m4t48 for the earlier CPU/DXIL work and the requested inactive-lane and high-word controls. PortBridge used that request to prepare an independently generated fixture.With only guest lane 0 active, the source saves
EXEC_LO=1andEXEC_HI=0x100into inactive lanes 8 and 40. LLVM assembled and decoded the three gfx1013 guest Wave64 programs. On RTX 4070 Ti SUPER (driver32.0.16.1714, Win11 build28000), the complete spill drew all 1,024 expected green pixels. Zeroing either word left all 1,024 pixels clear as expected. The stale-pixels-only control kept the good export trace and produced the expected 1,024/1,024 mismatches. D3D12 debug layer was unavailable; the hardware device and fenced readback were verified.The passing cases use inline selectors. A separate source-built case with known SGPR selectors still gets the documented refusal. Exact source, CPU/DXIL reproduction and hardware transcript · PortBridge Test Lab. AI-assisted with Codex.
tedin7 commentedon Nov 25, 2026
Picking up Item A (branch on SCC any-lane-active in mesh) with unit + WARP/verification tests.
tedin7 commentedon Nov 25, 2026
Picking up Item C (non-spill exec mask restore inside a per-lane range) and Item G (scalar written inside a skipped range and live after it) as two separate PRs with mesh tests.
tedin7 commentedon Nov 25, 2026
Also picking up Item D (descriptor identity differing between the two arms of a join) as a separate PR with mesh verification tests.
R0Y00 commentedon Nov 25, 2026
Item B landed in #2127 (498c23c). The bounded translator now handles the constant-lane spill/reload with EXEC cleared and rejects an unwritten slot or mixed ordinary VGPR use. The final head passed the local CPU model, including both EXEC halves. The independent GPU report remains the reference for the fenced inactive-lane/high-word comparison. Keep runtime-geometry support and the other claimed items separate. Independent readback
roansystemlabs commentedon Nov 25, 2026
I'd like to take item E, sampler state loaded from a descriptor in the bounded mesh path. If someone already has it in progress, I'll step back and review.
Scope: reuse the opt-in sampler table from #1217/#1237 (s0, space1, 16-byte descriptor stride) for mesh programs in tools/mesh_dynamic_aot.py, where the sampler is loaded with s_load from a heap base plus a constant or bounded offset. Anything else (unbounded index, sampler word changed after the load, mixed static and heap use in one join) stays refused by name.
Evidence: a source-built mesh pipeline assembled with LLVM 15 llvm-mc for gfx1013 that samples one texture through two different heap samplers (distinct address modes and LOD limits), drawn on WARP and an RTX 3070 with fenced pixel readback. Negative controls: swapped sampler entries and the default-sampler shortcut must change the readback; the guard removed must fail.
AI-assisted.
mesh: keep scalars written in a skipped range undefined (Part of #1998)…
RavenCurseBurg commentedon Nov 25, 2026
I'll take the early-exit slice of item H for the bounded two-wave64 mesh lowerers. AMD's RDNA 2 ISA §4.3 says a wave can terminate with S_ENDPGM and the remaining live waves can satisfy later barriers. Both current lowerers require identical barrier-PC lists even though Wave.run already requires each executed path to reach S_ENDPGM.
I'll exercise a common barrier followed by one wave terminating and the other continuing to a later barrier. Two live waves reaching different barrier PCs at the same phase must still be refused. The tests will use a source-built program, an independent two-wave arrival/termination reference and GPU readback; runtime LDS sharing and loops are outside this slice.
AMD RDNA 2 ISA, §4.3
AI-assisted (Codex, GPT-6.2 Astra xhigh).
R0Y00 commentedon Nov 25, 2026
The item H early-exit slice is available and distinct from #2220. Please proceed with the existing bounded two-wave64 profile. Keep the common first barrier, then let one wave terminate while the survivor reaches its next barrier. Include both wave orders, a readback sentinel that detects a missing surviving-wave write, and a refusal when two live waves reach different barrier PCs. Please include the exact LLVM 15 assembly and WARP/hardware test commands in the PR, with capability skips reported separately.
RavenCurseBurg commentedon Nov 25, 2026
I also reproduced a separate input-path blocker while assembling the early-retirement fixture. #2241 can use a shared final S_ENDPGM. Giving the retiring wave its own reachable S_ENDPGM produces the same mesh exports at the wave-model entry point, but the normal stage-13 container extractor refuses the program before either CLI reaches the model. This is the mesh-stage exclusion noted in #721.
I’ll take the bounded two-exit mesh-container follow-up. I’ll check the two decoded exits under gfx1013 wave64, preserve the reachability and instruction-boundary checks, and run a real allocation/position/primitive-export fixture through both CLI entry points and a device readback. An incorrectly tagged compute program, an unreachable alternate path and additional exits will remain controls. I’ll keep it separate from #2241.
mesh: sample through sampler heap entries in the bounded runtime path (…
RavenCurseBurg commentedon Nov 25, 2026
#2241 now covers both requested retirement orders at
5bd2ea09. In the 320-byte reverse-order fixture, wave 0 allocates 68 vertices, writes vertices 0–63, and terminates. Wave 1 traverses the later barrier and supplies vertices 64–67. Both host evaluation orders yield the same barrier traces ([172] and [172, 184]) and primitive indices. The second primitive reads vertex 67.The static and runtime CLI results matched all 1,024 pixels on WARP and a physical D3D12 adapter. Keeping vertex 67 at vertex 2’s position instead removes exactly 528 pixels on each adapter. Both live-wave mismatch refusals are still exercised. The PR description now includes the exact LLVM 15 and draw commands.
roansystemlabs commentedon Nov 25, 2026
I'd like to take item F, the clip and cull distance exports, in the bounded mesh path. If someone already has it in progress, I'll step back and review.
Following the analysis above, the export alone can't say which position export carries the distances, so the first slice takes the PA_CL_VS_OUT_CNTL word as an explicit input of the lowerer instead of guessing a layout.
First slice (one PR):
Evidence: source-built mesh programs assembled with LLVM 15 for gfx1013 that export a position plus clip and cull distances, drawn on WARP and an RTX 3070 with fenced pixel readback. A triangle crossing a clip plane must lose exactly the pixels where the interpolated distance is negative, and a primitive whose cull distances are all negative must disappear while its neighbour stays. On current main the same programs stop at "Unsupported mesh export". Negative controls: clip and cull components swapped, CCDIST0 and CCDIST1 swapped, one enabled component dropped, and the guard removed must each fail. Not tested: AMD or Intel GPUs and console hardware.
AI-assisted.