shader: accept any zero VGPR in the mesh group-index exchange #3537
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3537"
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 lambirou on 2026-11-30T02:26:59Z.
Problem
The native mesh frontend refused four shapes from the real slot 57 workload:
Change
v_mov_b32_e32of the group-index exchange and rebuild its DS fields around it.X2W_MESH57_PARTIAL_ZERO=1: keep the last partial value for mesh reads/exports and materialize a missing merge edge as zero. The default path still refuses an unproven partial VGPR.s_buffer_loadcarries no format, filtering or typed element, so the descriptor's memory read as raw dwords is the same value. The submission still resolves each slot's token and refuses anything that is not a buffer SRV or a CBV.Validation
native_fixed_mesh57_*warp+hardware: 26/26 passed (13 variants, including the two new_cbvcases).native_fixed_mesh57_cbv_warp|hardware: the same MS reads the same dword through a table slot declared as a CBV; PSO created and pixels match the SRV variant.native_fixed_mesh57_cbv_uav_warp|hardware: the same slot declared as a UAV is still refused withMS buffer slot outside a verified SRV range.graphics register undefined on an incoming path: 265; withX2W_MESH57_PARTIAL_ZERO=1it compiles to a 12,680-byte MS. Four of the twelve live captures are depth-only and compile (3e8243,0acf7c,30d597,fd8f); with their reviewed profiles they create a native PSO, forward one indirect DispatchMesh and complete a depth readback, locally, without their bytes entering the repository. The partial-EXEC path is a heuristic for lanes the shader has not proven defined, not the final per-VGPR EXEC proof.Limits
The empty-PS depth-only profile,
DispatchMeshand pixel readback for a captured key remain the next tranche; they need the runtime fixture branch, which this PR does not carry. The Linux Python job fails onstartup_triage_run_check.pybecause a source reason is missing fromCOMPUTE_DISPATCH_REASONS; this PR does not touch that tool. Windows and the gfx1013 fixture jobs pass.Refs #2413
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T03:07:32Z.
The Linux Python check fails in
tests/startup_triage_run_check.pybecause the source reasonan output UAV interval exceeds the D3D12 buffer view element limitis absent fromCOMPUTE_DISPATCH_REASONSintools/startup/triage_run.py. This PR does not touch the triage tooling; the Windows build/test and gfx1013 fixture jobs pass. I will leave the draft as-is until that separate triage-list update lands, rather than mixing it into this mesh change.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T03:19:49Z.
Next blocker on the captured title request: the compiler stops at
+0x46c exp pos0 v9, v10, v11, v6. Those four VGPRs are computed at+0x340..+0x37c, before the LDS count exchange branch, then exported after the branch join. Instrumenting the merge shows v9 present on one edge and absent or empty on the other, somerge_edgeserases it. The next slice is to preserve/phi a VGPR defined before the exchange across that join instead of treating an absent symbolic entry as undefined. The clamp and v6 changes are committed; this diagnosis is not.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T06:23:49Z.
Linux is red on
startup_triage_run_check, and the cause is onmain, not in this branch: #3471 added the reasonan output UAV interval exceeds the D3D12 buffer view element limittosrc/startup_stubs/d3d12_compute_dispatch.inlwithout adding it toCOMPUTE_DISPATCH_REASONS. The merge ref this job checks out contains that source, so the reason check fails here too. #3559 fixes the allowlist; it is green and mergeable. Once it lands, a re-run of this job should pass without touching the mesh code.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T07:36:38Z.
Review: COMMENTED
Reviewed
f3590da0(draft) by reading the diff; not built or run.Verdict: comment. No MUST in what I read. The draft needs splitting and tests that tell the opt-in apart from the default before it is ready.
X2W_MESH57_PARTIAL_ZEROheuristic,X2W_MESH_DUMP_LAYOUT, a wider mesh ALU subset (s_lshl2_add_u32,s_cmpk_lg_i32,v_sub_nc_u32,v_subrev_nc_u32,v_add_co_ci_u32), the OFFEN root V# change and CBV/past-table slots. The body does not mention the last three. The zero-VGPR change, the clamp and the CBV slots each stand alone.real.m57compiles withoutX2W_MESH57_PARTIAL_ZEROtoo (tests/startup_mesh57_real_shape_check.py:66-94), so the opt-in step would pass if the switch did nothing. Add a source-built shape that is refused by default and accepted with the switch (the+0x46c exp pos0join you described). It also needs a runtime check, because "missing edge = 0" applies to every VGPR (reg>=256) inmerge_edges(src/gfx1013_direct_mesh.inl:255-271), not only the partial writes.:83). Today any refusal passes, not just thezero_vgpr!=5gate.src/gfx1013_direct_compute.inl:925drops the zero-immediate check (0x3fff→0x1000) without a test. The offset is added at:933, so I see no wrong read.CMakePresets.jsonaddscompile_dxilto theprbuild targets, but no new test is in theprfilter, so CI builds it without using it.>= 60size check, and the DS fields are rebuilt correctly aroundzero_vgpr.indirect_table_bufferalready resolves slot-17 CBV tokens from location + size. An unbounded range keepspast_tablefalse.Tests:
native_fixed_mesh57_cbv_*proves that a CBV-declared slot reads the same dword and that a UAV-declared slot is still refused.startup_mesh57_real_shapeproves the v6 exchange compiles. Nothing covers the clamp, the ALU additions or the OFFEN change. CI ran none of these (not in the Windowsprfilter, and the Linux job does not buildcompile_dxil).Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T08:42:17Z.
Review follow-up on
756c58cb:X2W_MESH57_PARTIAL_ZEROat+0x148(graphics register undefined on an incoming path: 265) and accepted with it; the IR carries thephiand the export consumes it. This exercises the generalreg>=256rule inmerge_edges, not only already-marked partial writes.startup_mesh57_real_shapeis in theprtest filter;ctest --preset pr -Nlists 87 tests, including it.ctest --preset dev -R '^startup_mesh57_real_shape$|^native_fixed_mesh57_'passes 27/27, and 28/28 includingstartup_tools_lint, with no skips.Split status: the CBV/past-table lot is extracted to #3565. The remaining plan is: zero-VGPR, count clamp, partial-EXEC opt-in, wider ALU, OFFEN root V#, and the layout dump as separate lots; their tests currently share the real-shape harness, so the harness needs sub-case extraction before those branches can stand alone.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T09:19:48Z.
Review: APPROVED
Re-review at
756c58cb(previous:f3590da0), by reading the diff; not built or run.Verdict: approve. The test gaps from my first pass are closed. The split is under way, so it can follow. No MUST.
partialis refused by default at+0x148withgraphics register undefined on an incoming path: 265and accepted withX2W_MESH57_PARTIAL_ZERO=1. The test also requires thephi i32 [ 0, … ], [ 1065353216, … ]and that the export bitcasts that phi, so a switch that did nothing, or zeroed the wrong edge, would now fail. It exercises the generalreg>=256rule inmerge_edges, as I asked.+0x4refusal in both modes.X2W_DUMP_SHADER_IR: the two count selects feed the counts, thev_add_co_ci_u32refusal comes without a reaching VCC (+0x144 … register 106), and OFFEN offset 16 lands in the address. The new comment atgfx1013_direct_compute.inl:923explains why the0x1000mask is enough: the raw-load decoder refuses IDXEN first.startup_mesh57_real_shapeis in theprfilter now, and run 46383882043 passed it, so thecompile_dxilbuild target is no longer unused.f3590da0is still on the branch, although #3565 merged the same change. Itsnative_mesh57.inldiff is byte-identical, and the PR merges cleanly with main5de27d2b, so nothing breaks. A rebase would drop the commit and keep the history honest. The rest of the split (zero-VGPR, clamp, opt-in, ALU, OFFEN, layout dump) is as planned in your reply.X2W_DUMP_SHADER_IRis documented only indocs/experiments/native-fixed-mesh57.md. One line in thecompile_dxilusage text would help anyone outside mesh find it.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T09:39:40Z.
Re-review follow-up at
e6ee7309:f3590da0from the branch; the CBV/past-table change is now only in #3565.X2W_DUMP_SHADER_IR=FILEin thecompile_dxilusage text.startup_mesh57_real_shapestill passes after the rebase.The remaining split (zero-VGPR, clamp, opt-in, ALU, OFFEN, layout dump) is unchanged and can follow.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T09:48:27Z.
Review: APPROVED
Reviewed
e6ee7309by reading the diff; not built or run.Verdict: approve. The rebase only drops
f3590da0and adds the usage line; the mesh changes are the ones approved at756c58cb.git range-difffrom756c58cbtoe6ee7309. Commitsf0b966b8…5a1edb31are identical, and3d4f93b0is identical to756c58cb.f3590da0is gone and its change is on main as #3565 (a7e8298c). The diff anddocs/experiments/native-fixed-mesh57.mdno longer mention the CBV or past-table reads.e6ee7309adds only theX2W_DUMP_SHADER_IR=FILEline to thecompile_dxilusage text (tools/startup/compile_dxil.cpp:1591). It matches the reader at:336and the doc note atnative-fixed-mesh57.md:162._cbvcases in "26/26 (13 variants)". Both now belong to #3565, so the body should drop them so the squash message matches the diff.Tests:
startup_mesh57_real_shapeis in theprfilter. CI ran it on this head and every job passed, including the Linux Python job.