Repository navigation
Conversation
|
Update for head AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both. Head
All failures are on Not tested: the D3D12 debug layer (not installed here), a title with geometry shaders on the direct path. |
…er_geom Fix three bugs in the direct DXIL ES+GS lowering (`gpu/dxil/lower_geom.rs`): 1. `geom_epilogue` summed `emitted` and `ntri` across the wave before checking `has = (gs_base != u32::MAX)`: a lane that called `s_sendmsg(emit)` without a GS-phase LDS store wrote 0 vertices yet still reserved phantom uninitialized vertex slots, shifted later lanes' `vb`, and emitted triangles referencing uninitialized vertices. 2. `geom_epilogue` clamped emitted vertices per lane to `v_written = min(emitted, maxv.saturating_sub(vb))` (`nv = min(tv, maxv)`), but did not filter `ntri` against `v_written`, so straddling and past-`maxv` lanes emitted triangles with vertex indices `>= nv` (and `gs_emit_cut` did not guard `k < maxv` before 10-bit index packing). 3. `geom_epilogue` loaded `@xcl_lds[(a >> 2) & 8191]` without clamping to `self.lds_top` in split wave64 mode (unlike `lower_mem::lds_index`), allowing wrapped addresses to read exchange scratch words. Gate `emitted`/`ntri` by `has` before wave sums, guard `gs_emit_cut` with `k < maxv`, filter each lane's monotonic `tri[j]` (`(tri[j] >> 20) < v_written`) to compute `valid_ntri` before `tb`/`tt`/`np` (zero extra iterations on non-straddling lanes), and clamp LDS indices to `self.lds_top` when `self.split`. Part of xcl-dev#1401 Part of xcl-dev#1833 Assisted-by: Google Antigravity (Gemini 4 Neon)
2fe72c6 to
98692ec
Compare
|
Rebased Re-verified |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin |
|
Thanks for testing! That This PR ( |
bmjask
left a comment
There was a problem hiding this comment.
No concrete code-level defect found. The vertex/triangle cap logic, no-LDS-store filtering, and split LDS clamp look sound; coverage includes straddling OOB triangles and both split/native wave64. Nonblocking validation gap: no direct-path retail title with geometry shaders was tested. Please retain that limitation in the merge evidence.
Part of #1401
Part of #1833
Fixes three bugs in the direct DXIL ES+GS lowering (
crates/xcl/src/gpu/dxil/lower_geom.rs) wheregeom_epilogueandgs_emit_cutcould reserve phantom vertices, emit out-of-bounds triangle indices, or read split-wave64 LDS exchange scratch words.What is in it
Lw::gs_emit_cut(crates/xcl/src/gpu/dxil/lower_geom.rs): guard vertex emission and triangle packing withk < maxv(<= 256), preventing out-of-range vertex counts and 10-bit packed index overflow.Lw::geom_epilogue(crates/xcl/src/gpu/dxil/lower_geom.rs):emittedandntribyhas = (gs_base != u32::MAX)before computingvb/tvwave sums so a lane that callss_sendmsg(emit)without a GS-phase LDS store reserves0vertex slots and emits0triangles.tri[j]((tri[j] >> 20) < v_written, scanning only when a lane straddlesmaxvwith3 <= v_written < emitted, zero extra iterations on non-straddling lanes) to computevalid_ntribeforetb/tt/np, guaranteeing every emitted triangle index is< nv.itoself.lds_topwhenself.split(matchinglower_mem::lds_index) so wrapped LDS addresses cannot read the split-wave64 exchange scratch words.gpu::dxil::lower_geom::tests(crates/xcl/src/gpu/dxil/lower_geom.rs):split_epilogue_clamps_lds_to_lds_top_and_validates(pure-CPU / DXC 1.9): validates both native and split geometry DXIL and asserts split-mode disassembly emitsumin(..., 8184)(lds_top) andicmp ult ..., 63(k < maxv).gpu_epilogue_filters_oob_triangles_and_no_store_emits(GPU-guardedmesh_draw): verifies (a) a 15-lane × 20-vertex wave exceedingmax_vertices = 256with a straddling lane outputs(nv = 256, np = 230)with all 230 triangles< 256and exact final straddled triangle, and (b) a no-store emit lane followed by a valid lane outputs(nv = 3, np = 1)with exact lane-1 vertex data and triangle(0, 1, 2).Tested
origin/main3f277701(preserving#2273's coalesced 4-wordraw_storeingeom_epiloguewith thelw.splitlds_topclamp beforegs_load); merges cleanly againstorigin/main2898511a.rustc 1.100.0, DXC1.9.2609.5, release profile (--release).origin/main68a284a5):cargo test --release -p xcl --lib gpu::dxil::lower_geom::tests:: -- --nocapture: 0 passed, 2 failed (missing umin(..., 8184) LDS clampandoverflow header left: (256, 256), right: (256, 230)).3f277701, commit98692ec1):gpu::dxil::lower_geom::tests:2 passed, 0 failed, 0 ignored(0.46 s,0skipped).gpu::dxil::geometry_tests:3 passed, 0 failed, 0 ignored(0.37 s,0skipped, includinggeometry_epilogue_coalesces_header_and_vertex_stores).gpu::dxil::lower_geom::tests:2 passed, 0 failed, 0 ignored(0.01 s; pure-CPU/DXC 1.9 test0skipped, GPU test cleanlySKIPPED: no GPU / DXC / mesh shaders).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1358 passed, 1 failed, 46 ignored across 24 test binaries (182/182gpu::dxil::*passed,0failed) — the sole failure is3f277701's pre-#2420gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(fixed onmainby#2420); 29 pre-existingSKIPPEDlines (21 no wave64 on RTX 4060, 3 per-lane wave32 refused, 3 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped inlower_geom::testsandgeometry_tests).Regression run
main:
PR:
Not tested
split_epilogue_clamps_lds_to_lds_top_and_validatesandgeometry_forms_validate).title: 29640639.AI use
gpu/dxil/lower_geom.rs, implemented thehasgating,k < maxvguard, straddling-lane triangle filter, splitlds_topclamp, and failing-first CPU/GPU tests, and ran targeted, WARP, workspace, and paired smoke verification.