Repository navigation
Shaders: support 32-lane wave64 lowering for partial-dispatch compute shaders - #22
davi713albano-coder wants to merge 1 commit into
Conversation
|
Verified commit Environment
Results
|
|
I checked the full builder set on RTX 2060 (Windows 10, driver 531.41). With pinned
The two recovered PSOs are for container hashes |
… as the first uncompleted op (DexNom#22) (by FictionHub) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Console thread ids for console wave32 programs in 2-D/3-D groups Not about the partial-dispatch change itself. It is posted here because it sits beside What we found. Evidence. A compute program that stores each thread's console id, built with the old rounding. Ids stored out of total, identical on both GPUs: 32x2 32/64, 32x8 128/256, 64x4 128/256, 32x32 512/1024, 32x2x2 64/128, 10x10 68/100. 12x12 and 24x8 failed pipeline creation on the 4060 ("Not enough memory resources") and stored 96/144 and 128/192 on the 780M. In the title's shader archive three programs were wrong this way, all 32x2 sky ambient-map compute passes. 1-D groups are not affected. The wave tests we looked at ( What fixed it for us. A groupshared ticket, used only for console-lane programs in groups larger than one host wave. Zero a counter, barrier, each full host wave's first lane takes a block of wave-size ids with an atomic add, the partial wave takes the last block, and the console id is base + lane. 221 compute programs in the archive take it. Caveats. The numbers come from our own fork. For this repo we only read the code; we did not build it, and we did not test a discrete Radeon GPU. Separately, |
|
I tested the multidimensional console-wave32 report on RayTime main All ten geometries produced exactly one increment per expected ID with no writes into the padding. That includes 32×2, 32×8, 32×32, 64×4, 8×8, 32×2×2, 10×10, 12×12, 24×8 and a 64×1 control. Each shader validated and created a hardware PSO. I could not reproduce the collision on this Turing setup. The RTX 4060 Laptop and Radeon 780M results remain a separate hardware case. |
Summary
Addresses part of the 32-lane GPU (NVIDIA) ray-tracing builder block reported in #14 and #15 (
Shader wants wave lane count of 64 but maximum wave lane count for device is 32, D3D12 debug id 622):Lower::newskipped wave64-to-wave32 lowering wheneverpartial == true(if !partial && wave == 64 && host_max_wave() == 32 ...), becauseLower::runimplemented partial-dispatch thread masking with an earlyRetin the prologue that would deadlock group barriers (wave_base,exchange_halves,split_lds).XboxBvhBuilder'sBox32/Box16rehydration kernels (box_rehydrationincrates/victory-shader/src/emit/mod.rs) always emittedWaveSize(64)and failedCreateComputePipelineStatewithE_INVALIDARGon 32-lane GPUs.Changes
partialwave64 compute shaders to enter 32-lane lowering onhost_max_wave() == 32(crates/victory-shader/src/emit/lower.rs).self.halves.is_none()(native 64-lane hosts such as Radeon or non-wave64 shaders).self.halves.is_some()(console wave64 emulated across two 32-lane host waves), computepartial_active = (limit == 0) || (group * width + thread < limit)in the entry block without returning early (enter_partial_dispatch/with_partialincrates/victory-shader/src/emit/packed_mask.rs), keeping inactive tail threads alive through group barriers while masking:Lower::guard: stores, atomics, VGPR writes, guest-memory fault reporting,v_readfirstlane_b32),v_cmp_*/v_cmpx_*lane bits (lane_bits_for),mask_dwordwhenst.active.contains(&lo)—EXEC,VCC,s_bcnt1_i32_b64,s_ff1_i32_b64,v_mbcnt_*),scc_some,wave_wide,wave_reduce,active_f64_sum, and scalar guest-memory loads (memory_smem).partial_thread_dispatch_on_32_lane_host_emits_wave32_and_masks_wave_counts_and_writesincrates/victory-shader/src/emit/wave64_tests.rsverifyingPSV0declaresWaveSize(32), Microsoft DXIL validation passes, and (on 32-lane hardware) cross-lanes_bcnt1_i32_b64 execcounts and stores match across tail boundaries (0, 1, 7, 31, 32, 33, 45, 63, 64).Note on hardware testing
Verified full
CI(windows-latest:clippy,clippy --all-features,cargo test --workspace --locked,xtaskasset-policy check, anddxil.dllvalidation) andScreen. Live 32-lane hardware verification (e.g., on RTX 3060 Ti / RTX 4070 from #14 / #15) is still needed and welcomed — this specifically resolves the twobox_rehydrationWaveSize(64)refusals; any remaining non-partial64-lane pipelines on 32-lane hosts are separate.No title data used. AI-assisted.