Shaders: request WaveSize(32) when a scalar join reads a lane mask #387

Open
github-bot wants to merge 1 commit from github-bot/gh-387 into main AGit
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 00:14 UTC · original
avt0m4t48:fix/shader-mask-join-wave-width → main · +89 −6 · 1 files · 1 commits · open

Refs #356.

When a Wave32 compute shader joins a lane mask and a scalar number, the incoming mask is materialized as a DXIL ballot while lowering the join. Main can emit that ballot without a fixed wave size or the console's lane ordering. The resulting mask can contain only 16 bits if the shader is scheduled with 16 lanes.

When the join actually materializes a ballot without the native Wave32 layout, run lowering again with that layout. This applies to guest Wave32 compute programs. The case where the two incoming values are ordinary numbers keeps the default wave-size behavior.

The checked-in regression failed on the original emitter. On the branch based on 31714de, the shader suite completed with 172 passed and two ignored. The Windows MSVC all-feature shader test targets type-checked with warnings denied. Microsoft DXIL validation accepted the exact synthetic shader on both revisions. The disassembly had waveActiveBallot without a wave size on main and WaveSize=32 on this branch. The numeric control had neither the ballot nor a wave-size declaration.

The laptop in #356 has not run this branch. Adapter selection remains relevant to diagnosing that report, and the other five failures need their own checks.

AI-assisted using Codex.

**@⁠avt0m4t48** on GitHub · 2026-11-25 00:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/387) `avt0m4t48:fix/shader-mask-join-wave-width` → `main` · +89 −6 · 1 files · 1 commits · open Refs #356. When a Wave32 compute shader joins a lane mask and a scalar number, the incoming mask is materialized as a DXIL ballot while lowering the join. Main can emit that ballot without a fixed wave size or the console's lane ordering. The resulting mask can contain only 16 bits if the shader is scheduled with 16 lanes. When the join actually materializes a ballot without the native Wave32 layout, run lowering again with that layout. This applies to guest Wave32 compute programs. The case where the two incoming values are ordinary numbers keeps the default wave-size behavior. The checked-in regression failed on the original emitter. On the branch based on `31714de`, the shader suite completed with 172 passed and two ignored. The Windows MSVC all-feature shader test targets type-checked with warnings denied. Microsoft DXIL validation accepted the exact synthetic shader on both revisions. The disassembly had `waveActiveBallot` without a wave size on main and `WaveSize=32` on this branch. The numeric control had neither the ballot nor a wave-size declaration. The laptop in #356 has not run this branch. Adapter selection remains relevant to diagnosing that report, and the other five failures need their own checks. AI-assisted using Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:18 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/387/head:github-bot/gh-387'
git switch 'github-bot/gh-387'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-387'
git switch 'github-bot/gh-387'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-387'
git switch 'github-bot/gh-387'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-387'
git switch 'main'
git merge --squash 'github-bot/gh-387'
git switch 'main'
git merge --ff-only 'github-bot/gh-387'
git switch 'main'
git merge 'github-bot/gh-387'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.