shader: follow whole-wave float products (v_mul_f32) #150
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!150
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/150/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?
@m0rff on GitHub · 2026-11-26 21:31 UTC · original
m0rff:m0rff/gfx10-refused-shader-shape→main· +116 −6 · 9 files · 1 commits · merged 2026-11-26 22:38 UTCRefs #4.
A whole-wave section made of
v_mul_f32steps is howWaveActiveProductexpands. It was refused as "a whole-wave section step the simulation does not follow: a VALU operation it does not model". The simulation now follows it:wave::Op::MulF, identity 1.0, counted once per lane;waveActiveOp.f32with the product kind;Prefix products and integer products (
v_mul_lo_u32) are still refused. As with the other float reductions, the host multiplies in its own order.Scope, honestly: no run log names the unmodelled operation, so I don't know that any title shader needs a product.
Overlap: @Olima34, whole-wave section steps are in your list on #4. I saw no open PR or branch of yours for this one; say if it collides and I'll rework or close.
Tests (hand-assembled GFX10,
llvm-mc -mcpu=gfx1030):a_whole_wave_product_multiplies_both_halvesruns it on Metal and checks 2^35 on all 64 lanes. It fails without the fix. It skips without the Metal Shader Converter, so Windows CI only covers the lowering.v_mul_f32as their unmodelled example now usev_sub_f32.Run locally:
cargo test -p victory-shader -p victory-hle -p victory -p victory-gpu -p xtask, the Windows-target clippy,cargo xtask policy.ROADMAP §3 also drops "an image store of some channels", fixed by #94. The refusal count is unchanged, since measuring it needs a game run.
@Olima34 on GitHub · 2026-11-26 21:35 UTC · original
Thanks for checking first, @m0rff. No collision: I have nothing open on whole-wave sections. #121 (merged) only split that refusal by cause, so a run log now names the step ("a VALU operation it does not model", etc.), and it didn't lower anything. Updating its
v_mul_f32example tov_sub_f32in the refusal tests is the right move. Go ahead. I'm running the game on an M5 Pro now; if a log shows products in whole-wave sections, I'll post it here.@m0rff on GitHub · 2026-11-26 22:09 UTC · original
Thanks, @Olima34. If your M5 Pro log shows any "whole-wave section step the simulation does not follow: …" lines, products or not, I'd be glad to see them. A
v_mul_f32in one would confirm this PR matters for the title.@Olima34 on GitHub · 2026-11-26 22:10 UTC · original
Here's what my M5 Pro runs show (Series S, windowed,
d41052c, which includes #121's split). The longest run reached the first world frame (4140) before the knownimage+0x55e56f8crash:whole-wave section step the simulation does not follow: a value that is no reduction or prefixwhole-wave section step the simulation does not follow: an EXEC write that is no constantTwo later, shorter runs show the same two forms (3 and 1). None of them says
a VALU operation it does not model, so nov_mul_f32product reaches this refusal in what I've loaded so far. "no reduction or prefix" means every step was modelled but the result isn't a single reduction or prefix. If that's the shape you'd expect from a product mixed with something else, it may be worth a look. I'll post again if a longer run shows the VALU form.@m0rff on GitHub · 2026-11-26 22:25 UTC · original
Thanks, @Olima34, that's useful. On your question: I don't think the "no reduction or prefix" ones involve a product. On
d41052c, anyv_mul_f32in a section would have reported "a VALU operation it does not model" instead. The "EXEC write that is no constant" ones are less certain, since the simulation stops at that write and never sees what follows. So #150 doesn't fix anything in your logs as far as they show; it only closes the gap for plain products.@Olima34 on GitHub · 2026-11-26 22:35 UTC · original
Agreed, @m0rff: with #121's split, a product would have named itself, so #150 is a gap closed ahead of need rather than a fix for these logs. That's still worth having, since
WaveActiveProductis a plain HLSL intrinsic.On the "EXEC write that is no constant" ones: I can run the game here in a few minutes. If a diagnostic would tell us what the section does after that write (the next steps, or the EXEC source), point me at a branch, or say what to log, and I'll post the forms from a world-load run.
@LakshanSivakumar on GitHub · 2026-11-26 22:38 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!