Repository navigation
feat(shader): selective acyclic predication, f16 reductions, and uniform-VGPR analysis for wave64 on 32-lane hosts - #440
Conversation
…PR analysis for wave64-on-32-lane
…back for wave64-in-halves
|
Extended
Verification:
|
|
Thanks for this. Many pull requests landed today, and this one now conflicts with main. Could you merge or rebase main into it, rerun the checks and ping here? I will review and merge it as soon as CI is green. |
|
Two findings from merging #435's tests on top of this (M5 Pro, Wine + D3DMetal, synthetic tests only):
Happy to turn (1) into a PR against main with a dedicated test if that's useful. Prepared with Claude Code. |
|
A follow-up on the strand-hair shaders this made translate: in |
Summary
crates/victory-shader/src/emit/lower/predicate.rs) for wave64-on-32-lane (halves/one_wave_lds) compute shaders (bounded to<= 64blocks per SESE diamond, strictly acyclic — divergent loops untouched), preserving group-uniform control flow across early-out bounds checks (if (tid >= N) return;) and acyclicif/elsediamonds soexchange_halvesandsplit_wave_barriersremain deadlock-free while masking inactive-lane side effects.Lower::reduce_halfsupporting 16-bitShape::Half(Op::AddH)wave64 reductions across both 32-lane halves.first_lane_across(x, active)to work under arbitrary per-lane active masks (exact even when all 32 lanes of the lower half are inactive), teachesin_step()to propagate group-uniform VGPRs throughv_readfirstlane_b32, and seedslane_uniform()with wave64 geometry-uniformv1/v2andglobal_load_*.crates/victory-shader/src/emit/lower.rsat511,933 B(+162 B net, 12.3 KiB below the 524,288 B cap).Verification (Apple Silicon D3DMetal)
victory-shader halves_tests::): 26/26 passed (0 lanes differ from the consoleon every test, including 4 new GPU readback tests covering early-out bounds checks, acyclicif/elsediamonds, upper-half-onlyv_readfirstlane_b32, split-wave LDS,Shape::Half(Op::AddH), and buffer-loaded uniform loop trip counts).cargo xtask policy,cargo test -p victory-shader(206 passed), and bothgnullvmclippy builds: 0 warnings.