Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXIL and HLSL #2485
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!2485
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2485"
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?
@fixgep on GitHub · 2026-11-25 20:02 UTC · original
fixgep:fix/dxil-msg-gs-done-emit-cut→main· +135 −4 · 3 files · 1 commits · openHonor
s_sendmsgMSG_GS_DONE(msg == 3) emit and cut operations on stream 0 in both the Direct DXIL and HLSL geometry lowering paths, instead of only handlingMSG_GS(msg == 2). Shader compilers fold the final vertex emit/cut intoMSG_GS_DONE, which previously dropped the final emitted vertex and its strip triangle(s). Fixes #2412.What is in it
msg == 2 || msg == 3withop != 0 && stream == 0ins_sendmsg(crates/xcl/src/gpu/dxil/lower_geom.rs)msg == 2 | 3onstream == 0ins_sendmsgforMode::Geometry(crates/xcl/src/gpu/recomp/emit.rs)MSG_GS_DONEemit (0x23), cut (0x13), emit+cut (0x33), nop (0x03), and non-zero stream (0x123) (crates/xcl/src/gpu/dxil/geometry_tests.rs)Tested
cargo build --workspace(45e70181): 0 errors, 0 new warningscargo test -p xcl --lib dxil::geometry_tests -- --test-threads=4(45e70181): 7 passed, 0 failed, 0 ignoredcargo test -p xcl --lib geometry -- --test-threads=4(45e70181): 14 passed, 0 failed, 0 ignored (1 SKIPPED GPU test:gpu_geometry_wave32_prefix_count_over_a_mask: no wave64)XCL_ADAPTER=warp cargo test -p xcl --lib geometry -- --test-threads=4(45e70181): 14 passed, 0 failed, 0 ignored (6 SKIPPED GPU tests on WARP)cargo test -p xcl --lib recomp -- --test-threads=4(45e70181code): 400 passed, 1 failed (pre-existinggpu::recomp::tests::gpu_clamp_and_omod_per_instructiononv_pk_add_i16 clamp), 20 ignored (23 SKIPPED GPU lines: 20no wave64, 3refused (unsupported ...)inlower_dxil::tests)cargo test --workspace --no-fail-fast -- --test-threads=4(45e70181):xcl --lib1311 passed, 1 failed (pre-existinggpu::recomp::tests::gpu_clamp_and_omod_per_instruction), 27 ignored (25 SKIPPED GPU lines: 21no wave64, 3refused (unsupported ...)inlower_dxil::tests, 1cannot disable the driver cache); integration (xcl --test '*') 126 passed, 0 failed, 20 ignored (1 SKIPPED GPU test:no heap windows)Regression run
Not tested
no wave64GPU skips on this adapter), and retail geometry shaders usingMSG_GS_DONEemit/cut (the smoke title does not confirm hitting this path)AI use
@DavidM1911 on GitHub · 2026-11-25 20:34 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!
@ahmetbagci8 on GitHub · 2026-11-25 20:47 UTC · original
Tested
c256c7ea96ce14db6d165e30ba0360cfcdf3c0db32.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 (5.55s)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
c256c7ea96ce14db6d165e30ba0360cfcdf3c0db(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::msg_gs_done_emits_in_dxilandgpu_geometry_msg_gs_done_records.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
@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.@DavidM1911 on GitHub · 2026-11-26 01:49 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXILto Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXIL and HLSLc256c7ea96to45e7018140@fixgep on GitHub · 2026-11-26 04:33 UTC · original
@Oliwettoo Thanks for flagging the HLSL gap. Updated
45e70181(rebased ontomain) socrates/xcl/src/gpu/recomp/emit.rsalso honorsMSG_GS_DONE(msg == 3) emit and cut ops on stream 0, alongside synthetic HLSL emission tests (msg_gs_done_emits_and_cuts_in_hlsl) and GPUmesh_drawcoverage for both Direct DXIL and HLSL ingpu_geometry_msg_gs_done_records.@DarkPanda69 on GitHub · 2026-11-25 20:18 UTC · original · edited 2026-11-26 05:08 UTC
Update for head
45e7018: it now applies tomainb49be18, so this rerun is paired againstmain, withXCL_DIRECT_DXIL=1, same cards. On both, the only result changes aregpu_geometry_msg_gs_done_records,msg_gs_done_emits_in_dxilandmsg_gs_done_emits_and_cuts_in_hlsl, all ok, with no new skips. RX 9070 XT: 708 → 711 passed, 2 failed (#2115, the same onmain), 6 SKIPPED. RTX 3060: 710 → 713 passed, 0 failed, 24 SKIPPED.AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both, with the direct translator on.
Head
c256c7eas is (onmain6d12f58), debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4:gpu_geometry_msg_gs_done_recordsok. 700 passed, 2 failed, 22 ignored, 6 SKIPPED; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.Not tested: retail geometry shaders that use
MSG_GS_DONE.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@bmjask on GitHub · 2026-11-25 20:16 UTC · original · reviewed
No blocking Direct-DXIL correctness defect found. The GS_DONE handling is consistent with the supported AMD message operations, and the new tests cover emit/cut/NOP plus stream filtering. Nonblocking coverage gap: the new GPU case only runs split-wave64 lowering; please add a native-wave64 run when supported. Separately, the HLSL backend still treats GS_DONE as a no-op; that appears to be a pre-existing parity follow-up rather than a defect in this PR.
@oni-swr on GitHub · 2026-11-26 08:16 UTC · original
Independent native AMD test report for #2485 (issue #2412) on exact head
45e7018140f8163e20814a0b7af52099f86fdccd, against its exact parentb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7(main). Both were clean detached checkouts with no local changes. This is a test report only, not a source review.Tested
stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11 from Windows SDK 10.0.26100.0, debug build. The suite log namesAMD Radeon RX 7800 XTas the adapter.cargo test -j 4 --workspace --no-fail-fast -- --test-threads=4: 1437 passed, 1 failed, 47 ignored. The failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,seed 722: res[30] = 0x1, CPU 0x7fffffff.cross_queue_wait64_before_signal_does_not_deadlock_submit_thread,placed_title_textures_share_vram_and_preserve_pixelsandfine_timer_makes_short_sleeps_short. That run took 241 s against 38 s for the head's lib run, and the 3 passed when I reran them alone with--test-threads=1(3 passed, 0 failed). I take them as load-dependent timing failures, not a PR effect.f16_programs_on_the_gpu/f32_programs_on_the_gpucases (refused ... its #1426 semantics differ), andheap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows. None of them is a geometry test.cargo test -j 4 -p xcl --lib geometry -- --test-threads=1: 14 passed, 0 failed. This includesgpu_geometry_msg_gs_done_records,msg_gs_done_emits_in_dxilandmsg_gs_done_emits_and_cuts_in_hlsl. The GPU test ran and was not skipped.gpu_geometry_msg_gs_done_recordsruns both lowering paths (Direct DXIL and HLSL) throughrunner::mesh_drawon this adapter and checks vertex and triangle counts and record contents:0x23and emit+cut0x33: 3 vertices and 1 triangle per primitive, on both paths.0x03and nonzero stream0x123: 2 vertices and 0 triangles, on both paths.0x13is covered only by the string-level HLSL test (xcl_strip = 0u;). I did not measure it on the GPU.geometry_tests.rsagainst the parent's source, and all 3 new tests fail there. The GPU test fails withdirect simm=0x23: vertex count.Regression run
scripts/smoke.ps1and used no title or game data.Not tested
XCL_DIRECT_DXILcombinations beyond what the tests set, and retail titles.AI use
🤖 Generated with Claude Code
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.