Direct DXIL: route split-wave64 GS-only entry through gate block #2079
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!2079
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2079"
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?
@Decodere on GitHub · 2026-11-25 03:22 UTC · original
Decodere:fix-1269-dxil-gs-only-gate→main· +69 −3 · 1 files · 1 commits · openWhat 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.
@futurepro62 on GitHub · 2026-11-25 03:29 UTC · original · edited 2026-11-25 03:33 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
fa4bfd1(on its basecbc296a).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1144 passed, 0 failed, 44 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loop,gpu_direct_gs_only_split_skips_upper_wave.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1155 passed, 0 failed, 46 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on maincbc296atoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputestsconst_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@JJAutoCompare on GitHub · 2026-11-25 03:42 UTC · original
Independent focused verification of xcl-dev/xcl#2079 on STOR-WINLAB (2026-11-25).
Tested
fa4bfd1149330ae4e0831702a9ce0eddb327981ebefore and after. The assigned worktree matched that SHA and was clean and detached at both checks.XCL_ADAPTER=A770andXCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.[1, 1, 1]groups of[64, 1, 1]threads with two 32-lane hardware waves. Starting from zero, the atomic readback satisfiedmem[0] == 32, the fixture's assertion that only the lower wave contributed.powershell.exe -NoProfile -ExecutionPolicy RemoteSignedprocess.Not tested
AI use
@SzczepanGrela on GitHub · 2026-11-25 04:42 UTC · original
Linux/RADV + Wine GPU test report on PR
#2079headfa4bfd1(fast-forward ontoorigin/maincbc296a,rustc 1.97.1, zero compiler warnings).Tested
7.3.0-5-cachyos), AMD Radeon RX 9070 (RADV GFX1201, device0x7550, native wave64, Mesa26.2.5-arch3.1, Vulkan1.4.354),GE-Proton11-12(wine-11.0 (Staging),vkd3d-proton v3.1-1-g8293130eb), DXC1.9.2602.17(21d28f72). Cross-builtx86_64-pc-windows-gnurelease (--lib, 39.37 s) withXCL_REQUIRE_GPU=wave64 XCL_NETWORK=0.gs_only_tests --test-threads=1 --nocapture(direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loopandgpu_direct_gs_only_split_skips_upper_wave): 2 passed, 0 failed in all 4 env modes: default (0.11 s),XCL_SPLIT_WAVE64=1(0.08 s),XCL_DIRECT_DXIL=all(0.08 s), andXCL_DIRECT_DXIL=all XCL_SPLIT_WAVE64=1(0.08 s).gpu::dxil::geometry_tests --test-threads=1(geometry_forms_validate,gpu_geometry_direct_records): 2 passed, 0 failed in default env (0.16 s, vsorigin/maincbc296a0.17 s) andXCL_DIRECT_DXIL=all(0.16 s, vsorigin/maincbc296a0.19 s).gpu::dxil --skip ops_tests::integer_ops_match_cpu --skip ops_tests::uaddc_and_usubb_match_cpu --test-threads=1: 121 passed, 1 failed, 3 ignored (2.64 s), vsorigin/maincbc296a119 passed, 1 failed, 3 ignored (3.26 s; +2 passed fromgs_only_tests, identical single failuregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2atcrates/xcl/src/gpu/dxil/fuzz_tests.rs:1171:21,seed 1003: res[713] = 0x1, CPU 0x0).gpu::recomp::tests::gpu_ --test-threads=1 --skip gpu_sparse_vram_descriptors_buffers_and_xmem --skip gpu_uma_import_check_at_init --skip gpu_unified_memory_arena:origin/maincbc296a99 passed, 1 failed, 1 ignored (4.50 s); identical failuregpu_nonfused_mad_and_mac_prevent_fma_contraction.XCL_DIRECT_DXIL=all: 96 passed, 4 failed, 1 ignored (2.30 s), vsorigin/maincbc296a96 passed, 4 failed, 1 ignored (2.48 s); identical 4 failures (gpu_f64_math_random,gpu_f64_roots,gpu_image_get_resinfo_1d_array,gpu_nonfused_mad_and_mac_prevent_fma_contraction).XCL_SPLIT_WAVE64=1: run 1 89 passed, 11 failed, 1 ignored (5.03 s) and run 2 90 passed, 10 failed, 1 ignored (4.67 s), vsorigin/maincbc296arun 1 89 passed, 11 failed, 1 ignored (5.27 s) and run 2 89 passed, 11 failed, 1 ignored (4.83 s). PR#2079run 1 matchesorigin/maincbc296arun 2 on the exact same 11 failing tests (includinggpu_grouped_loads_bounds_and_inactive_lanesfailing withs127: 0x0 / 0xffffwhilegpu_split_wave64_masks_read_whole_after_partial_writespassed), and PR#2079run 2 passed both of those tests.Not tested
scripts/smoke.ps1, integration test binaries,--libmodules outsidegpu::dxilandgpu::recomp::tests::gpu_, andXCL_DIRECT_DXIL=1onrecomp(no retail title files locally).gpu::dxil::ops_tests::integer_ops_match_cpuanduaddc_and_usubb_match_cpu(skipped: pre-existingvkd3d-proton v3.1/libvulkan_radeon.soabort exit 3).gpu_sparse_vram_descriptors_buffers_and_xmem,gpu_uma_import_check_at_init, andgpu_unified_memory_arena(skipped: pre-existing Wine in-process COM vtable swap).AI use
@JoaoPauluu on GitHub · 2026-11-25 05:22 UTC · original
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
x86_64-pc-windows-gnu.fa4bfd1as it is (merge base withmaincbc296a), no uncommitted changes. The lib test binary runs under Wine, one test per process.direct_gs_only_split_routes_entry_through_gate_and_validates_entry_loop: okgpu_direct_gs_only_split_skips_upper_wave: okNot tested
AI use
@DavidM1911 on GitHub · 2026-11-25 05:26 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!
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.