Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXIL and HLSL #2475
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by fixgep on 2026-11-25T20:02:49Z.
Honor
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
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:16:30Z.
Review: COMMENTED
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.
Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T20:18:12Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:34:30Z.
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!
Imported from ivall/xcl. Originally posted by ahmetbagci8 on 2026-11-25T20:47:56Z.
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
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T20:50:10Z.
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
upstream-sync referenced this pull request2026-11-25 22:05:21 +00:00
Imported from ivall/xcl. Originally posted by Oliwettoo on 2026-11-25T22:19:45Z.
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.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:49:58Z.
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
[PR #2485] Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXILto [PR #2485] Recompiler: honor MSG_GS_DONE emit and cut ops in Direct DXIL and HLSLImported from ivall/xcl. Originally posted by fixgep on 2026-11-26T04:33:51Z.
@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.Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T08:16:22Z.
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
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T23:10:50Z.
Independent desktop NVIDIA verification of PR #2485 at head
45e7018140f8163e20814a0b7af52099f86fdccd(1commit; exact parent & merge-base:b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
45e70181)cargo test --release -p xcl --lib msg_gs_done_emits_in_dxil -- --nocapture1 passed; 0 failed; 0 ignored; 1338 filtered out(0.01s)cargo test --release -p xcl --lib msg_gs_done_emits_and_cuts_in_hlsl -- --nocapture1 passed; 0 failed; 0 ignored; 1338 filtered out(0.00s)cargo test --release -p xcl --lib gpu_geometry_msg_gs_done_records -- --nocapture(3 consecutive runs, on-GPU RTX 4060)1 passed; 0 failed; 0 ignored; 1338 filtered out× 3 (0.47s,0.39s,0.39s)cargo test --release -p xcl --lib gpu::dxil::187 passed; 0 failed; 3 ignored; 1149 filtered out(3.37s;dispatch_chain_native_wave64_builds_wholeself-skipped on Wave32-only RTX 4060)cargo test --release -p xcl --lib gpu::recomp::401 passed; 0 failed; 20 ignored; 918 filtered out(5.44s; Wave64-only and#1426-refused subcases self-skipped as expected)cargo build --release -p xcl --bin xcl1m 14s, exit0)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):PR #2485 (
45e7018140f8163e20814a0b7af52099f86fdccd):Runtime log observations (
xcl.log)9223log lines,0[ERROR]/ device-removal / panic lines.19558 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14005 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.Limits of coverage
MSG_GS_DONEemit/cut lowering in Direct DXIL (msg_gs_done_emits_in_dxil), HLSL (msg_gs_done_emits_and_cuts_in_hlsl), and on-GPU record generation (gpu_geometry_msg_gs_done_records, 3/3 runs on RTX 4060) passed alongside fullgpu::dxil::andgpu::recomp::.gpu::dxil::andgpu::recomp::self-skipped on the Wave32-only RTX 4060. The 60 s warm-cache retail smoke confirms end-to-end stability and zero regression ontitle: 29640639rather than visual geometry-shader output comparison on a retail GS draw (frame-count delta vs. cached parent smoke reflects single-run startup variance, not this PR).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:08:42Z.
Tested: Clean
45e7018140f8163e20814a0b7af52099f86fdccd, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2602.17. Built withcargo test -j 2 --locked -p xcl --lib --no-run. CPU geometry filter, excluding the GPU cases: 8 passed, 0 failed, 0 ignored, 0 skips. GPU geometry filters::gpu_geometryandgeometry_es_inputs_validate_and_run_with_heap_windowson the resulting test binary: 6 libtest passes, 0 failed, 0 ignored, including 1 explicit no-wave64 skip. Split-wave64 readback on direct DXIL and HLSL checked three vertices and one triangle for emit and emit+cut, and two vertices and zero triangles for NOP and stream 1. Vertex payloads and packed triangle indices also matched.Not tested: Standalone cut or strip restart on GPU, native wave64 readback, full workspace suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and independently reran the checks and drafted this report.Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:01:24Z.
merge-check claim
head:
45e7018140Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:16:07Z.
merge-check
base:
753e8b1ahead:
45e7018140merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1515 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: none. Output changes only for geometry programs whose GS_DONE message carries an emit or cut on stream 0; the extra condition in the direct-DXIL lowering changes nothing because the helper acts on those two bits only. Not verified: that the hardware honours those bits on that message. For the maintainer: #2494 and #2509 are open duplicates of this change; one should be picked.
performance: no runtime cost. emit.rs is a translator source: every tester re-translates all shaders 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).
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T12:05:28Z.
merge-check claim
head:
45e7018140Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T12:40:10Z.
merge-check
base:
e429936c10head:
45e7018140merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2129 passed, 9 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: 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::tests::gpu_compute_mode_dispatch_abi, gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, test_title_runs_and_game_folder_is_untouched, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_under_the_debug_layer_with_dred: these 9 fail on the base too (the base e429936c's suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9 failing), and each also failed when rerun alone on this merge (the two debug-layer e2e tests stop on the D3D12 debug layer rejecting a pixel shader as corrupt or unsigned, and test_title_runs_and_game_folder_is_untouched on the test title's console command list memory-methods check, "post-Wait32/64 write failed"); not caused by this PR. The suite ran on this PC at the same time as 2 other PRs' suites, in one queued job.
review: none. Whole diff read (lower_geom.rs and emit.rs: s_sendmsg MSG_GS_DONE (3) with a cut / emit / emit-cut op on stream 0 now cuts / emits as MSG_GS does, on both the direct DXIL and HLSL paths; op 0 and other streams still do nothing; geometry_tests.rs: DXIL, HLSL and GPU tests). The GPU test SKIPPED here (no wave64).
performance: reasoned, not measured: shader translation only; geometry shaders ending with an emitting GS_DONE get one more emit; translator output changes for those only.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge db54d60443afb3de1b62cebd78247fdb3c2567e0 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.