Direct DXIL: TG_SIZE counts a partial last wave #1950
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!1950
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1950/head"
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?
@upipibi on GitHub · 2026-11-24 23:49 UTC · original
upipibi:fix/direct-tg-size-partial-wave→main· +7 −5 · 2 files · 2 commits · merged 2026-11-25 00:49 UTCThe direct DXIL translator sets TG_SIZE's wave count to
threads / lanes. A compute group that is not a whole number of waves therefore reads one wave too few. 96 threads in wave64 give 1 where the console, and the HLSL path, give 2. Found by running #1934'sXCL_DXIL_DIFF=1mode (comment there): HLSL and direct differed in all 96 stored words ofgpu_compute_tg_size_counts_a_partial_last_wave.What is in it
crates/xcl/src/gpu/dxil/kernel.rs: the wave count istotal.div_ceil(lanes), andTRANSLATOR_VERSIONgoes from 7 to 8 so cached kernels pick up the change. #1946 and #1952 also bump it to 8, so whichever merges later takes the next number.crates/xcl/src/gpu/recomp/tests.rs:gpu_compute_tg_size_counts_a_partial_last_wavebuilds its kernel throughdirect_or, so withXCL_DIRECT_DXIL=1it runs the direct translator. Until now it compiled only the HLSL path. The test's expectations are unchanged.Tested
NVIDIA GeForce RTX 3070 8 GB (32-lane waves, split wave64), driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug; on
main95ae589.gpu_compute_tg_size_counts_a_partial_last_wave: passes with and withoutXCL_DIRECT_DXIL=1. With thekernel.rsline reverted andXCL_DIRECT_DXIL=1it fails:left: 1, 96 threads, wave64, thread 0.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu_ --skip gpu_sparse_vram --test-threads=4: 110 passed, 0 failed, 1 ignored (the same asmain). The sparse test was skipped because of #1727.cargo test -p xcl --lib -- gpu::dxil --test-threads=4: 101 passed, 0 failed, 3 ignored.Regression run
The change is one constant in the direct translator's compute prologue; the HLSL path is unchanged. Run by eizispark on an AMD Radeon RX 9070 XT (RDNA4), 60 s,
main20cf130and this head415fc5e(their report is in the comments):main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@futurepro62 on GitHub · 2026-11-24 23:58 UTC · original · edited 2026-11-25 00:05 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
415fc5e(on its base95ae589).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::dxil::fuzz_tests: 975 passed, 0 failed, 43 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.#[test]functions in the diff.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 984 passed, 0 failed, 45 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 main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (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
@eizispark on GitHub · 2026-11-25 00:25 UTC · original
Hardware test report — commit
415fc5e@upipibi Verified
415fc5ef4307ccbdf1cb91c45bb1db5c0deba1e6on AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64): pass, including theXCL_DIRECT_DXIL=1native wave64 path and thexcl-smokepair against ancestormain(20cf130).Tested
32.0.32015.16001), 32 GB RAM,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test -p xcl --lib gpu_compute_tg_size_counts_a_partial_last_wave -- --nocapture --test-threads=1(XCL_DIRECT_DXILunset, HLSL path):1 passed, 0 failed, 0 skippedXCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_compute_tg_size_counts_a_partial_last_wave -- --nocapture --test-threads=1(translate_computewithKernelOptions { wave64: true, split: false, .. }for(96, true),(64, true),(128, true)on 64-lane hardware waves, plus(96, false)and(40, false)on 32-lane waves):1 passed, 0 failed, 0 skippedcargo test --workspace --no-fail-fast -- --test-threads=4:983 passed, 2 failed, 45 ignored(8 skipped), with0new failures:#1679AMD fuzz seeds failed (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3seed 1599)8 skipped: 6gpu::recomp::lower_dxil::testsf16/f32 direct-DXIL per-lane cases refused where#1426semantics differ from the console's;shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required,0x887A002D);heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsRegression run (
scripts/smoke.ps1, 60 s, warm shader/driver cache; first post-TRANSLATOR_VERSION = 8cache-rebuild pass also exited0x0with1614frames,60 60 60,0removals,0crashes,14859 MB)main(20cf13022f764208384c610c2ae6a3f4eed201a2):PR (
415fc5ef4307ccbdf1cb91c45bb1db5c0deba1e6):Not tested
XCL_DIRECT_DXIL=1enabledAI use
@DavidM1911 on GitHub · 2026-11-25 02:50 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!