Repository navigation
shader: lower literal FMAs, straight SAVEEXEC, and reflected POS1 in mesh (Part of #2413, #3416) - #3806
shader: lower literal FMAs, straight SAVEEXEC, and reflected POS1 in mesh (Part of #2413, #3416)#3806timbot103 wants to merge 1 commit into
Conversation
2a590e7 to
50d1ab5
Compare
|
@R0Y00 Rebased onto Re-verified on Windows 11 (
|
50d1ab5 to
765e2fe
Compare
|
The new head passes CI, but after #3797 and #3770 the remaining conflict is in |
cdfd67e to
eaf885b
Compare
There was a problem hiding this comment.
The current head has a new Windows CI failure beyond the earlier conflict discussion. startup_indirect_mesh_cache_heap_wide_warp is the sole failed test in the Windows job. The fixture reports 0/8 non-clear pixels and intact argument guards, then fails at marker, = work.glob('req_*.m86') because no request marker was published. Please include ctest --preset dev --no-tests=error -R '^startup_indirect_mesh_cache_heap_wide_warp$' -V on the rebased head, alongside the direct mesh checks. A current-main baseline for the WARP case would distinguish a branch regression from a fixture issue.
There was a problem hiding this comment.
I rebuilt both main e958b8e8 and PR head eaf885b1 and ran ctest --preset dev --no-tests=error -j 1 -R '^startup_indirect_mesh_cache_heap_wide_warp$' --output-on-failure on each. Both passed on Windows 11 26300.9974, Microsoft Basic Render Driver 10.0.26100.9818, with the debug layer enabled. I could not reproduce the hosted missing-marker failure locally. The second hosted attempt also passed the required Windows job on the same head. The merge conflict in the mesh frontend still needs resolution.
|
@R0Y00 Rebased onto Re-verified on Windows 11 (
|
eaf885b to
bd25d0e
Compare
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed bd25d0e6 by reading the diff; not built or run.
Verdict: approve. All three lowerings follow the guest semantics and fail closed. No MUST.
- SHOULD Run a before/after mesh census against
f365f125. The new full-EXEC hook (gfx1013_direct_mesh.inl:1524) now runs ahead of everys_and_saveexec_b64outside a skip, andmatch_saveexec(..., standalone)refuses when the arm hits another branch or ends without a restore.vector_execalso widens nine lowering paths tobranch && branch->masks. Both are fail-closed, but a count of programs translated before and after would show that none that translate today are now refused. - NIT The PR holds three behaviours (literal FMAs, straight SAVEEXEC, POS1 distances), where AGENTS.md asks for one per PR. The unrelated renames (
inputs→incoming,r→reg,uniform_source→uniform_alu_source) add conflict surface in a file several open PRs touch. - Checked, no finding:
v_fmamk_f32reaches the shared FMA path asS0*K + S1(gfx1013_direct_compute.inl:3597). The uniformity proof reads onlysrc[0]/src[1], and VOP3 is refused.- Full-EXEC diamonds: the parent words are
-1, the narrowed lane skips the redundant AND, the restore requiresmask->full==full_exec, ands_or_b64's SCC is1. After the join,partial_writesreturns to the entry set, which is right because both arms merge per lane. pos1_channels: CCDIST0 only, clip and cull disjoint,channels == clip|cull, a float signature with one component per enabled bit, and PSIZE/RTAI/VPAI refused. Theclip_exportalias still needs the full clip vector.
- R0Y00's missing-marker failure on
startup_indirect_mesh_cache_heap_wide_warpis #3822, the same flake hit by other PRs since #3664, not this branch.
Tests: native_direct_mesh and native_direct_container (both in the pr filter, green on this head) cover the FMA forms, the straight if and if/else SAVEEXEC shapes with their refusals, and sparse and mixed POS1 masks against reflected signatures.
Summary
Lowers three small unclaimed C++ mesh frontend refusals from @Kawiu's slot 57 census on
main(158ef794), independent of #3793, #3797, and @mumba17's open stack (Part of #2413, #3416):v_fmamk_f32,v_fmaak_f32): admitsv_fmamk_f32alongsidev_fmaak_f32through the shared DXILFMadlowering, explicitly refusing any non-VOP2 (wide) encoding and keeping both register operands (src[0],src[1]) checked for uniformity and partial-register safety.s_and_saveexec_b64without an initialEXECZskip: matches straight-line if-only and if/elseSAVEEXECregions (standalone from fullEXECor inside an open lane skip) and lowers them through the existing lane-merge diamond machinery. Preserves the existing standalone path whens_cbranch_execzfollows (including scheduled waits) and keeps missing restores, saved-mask clobbers, exports/barriers, EXEC mutations, escaping branches, and non-vector else arms strictly refused.exp pos1(target 13)CCDIST0clip/cull masks: generalizes reflectedPOS1beyond the full 4-channel clip mask to any sparse clip-only, cull-only, or disjoint mixed clip+cull mask wherechannels == (clip | cull),PA_CL_VS_OUT_CNTLhas onlyCCDIST0(1 << 22) and0x0f0fbits set, and the float output signature matches each enabled distance channel 1-to-1. Raw slot 57 (no clip/cull layout contract), misc outputs (PSIZE,SV_RenderTargetArrayIndex,SV_ViewportArrayIndex), overlapping clip/cull bits, and signature mismatches stay refused.Verification
Source-built fixtures only (
tests/native_direct_mesh_check.py,tests/native_direct_container_check.py), validated with Windows SDK10.0.26100.0DXC on Windows 11 (26200.9974), MSVC19.44, Ninja:dev):ctest --preset dev --no-tests=error -R 'native_direct_mesh|native_direct_container' -V— 2/2 passed (native_direct_container16.37 s,native_direct_mesh13.65 s, 0 failed, 0 skipped)release):ctest --preset release --no-tests=error -R 'native_direct_mesh|native_direct_container' -V— 2/2 passed (native_direct_container15.34 s,native_direct_mesh12.00 s, 0 failed, 0 skipped)git diff --check origin/main..HEAD: clean; zero new MSVC/W4warnings insrc/gfx1013_direct_mesh.inl.AI-assisted.