Recompiler: handle MSG_GS_DONE emit and cut ops in geometry shaders (#2412) #2494
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2494
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2494"
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?
@ChalanaGimhanaX on GitHub · 2026-11-25 20:17 UTC · original
ChalanaGimhanaX:recomp/gs-done-emit-cut→main· +134 −4 · 3 files · 1 commits · openHandle
s_sendmsgMSG_GS_DONE(msg == 3) emit and cut operations (op1..=3 on stream 0) in geometry shaders instead of silently dropping them, in both Direct DXIL (lower_geom.rs) and HLSL (emit.rs) backends. RDNA2 compilers fold the final vertex emit/cut intoMSG_GS_DONE; keepingop == 0as a no-op preserves plain termination messages.Fixes #2412. Part of #1833.
What is in it
crates/xcl/src/gpu/dxil/lower_geom.rs: processs_sendmsgonmsg == 2 | 3whenop != 0 && stream == 0.crates/xcl/src/gpu/recomp/emit.rs: apply the sameMSG_GS/MSG_GS_DONE(op1..=3) handling in the HLSL geometry backend.crates/xcl/src/gpu/dxil/geometry_tests.rs: added CPU codegen/DXIL-validation tests (0x33,0x23,0x03) and a GPUmesh_drawtest verifying both backends emit all 4 vertices and 2 strip triangles per primitive (before the fix, the test fails with 3 vertices / 1 triangle).Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release build.cargo test -p xcl --lib gpu::dxil::geometry_tests -- --test-threads=1(pre-rebase debug): 5 passed, 0 failed;cargo test -p xcl --lib gpu_geometry_mode_es_gs_strip -- --test-threads=1: 2 passed, 0 failed.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(3da50b0): 1425 passed, 0 failed, 46 ignored.SKIPPEDGPU/adapter tests (26): 21 no wave64, 3 refused f16 forms (#1426), 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required for driver cache disable).cargo test --release -p xcl --test e2e -- --test-threads=1(3da50b0): 4 passed, 0 failed.Regression run
main (
6d051da):this PR (
3da50b0):Not tested
split = falseGPU execution path), AMD / Intel GPUs, Linux / Wine, and retail gameplay beyond the 60-second menu smoke run.AI use
MSG_GS_DONEemit/cut fix across both backends and tests, ran the test suite and regression smoke runs, and drafted this description.@DarkPanda69 on GitHub · 2026-11-25 20:42 UTC · original
AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both, with the direct translator on.
Head
3da50b0as is (onmain6d12f58), debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4, card chosen withXCL_ADAPTER:gpu_geometry_msg_gs_done_emit_and_cutok. 700 passed, 2 failed, 22 ignored; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.For reference: #2485 covers the same
MSG_GS_DONEemit/cut case, and its test also passes on both cards.Not tested: retail geometry shaders, Intel, Linux / Wine.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@ahmetbagci8 on GitHub · 2026-11-25 20:47 UTC · original
Tested
3da50b09541792d98a03a2b90cb38dc8252a562432.0.16.1714), Windows 11 Pro (Build 26300), DXCv1.9.2609cargo test -j 2 -p xcl --lib geometry -- --test-threads=4:13 passed; 0 failed; 0 ignored (3.00s)Not tested
scripts/smoke.ps1(no unpacked title locally).AI use
@emirduran707 on GitHub · 2026-11-25 20:50 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
3da50b09541792d98a03a2b90cb38dc8252a5624(clean detached checkout, no local changes).Tested
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: 1423 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused 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.gpu::dxil::geometry_tests::geometry_msg_gs_done_emit_and_cut_codegen_and_validateandgpu_geometry_msg_gs_done_emit_and_cut.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 20:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@SlopTart on GitHub · 2026-11-25 21:00 UTC · original
gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.@Oliwettoo on GitHub · 2026-11-25 22:19 UTC · original
Heads-up: #2485, #2494 and #2509 make the same change (
MSG_GS_DONEruns its emit/cut op likeMSG_GS, #2412). Read from the diffs (c256c7e,3da50b0,4bc111d), not run:emit.rs) and Direct DXIL (lower_geom.rs). #2485 changes only Direct DXIL, so with it the HLSL path still dropsGS_DONE's emit/cut.op != 0/1..=3guards in #2494 and #2485 change nothing.gs_emit_cutand the HLSL arm only act onop & 1/op & 2, so op 0 is already a no-op in #2509 too.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.