GPU tests: run wave64 kernels as two wave32 halves on 32-lane GPUs #71
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!71
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/71/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?
@gefydev on GitHub · 2026-11-23 00:26 UTC · original
gefydev:recomp-kernel-tests-wave32→main· +90 −33 · 4 files · 1 commits · closed without mergingOn an adapter without 64-lane waves (NVIDIA), 41 GPU tests print
SKIPPED …: no wave64. Most of them check instruction semantics that don't depend on the wave size: f64, atomics, images, typed buffers, scalar moves. So on NVIDIA the recompiler's output for those instructions is never run at all.This PR runs the kernels the same way console mesh programs already run there (#39): as two native wave32 halves of one logical wave64.
Options::hw_wave = 32with a wave64 kernel:[WaveSize(32)],[numthreads(64, 1, 1)],xcl_half = gi >> 5,xcl_logical_wave64 = true, andlane_id/ the VGPR slot isWaveGetLaneIndex() + 32 * xcl_half. Each half holds only its own word of a lane mask (the other word is 0) and the same uniform SGPRs, so the first lane of each halfInterlockedOrs the SGPRs into the result. The result buffer is a fresh committed resource, so it starts zeroed. A mask then gets both words, and a uniform value stays the same.runner::run_code/run_code_withuse that whenwave64_supported()is false. They refuse a programgeometry_wave32_hazardsflags ("needs a 64-lane wave (cross-half semantics: …)"), so a test can't pass on a split that changes its meaning.gpu_ready_wave32. The others keepgpu_ready. Those are the cross-lane tests (DPP, swizzle, readlane, EXEC/VCC branches), the ones that draw, and the arena/mesh ones.gpu_kernel_halves_merge_lane_masks:v_cmpover 64 lanes givesvcc = (0xFFFFFFFF, 0xFF)withv0 < 40, and a uniforms_movkstays0x1234.Adapters with wave64 are unchanged:
hw_wavestays 0, the tests run as before.gpu_frexp_f64_exp_and_mantfails when split, so it keepsgpu_readyhere:v_frexp_mant_f64with NEG on a NaN keeps the sign. The f64 NEG modifier is emitted as-x, which DXIL compiles asfsub -0.0, x, and IEEE doesn't define the sign of a NaN result there. #72 fixes that on top of this one.Validation
GTX 1650 (Turing, wave32 only), Windows 11, NVIDIA driver 32.0.16.2114, MSVC debug build, DXC from Windows SDK 10.0.26100:
cargo test --workspace(lib, e2e with the test title, console_dlls_e2e, gpu_pso_e2e, …): 0 failed, the same asmainon this machine. No test that passes onmainfails here.cargo test -p xcl --lib gpu::one at a time: 19SKIPPED … no wave64instead of 41. The 22 tests above ran on the GPU and passed, plus the new one.Before that I checked each test on the same GPU on Linux (Wine + vkd3d-proton 2.14.1). There
global_atomic_inc_x2/dec_x2hang ingpu_more_atomics_sub_dword_scratch_valu, even with one lane. On Windows they finish in ~60 ms with the right values, so that one is vkd3d's DXIL → SPIR-V, not the HLSL.@FZNull on GitHub · 2026-11-23 00:51 UTC · original
Validated on native Windows 11 (not Wine/vkd3d-proton): RTX 4060 (Ada, lane range 32..32), MSVC, DXC 1.8.2502.11 from SDK 10.0.26100.
dd713e3/ PR heada7a2074(this PR includes #71)cargo test --workspace --no-fail-fast: 372 -> 373 passed, 0 failed, 34 ignoredSKIPPED ...: no wave64drops from 41 to 19, so 22 GPU tests that never ran on this adapter now run and passcargo test -p xcl --lib: 343 -> 344 passedNo TDR, no device removal; mesh and e2e tests unaffected. Nothing from a game package was used.
AI-assisted.
@certified-retart on GitHub · 2026-11-23 02:14 UTC · original
Tested
a81bb28locally on Windows 10 (with D3D12 Agility SDK 1.620.2 / DXC 10.0.26100.0) across both a wave32 NVIDIA GPU and a wave64 AMD GPU:XCL_ADAPTER=0):cargo test -p xcl --lib gpu::recomp::tests::gpu_ -- --test-threads=1 --nocapturegpu_kernel_halves_merge_lane_masks,gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_*,gpu_bvh_intersect_ray,gpu_f64_class_compare,gpu_rndne_f64,gpu_global_atomics_and_sub_dword_access,gpu_more_atomics_sub_dword_scratch_valu,gpu_images_*,gpu_typed_buffer_loads_and_stores,gpu_valu_*,gpu_v_swaprel_b32,gpu_dword_addtid_per_lane_addresses, etc.no wave64as expected (plusgpu_retail_vs_blit_gen_amb_cubewithoutXCL_SAMPLE_RPFand ignoredgpu_arena_partial_commit_probe).XCL_ADAPTER=1,XCL_REQUIRE_GPU=wave64):@Foniass on GitHub · 2026-11-23 02:39 UTC · original
Same overlap as on #70: #67 also runs the GPU test kernels on 32-lane GPUs (2 tests left
SKIPPEDon an RTX 5070 Ti, against 18 with this PR), and the two conflict inemit.rsandrunner.rs. Side-by-side results: https://github.com/ivall/xcl/pull/67#issuecomment-7090105968. The f64 fix in #72 applies on top of #67 too, withgpu_ready_wave32→gpu_readyin its test.@ivall on GitHub · 2026-11-23 10:21 UTC · original
Thanks – closing as superseded by #67 (merged), which runs wave64 kernels / compute / mesh / ES+GS on 32-lane GPUs as two wave32 halves that exchange masks and lane values, so the cross-lane tests run there too (2 skips left on an RTX 5070 Ti vs 18–19 with this approach). The f64 sign-bit fix from #72 is on
main(c2887bb).Pull request closed