DXIL: filter OOB triangles, gate no-store emits, and clamp LDS in lower_geom #2409

Merged
Decodere merged 1 commit from upstream-pr/2419 into main 2026-11-29 13:59:15 +00:00
Decodere commented 2026-11-25 18:21:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T18:21:28Z.


Part of #1401
Part of #1833

Fixes three bugs in the direct DXIL ES+GS lowering (crates/xcl/src/gpu/dxil/lower_geom.rs) where geom_epilogue and gs_emit_cut could 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 with k < 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):
    • Gate each lane's emitted and ntri by has = (gs_base != u32::MAX) before computing vb/tv wave sums so a lane that calls s_sendmsg(emit) without a GS-phase LDS store reserves 0 vertex slots and emits 0 triangles.
    • Filter each lane's monotonic tri[j] ((tri[j] >> 20) < v_written, scanning only when a lane straddles maxv with 3 <= v_written < emitted, zero extra iterations on non-straddling lanes) to compute valid_ntri before tb/tt/np, guaranteeing every emitted triangle index is < nv.
    • Clamp the LDS dword index i to self.lds_top when self.split (matching lower_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 emits umin(..., 8184) (lds_top) and icmp ult ..., 63 (k < maxv).
    • gpu_epilogue_filters_oob_triangles_and_no_store_emits (GPU-guarded mesh_draw): verifies (a) a 15-lane × 20-vertex wave exceeding max_vertices = 256 with a straddling lane outputs (nv = 256, np = 230) with all 230 triangles < 256 and 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

  • Rebased cleanly onto origin/main 3f277701 (preserving #2273's coalesced 4-word raw_store in geom_epilogue with the lw.split lds_top clamp before gs_load); merges cleanly against origin/main 2898511a.
  • Hardware / toolchain: NVIDIA GeForce RTX 4060 8 GB (driver 621.14), Intel Core i5-11400F, 32 GB RAM, Windows 11 build 26200, rustc 1.100.0, DXC 1.9.2609.5, release profile (--release).
  • Failing-first (before fix, on origin/main 68a284a5): cargo test --release -p xcl --lib gpu::dxil::lower_geom::tests:: -- --nocapture: 0 passed, 2 failed (missing umin(..., 8184) LDS clamp and overflow header left: (256, 256), right: (256, 230)).
  • Targeted tests (after rebase onto 3f277701, commit 98692ec1):
    • RTX 4060 gpu::dxil::lower_geom::tests: 2 passed, 0 failed, 0 ignored (0.46 s, 0 skipped).
    • RTX 4060 gpu::dxil::geometry_tests: 3 passed, 0 failed, 0 ignored (0.37 s, 0 skipped, including geometry_epilogue_coalesces_header_and_vertex_stores).
    • WARP gpu::dxil::lower_geom::tests: 2 passed, 0 failed, 0 ignored (0.01 s; pure-CPU/DXC 1.9 test 0 skipped, GPU test cleanly SKIPPED: 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/182 gpu::dxil::* passed, 0 failed) — the sole failure is 3f277701's pre-#2420 gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (fixed on main by #2420); 29 pre-existing SKIPPED lines (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 in lower_geom::tests and geometry_tests).

Regression run

main:

xcl-smoke v1
commit: 3f2777019544c0ada2cd294aa792d3c378ff0df8
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1486 (PresentX 1486)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13989 MB

PR:

xcl-smoke v1
commit: 98692ec178f711dd8388ff7496cf95ce0691767f
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13987 MB

Not tested

  • Native wave64 GPU execution (AMD RDNA hardware) and D3D12 debug-layer test subsets (skipped on this RTX 4060 / non-debug-layer host; native wave64 DXIL translation and DXC 1.9 validation ran on CPU in split_epilogue_clamps_lds_to_lds_top_and_validates and geometry_forms_validate).
  • Retail titles other than title: 29640639.

AI use

  • Google Antigravity (Gemini 4 Neon) — audited gpu/dxil/lower_geom.rs, implemented the has gating, k < maxv guard, straddling-lane triangle filter, split lds_top clamp, and failing-first CPU/GPU tests, and ran targeted, WARP, workspace, and paired smoke verification.
<!-- greyfinch-sync:ivall/xcl:issue:5496802392 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T18:21:28Z. --- Part of #1401 Part of #1833 Fixes three bugs in the direct DXIL ES+GS lowering (`crates/xcl/src/gpu/dxil/lower_geom.rs`) where `geom_epilogue` and `gs_emit_cut` could 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 with `k < 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`): - Gate each lane's `emitted` and `ntri` by `has = (gs_base != u32::MAX)` before computing `vb`/`tv` wave sums so a lane that calls `s_sendmsg(emit)` without a GS-phase LDS store reserves `0` vertex slots and emits `0` triangles. - Filter each lane's monotonic `tri[j]` (`(tri[j] >> 20) < v_written`, scanning only when a lane straddles `maxv` with `3 <= v_written < emitted`, zero extra iterations on non-straddling lanes) to compute `valid_ntri` before `tb`/`tt`/`np`, guaranteeing every emitted triangle index is `< nv`. - Clamp the LDS dword index `i` to `self.lds_top` when `self.split` (matching `lower_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 emits `umin(..., 8184)` (`lds_top`) and `icmp ult ..., 63` (`k < maxv`). - `gpu_epilogue_filters_oob_triangles_and_no_store_emits` (GPU-guarded `mesh_draw`): verifies (a) a 15-lane × 20-vertex wave exceeding `max_vertices = 256` with a straddling lane outputs `(nv = 256, np = 230)` with all 230 triangles `< 256` and 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** - Rebased cleanly onto `origin/main` `3f277701` (preserving `#2273`'s coalesced 4-word `raw_store` in `geom_epilogue` with the `lw.split` `lds_top` clamp before `gs_load`); merges cleanly against `origin/main` `2898511a`. - Hardware / toolchain: NVIDIA GeForce RTX 4060 8 GB (driver 621.14), Intel Core i5-11400F, 32 GB RAM, Windows 11 build 26200, `rustc 1.100.0`, DXC `1.9.2609.5`, release profile (`--release`). - Failing-first (before fix, on `origin/main` `68a284a5`): `cargo test --release -p xcl --lib gpu::dxil::lower_geom::tests:: -- --nocapture`: 0 passed, 2 failed (`missing umin(..., 8184) LDS clamp` and `overflow header left: (256, 256), right: (256, 230)`). - Targeted tests (after rebase onto `3f277701`, commit `98692ec1`): - RTX 4060 `gpu::dxil::lower_geom::tests`: `2 passed, 0 failed, 0 ignored` (`0.46 s`, `0` skipped). - RTX 4060 `gpu::dxil::geometry_tests`: `3 passed, 0 failed, 0 ignored` (`0.37 s`, `0` skipped, including `geometry_epilogue_coalesces_header_and_vertex_stores`). - WARP `gpu::dxil::lower_geom::tests`: `2 passed, 0 failed, 0 ignored` (`0.01 s`; pure-CPU/DXC 1.9 test `0` skipped, GPU test cleanly `SKIPPED: 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/182` `gpu::dxil::*` passed, `0` failed) — the sole failure is `3f277701`'s pre-`#2420` `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (fixed on `main` by `#2420`); 29 pre-existing `SKIPPED` lines (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 in `lower_geom::tests` and `geometry_tests`). **Regression run** main: ``` xcl-smoke v1 commit: 3f2777019544c0ada2cd294aa792d3c378ff0df8 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1486 (PresentX 1486) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13989 MB ``` PR: ``` xcl-smoke v1 commit: 98692ec178f711dd8388ff7496cf95ce0691767f gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13987 MB ``` **Not tested** - Native wave64 GPU execution (AMD RDNA hardware) and D3D12 debug-layer test subsets (skipped on this RTX 4060 / non-debug-layer host; native wave64 DXIL translation and DXC 1.9 validation ran on CPU in `split_epilogue_clamps_lds_to_lds_top_and_validates` and `geometry_forms_validate`). - Retail titles other than `title: 29640639`. **AI use** - Google Antigravity (Gemini 4 Neon) — audited `gpu/dxil/lower_geom.rs`, implemented the `has` gating, `k < maxv` guard, straddling-lane triangle filter, split `lds_top` clamp, and failing-first CPU/GPU tests, and ran targeted, WARP, workspace, and paired smoke verification.
DarkPanda69 commented 2026-11-25 19:09:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T18:39:56Z.


Update for head 98692ec: same result. Applied on main 2664021, gpu_epilogue_filters_oob_triangles_and_no_store_emits passes on the RX 9070 XT (native wave64) and the RTX 3060. Whole gpu:: filter: RX 9070 XT 694 passed, 2 failed (the #2115 fuzz seeds, same on main); RTX 3060 696 passed, 0 failed.


AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both.

Head 2fe72c6 applied on main ae6f284, debug, Windows 11 Pro 26200, cargo test -p xcl --lib -- gpu:: --test-threads=4:

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010, waves 32..64): gpu_epilogue_filters_oob_triangles_and_no_store_emits ok. 684 passed, 3 failed, 22 ignored, 6 SKIPPED.
  • RTX 3060 (driver 32.0.16.1088): the new test ok; 686 passed, 1 failed, 22 ignored.

All failures are on main without this PR: a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier on both cards (fixed by #2379) and, on the RX 9070 XT, the AMD fuzz seeds tracked in #2115.

Not tested: the D3D12 debug layer (not installed here), a title with geometry shaders on the direct path.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7171223514 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7171223514). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T18:39:56Z. --- **Update for head `98692ec`:** same result. Applied on `main` `2664021`, `gpu_epilogue_filters_oob_triangles_and_no_store_emits` passes on the RX 9070 XT (native wave64) and the RTX 3060. Whole `gpu::` filter: RX 9070 XT 694 passed, 2 failed (the #2115 fuzz seeds, same on `main`); RTX 3060 696 passed, 0 failed. --- AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both. Head `2fe72c6` applied on `main` `ae6f284`, debug, Windows 11 Pro 26200, `cargo test -p xcl --lib -- gpu:: --test-threads=4`: - **RX 9070 XT** (RDNA4, driver 32.0.32029.2010, waves 32..64): `gpu_epilogue_filters_oob_triangles_and_no_store_emits` ok. 684 passed, 3 failed, 22 ignored, 6 SKIPPED. - **RTX 3060** (driver 32.0.16.1088): the new test ok; 686 passed, 1 failed, 22 ignored. All failures are on `main` without this PR: `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` on both cards (fixed by #2379) and, on the RX 9070 XT, the AMD fuzz seeds tracked in #2115. Not tested: the D3D12 debug layer (not installed here), a title with geometry shaders on the direct path. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Decodere commented 2026-11-25 20:08:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T19:12:47Z.


Rebased #2419 cleanly onto 3f277701 (98692ec1): preserved #2273's coalesced header + 4-word raw_store in geom_epilogue (lower_geom.rs) alongside #2419's has/k < maxv/valid_ntri/lds_top clamp fixes.

Re-verified lower_geom::tests (2/0 RTX 4060 & WARP), geometry_tests (3/0, including #2273's coalescing test), gpu::dxil::* (182/182), and paired 60 s RTX 4060 smoke (3f277701 1486 frames / 13989 MB vs 98692ec1 1518 frames / 13987 MB, 0 device removals/crashes).

<!-- greyfinch-sync:ivall/xcl:comment:7171974422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7171974422). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T19:12:47Z. --- Rebased `#2419` cleanly onto `3f277701` (`98692ec1`): preserved `#2273`'s coalesced header + 4-word `raw_store` in `geom_epilogue` (`lower_geom.rs`) alongside `#2419`'s `has`/`k < maxv`/`valid_ntri`/`lds_top` clamp fixes. Re-verified `lower_geom::tests` (`2/0` RTX 4060 & WARP), `geometry_tests` (`3/0`, including `#2273`'s coalescing test), `gpu::dxil::*` (`182/182`), and paired 60 s RTX 4060 smoke (`3f277701` `1486` frames / `13989 MB` vs `98692ec1` `1518` frames / `13987 MB`, `0` device removals/crashes).
emirduran707 commented 2026-11-25 20:08:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T19:41:15Z.


Independent AMD RDNA4 (native wave64) test report on exact head 98692ec178f711dd8388ff7496cf95ce0691767f (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1356 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • Both PR tests passed (no skips): gpu::dxil::lower_geom::tests::split_epilogue_clamps_lds_to_lds_top_and_validates and gpu_epilogue_filters_oob_triangles_and_no_store_emits.
    • The 3 failures are pre-existing on the PR's base main: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / #2074, fixed later on main in #2420).

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 98692ec178f711dd8388ff7496cf95ce0691767f
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1542 (PresentX 1542)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14002 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7172634553 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7172634553). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T19:41:15Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `98692ec178f711dd8388ff7496cf95ce0691767f` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1356 passed, 3 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - Both PR tests passed (no skips): `gpu::dxil::lower_geom::tests::split_epilogue_clamps_lds_to_lds_top_and_validates` and `gpu_epilogue_filters_oob_triangles_and_no_store_emits`. - The 3 failures are pre-existing on the PR's base `main`: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722) and `fuzz_validate_and_gpu_3` (seed 1599) on this GPU, plus `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (from `50a9fde` / #2074, fixed later on `main` in #2420). **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 98692ec178f711dd8388ff7496cf95ce0691767f gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1542 (PresentX 1542) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14002 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
DavidM1911 commented 2026-11-25 20:08:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:47:40Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7172773891 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7172773891). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:47:40Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1219/1): ``` gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier assertion failed: group barriers in the program (lower_dxil.rs:1155) ``` The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin
Decodere commented 2026-11-25 20:08:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T19:53:32Z.


Thanks for testing! That gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier failure comes from a pre-#2420 main base (#2074) and was fixed on main in #2420 (c56e7448).

This PR (#2419) only touches crates/xcl/src/gpu/dxil/lower_geom.rs, and CI Build and test on current main (as well as the independent RDNA4 passes on 98692ec1) is green (0 failures).

<!-- greyfinch-sync:ivall/xcl:comment:7172905974 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7172905974). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T19:53:32Z. --- Thanks for testing! That `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` failure comes from a pre-`#2420` `main` base (#2074) and was fixed on `main` in `#2420` (`c56e7448`). This PR (`#2419`) only touches `crates/xcl/src/gpu/dxil/lower_geom.rs`, and CI `Build and test` on current `main` (as well as the independent RDNA4 passes on `98692ec1`) is green (`0` failures).
bmjask commented 2026-11-25 20:20:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:20:41Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ivall/xcl:review:6064389059 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#pullrequestreview-6064389059). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:20:41Z. **Review:** COMMENTED --- 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.
thehollowedone commented 2026-11-28 06:24:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T06:24:46Z.


merge-check
base: e429936c10
head: 98692ec178
merge: clean; an uncommitted merge onto this base changed only crates/xcl/src/gpu/dxil/lower_geom.rs (+123/-20); git diff --cached --check passed
build: cargo build --offline --locked -j 4 --workspace -> ok on the merged tree
tests: cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 -> 2,127 passed, 10 failed, 48 ignored across 39 targets; 25 distinct GPU SKIPPED notices. Untouched base e429936c on this machine: 2,125 passed, the same 10 failed, 48 ignored. Both new lower_geom::tests passed on the RTX 3080 Ti. Failing names are listed below.
review: I read the full diff and the current geometry lowering. No runtime blocker found: emission stops at the per-lane record limit, the straddling lane counts only triangles whose vertices are written, and no-store lanes contribute zero. The change is absent from current main. Nonblocking test improvement: the GPU test always tries split wave64, even on a possible mesh-capable adapter with wave64 but no wave32; gate each form on its own capability. Neither fixture reaches the per-lane emit ceiling, so a dedicated cap case would strengthen its regression coverage.
performance: The default HLSL geometry route does not execute this direct-DXIL path. In explicit direct mode, the added emit guard is per message and the triangle scan runs only for a lane straddling the vertex cap; no frame-time measurement was made.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, rustc 1.99.1 MSVC, DXC 1.8.2502.11. Codex (GPT-6.2 Sol) ran the merge, build and tests and checked the diff; Codex (GPT-6.2 Astra) independently reviewed the low-level geometry and test paths.

Ten failures shared with the exact base
  • gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole
  • gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops
  • gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange
  • gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output
  • gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk
  • gpu::recomp::tests::gpu_compute_mode_dispatch_abi
  • gpu::recomp::tests::gpu_float_cas_uses_ieee_equality
  • test_title_draws_with_a_root_signature_under_the_debug_layer
  • test_title_runs_and_game_folder_is_untouched
  • test_title_runs_under_the_debug_layer_with_dred
<!-- greyfinch-sync:ivall/xcl:comment:7235278064 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7235278064). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T06:24:46Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: 98692ec178f711dd8388ff7496cf95ce0691767f merge: clean; an uncommitted merge onto this base changed only `crates/xcl/src/gpu/dxil/lower_geom.rs` (+123/-20); `git diff --cached --check` passed build: `cargo build --offline --locked -j 4 --workspace` -> ok on the merged tree tests: `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4` -> 2,127 passed, 10 failed, 48 ignored across 39 targets; 25 distinct GPU SKIPPED notices. Untouched base `e429936c` on this machine: 2,125 passed, the same 10 failed, 48 ignored. Both new `lower_geom::tests` passed on the RTX 3080 Ti. Failing names are listed below. review: I read the full diff and the current geometry lowering. No runtime blocker found: emission stops at the per-lane record limit, the straddling lane counts only triangles whose vertices are written, and no-store lanes contribute zero. The change is absent from current `main`. Nonblocking test improvement: the GPU test always tries split wave64, even on a possible mesh-capable adapter with wave64 but no wave32; gate each form on its own capability. Neither fixture reaches the per-lane emit ceiling, so a dedicated cap case would strengthen its regression coverage. performance: The default HLSL geometry route does not execute this direct-DXIL path. In explicit direct mode, the added emit guard is per message and the triangle scan runs only for a lane straddling the vertex cap; no frame-time measurement was made. verdict: safe to merge hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, rustc 1.99.1 MSVC, DXC 1.8.2502.11. Codex (GPT-6.2 Sol) ran the merge, build and tests and checked the diff; Codex (GPT-6.2 Astra) independently reviewed the low-level geometry and test paths. <details><summary>Ten failures shared with the exact base</summary> - `gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole` - `gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops` - `gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange` - `gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output` - `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` - `gpu::recomp::tests::gpu_compute_mode_dispatch_abi` - `gpu::recomp::tests::gpu_float_cas_uses_ieee_equality` - `test_title_draws_with_a_root_signature_under_the_debug_layer` - `test_title_runs_and_game_folder_is_untouched` - `test_title_runs_under_the_debug_layer_with_dred` </details>
throny commented 2026-11-28 06:50:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T06:50:11Z.


merge-check claim
head: 98692ec178

<!-- greyfinch-sync:ivall/xcl:comment:7235547822 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7235547822). Originally posted by [throny](https://github.com/throny) on 2026-11-28T06:50:11Z. --- merge-check claim head: 98692ec178f711dd8388ff7496cf95ce0691767f
throny commented 2026-11-28 07:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T07:06:57Z.


merge-check
base: e429936c
head: 98692ec178
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2128 passed, 9 failed, 48 ignored (26 SKIPPED lines). The 9 failures are main's own at e429936c on this GPU (reported with a bisect on #3041: they arrive with the merge of #2959); the set is identical with and without this PR. Base alone: 2126 passed, 9 failed, 48 ignored.
review: no blocking finding. The emit and cut loop stops at the record's vertex cap, which keeps the 10-bit indices in range; the filter for triangles that straddle the cap is sound (the indices only rise); the LDS clamp matches the one in the memory lowering on main. Minor: one CPU test compares a literal that depends on the current exchange layout. Open from the thread, not blocking: no direct-path title with a geometry shader was run, and the test does not reach the per-lane emit cap.
performance: none by default: direct DXIL only (XCL_DIRECT_DXIL=1), and only its users re-translate once.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7235725384 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7235725384). Originally posted by [throny](https://github.com/throny) on 2026-11-28T07:06:57Z. --- merge-check base: e429936c head: 98692ec178f711dd8388ff7496cf95ce0691767f merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2128 passed, 9 failed, 48 ignored (26 SKIPPED lines). The 9 failures are main's own at e429936c on this GPU (reported with a bisect on #3041: they arrive with the merge of #2959); the set is identical with and without this PR. Base alone: 2126 passed, 9 failed, 48 ignored. review: no blocking finding. The emit and cut loop stops at the record's vertex cap, which keeps the 10-bit indices in range; the filter for triangles that straddle the cap is sound (the indices only rise); the LDS clamp matches the one in the memory lowering on main. Minor: one CPU test compares a literal that depends on the current exchange layout. Open from the thread, not blocking: no direct-path title with a geometry shader was run, and the test does not reach the per-lane emit cap. performance: none by default: direct DXIL only (XCL_DIRECT_DXIL=1), and only its users re-translate once. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
throny commented 2026-11-29 12:15:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T12:15:01Z.


Test report for merging this together with the other of #2102 / #2419 (both are ready to merge on their own): trial merge of both into main d8bd9a38, cargo build --workspace && cargo test --workspace -- --test-threads=4, RTX 4080 16 GB, 621.40:

  • #2102 + #2419: 2622 passed, 2 failed, 49 ignored (27 SKIPPED lines). Failing: gpu::dxil::lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits and gpu::dxil::lower_mem::stage_guard_tests::geometry_export_rejected.
  • main alone: 2618 passed, 0 failed. Each of the two PRs alone passed in its merge checks.

So the two do not go in together as they are; whichever is merged second needs a rebase and a look at those two tests. I have not looked into which side is right.

AI use: Claude Code (Claude Fable 5.2) ran the suite and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7255675176 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7255675176). Originally posted by [throny](https://github.com/throny) on 2026-11-29T12:15:01Z. --- Test report for merging this together with the other of #2102 / #2419 (both are ready to merge on their own): trial merge of both into `main` `d8bd9a38`, `cargo build --workspace && cargo test --workspace -- --test-threads=4`, RTX 4080 16 GB, 621.40: - #2102 + #2419: 2622 passed, **2 failed**, 49 ignored (27 SKIPPED lines). Failing: `gpu::dxil::lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits` and `gpu::dxil::lower_mem::stage_guard_tests::geometry_export_rejected`. - `main` alone: 2618 passed, 0 failed. Each of the two PRs alone passed in its merge checks. So the two do not go in together as they are; whichever is merged second needs a rebase and a look at those two tests. I have not looked into which side is right. AI use: Claude Code (Claude Fable 5.2) ran the suite and wrote this.
throny commented 2026-11-29 14:19:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T14:19:55Z.


Correction to my report above: #2102 and #2419 do not clash with each other. Since #3203, kernel::translate_geometry refuses the split wave64 form when the program has an ES phase, and the new tests of both PRs call it that way, so they stop at that refusal. #3411 fixes the tests on main. Sorry for the wrong lead.

AI use: Claude Code (Claude Fable 5.2) wrote this; Claude Opus 5.5 found the cause.

<!-- greyfinch-sync:ivall/xcl:comment:7257219712 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2419#issuecomment-7257219712). Originally posted by [throny](https://github.com/throny) on 2026-11-29T14:19:55Z. --- Correction to my report above: #2102 and #2419 do not clash with each other. Since #3203, `kernel::translate_geometry` refuses the split wave64 form when the program has an ES phase, and the new tests of both PRs call it that way, so they stop at that refusal. #3411 fixes the tests on `main`. Sorry for the wrong lead. AI use: Claude Code (Claude Fable 5.2) wrote this; Claude Opus 5.5 found the cause.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2409
No description provided.