Repository navigation
Conversation
In crates/xcl/src/gpu/dxil/kernel.rs, when translating a split-wave64 GS-only geometry shader (gs_only == true), translate_on_this_thread created a gate block to confine execution to the lower 32-lane hardware wave (cond_br(up, exit, h0)) and registered gate as the SSA entry predecessor of h0 and exit, but then unconditionally closed Block(0) with br(h0) instead of br(gate). This caused two bugs: (1) any split GS-only shader whose entry block is a loop header failed DXIL construction/validation because h0's entry PHI predecessor (gate) was unreachable, and (2) straight-line split GS-only shaders bypassed gate so lanes 32..63 executed the GS body in parallel with lanes 0..31. Capture first (gate when gs_only, else h0) and branch Block(0) to first. Add unit/validator and RTX 4060 wave32 GPU regression tests in kernel.rs. Part of xcl-dev#1269 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Independent focused verification of #2079 on STOR-WINLAB (2026-11-25). Tested
cargo test --locked -p xcl --lib --no-run
cargo test --locked -p xcl --lib gpu::dxil::kernel::gs_only_tests::direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loop -- --exact --nocapture --test-threads=1
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
cargo test --locked -p xcl --lib gpu::dxil::kernel::gs_only_tests::gpu_direct_gs_only_split_skips_upper_wave -- --exact --nocapture --test-threads=1
}
Not tested
AI use
|
|
Linux/RADV + Wine GPU test report on PR Tested
Not tested
AI use
|
|
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, not the native-Windows path: this PR's 2 new tests pass, none skipped. Tested
Not tested
AI use
|
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
IvyNotFound
added a commit
to IvyNotFound/xcl
that referenced
this pull request
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is in it
Route
Block(0)through thegateblock when translating split-wave64 GS-only geometry shaders in Direct DXIL.Part of #1269
crates/xcl/src/gpu/dxil/kernel.rs, whengs_only == true(split && gs_start == Some(0)),translate_on_this_threadcreated agateblock (lw.edge(Block(0), gate)andlw.cond_br(up, exit, h0)) to confine GS-only execution to the lower 32-lane hardware wave and registeredgate(notBlock(0)) as the SSA entry predecessor ofh0andexit. However, line 391 unconditionally terminatedBlock(0)withlw.s.m.br(h0);instead of branching togate. This caused two bugs:pc == 0) is a loop header failed Direct DXIL construction/validation (forward reference ... blocks must be in dominance order) becauseh0's PHIs referenced unreachablegate.gateso both hardware waves (lanes 32..63 in addition to lanes 0..31) executed the GS body in parallel, double-executing global atomics/stores and clobbering LDS.let first = if gs_only { ... gate } else { ... h0 };incrates/xcl/src/gpu/dxil/kernel.rsand terminateBlock(0)withlw.s.m.br(first);.gs_only_testsat the end ofcrates/xcl/src/gpu/dxil/kernel.rs:direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loop: translates and validates a split-wave64 GS-only program whose entry block (pc == 0) is a loop header.gpu_direct_gs_only_split_skips_upper_wave: wave32 Direct DXIL GPU test (guarded byrunner::wave32_supported()) dispatching a 1-group ([64, 1, 1]) split GS-only shader withGLOBAL_ATOMIC_ADDof1tomem[0]and assertingmem[0] == 32(not64).Tested
621.14, wave32), Intel Core i5-11400F, 32 GB RAM, Windows 11 Home build 26200, Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5(01b62ad4).origin/maincbc296ab(debug):direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loop: panicked with"direct DXIL builder error: forward reference to value 106 at instruction 105 (blocks must be in dominance order)".gpu_direct_gs_only_split_skips_upper_wave(withlw.s.m.br(h0);): panicked on RTX 4060 withassertion left == right failed: left: 64, right: 32.fa4bfd11):cargo test --release -p xcl --lib gpu::dxil::kernel::gs_only_tests -- --nocapture(RTX 4060) ->2 passed; 0 failed; 0 ignored(0 skips).XCL_ADAPTER="Microsoft Basic Render Driver" cargo test --release -p xcl --lib gpu::dxil::kernel::gs_only_tests -- --nocapture->2 passed; 0 failed; 0 ignored(CPU entry-loop validation passed; GPU dispatch skipped cleanly viarunner::wave32_supported()).cargo test --release -p xcl --lib gpu::dxil::geometry_tests -- --nocapture(RTX 4060) ->2 passed; 0 failed; 0 ignored(geometry_forms_validateandgpu_geometry_direct_records).fa4bfd11):cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4 --nocapture->1156 passed, 0 failed, 46 ignoredacross 21 test binaries.SKIPPEDlines (27 total, all pre-existing on this wave32 Windows host without Graphics Tools / Developer Mode / heap windows):no wave64skips (4ingpu::recomp::lower::tests,14ingpu::recomp::lower_dxil::tests,2ingpu::recomp::tests).per-lane form: refusedskips ingpu::recomp::lower_dxil::tests(f16 arithmetic,f16 packed,f32 conversions).test_title_draws_with_a_root_signature_under_the_debug_layer: nod3d12SDKLayers.dll;uploads_start_from_each_subresources_state:0x887A002D).shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable driver cache without Windows Developer Mode.heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.Regression run
Paired 60 s retail title runs with
scripts/smoke.ps1(release build, same title, clean working tree) onorigin/main(cbc296ab) and this PR (fa4bfd11):main:this PR:
Not tested
split == false), D3D12 debug layer, heap windows, and Linux/Wine.gs_start == Some(0)); the paired smoke run is a regression check only.AI use
Google Antigravity (Gemini 4 Neon) wrote the fix, tests, and this PR description; all builds, tests, and paired retail smoke runs were executed locally on the hardware listed above.