perf(mesh): replace literal Wave64 half-mask counts with clamped lane arithmetic #660

Open
github-bot wants to merge 6 commits from github-bot/gh-660 into main AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-06 01:38 UTC · original
tommiehansen:perf/phase13-mesh-wave64-count-20261206 → main · +135 −5 · 4 files · 6 commits · draft

Why

Literal full-half-mask v_mbcnt instructions reconstruct the guest lane using unnecessary population counts in Wave64 mesh shaders.

What changes

Opt-in VICTORY_MESH_LANE_COUNT64=1 uses min(lane,32) and max(lane-32,0), plus the original src1. Other masks, non-mesh and guest Wave32 retain original lowering. Independent of #656, with separate cache identity.

Benchmark results

48 compiler cases / 24 matched pairs from CI 47592392025, production DXIL -> SPIR-V -> pinned Mesa RADV/ACO.

Architecture Host wave Before instructions After Reduction
GFX1100 32 36 29 19.44%
GFX1200/1201 32 38 30 21.05%
All three 64 30 24 20.00%

Consistent across low/high/edge/cull fixtures, register allocation and LDS unchanged. Compiler artifacts. Compiler counts, not physical GPU timing.

Why this should be merged

Removes unnecessary guest lane reconstruction while preserving the original count semantics; no quality change.

Validation

Isolated upstream-base CI 47593620781 both jobs passed, four exact WARP rendered images and production compile; prior ACO evidence on the original BTD audit branch, with identical Wave64 lowering. Actual title shader coverage and GPU timing remain unknown.

Compatibility

Default off; no dependency on #656 or #469. Both guest wave widths remain distinct admission families. Physical AMD validation required before enabling by default.

Final-head census and combined validation

e61fdabe CI 47595108854 passed Linux and Windows with diagnostics-only VICTORY_MESH_LANE_CENSUS=1 (guest_wave=64, translated/eligible counters). Combined CI 47595204584 passed four exact cross-switch controls and four exact Wave64 renders with the Wave32 switch enabled. The earlier compiler audit is not a new final-head audit; real-title frequency and physical GPU timing remain unknown. Draft retained.

**@⁠tommiehansen** on GitHub · 2026-12-06 01:38 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/660) `tommiehansen:perf/phase13-mesh-wave64-count-20261206` → `main` · +135 −5 · 4 files · 6 commits · draft ## Why Literal full-half-mask v_mbcnt instructions reconstruct the guest lane using unnecessary population counts in Wave64 mesh shaders. ## What changes Opt-in VICTORY_MESH_LANE_COUNT64=1 uses min(lane,32) and max(lane-32,0), plus the original src1. Other masks, non-mesh and guest Wave32 retain original lowering. Independent of #656, with separate cache identity. ## Benchmark results 48 compiler cases / 24 matched pairs from [CI 47592392025](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47592392025), production DXIL -> SPIR-V -> pinned Mesa RADV/ACO. | Architecture | Host wave | Before instructions | After | Reduction | |---|---:|---:|---:|---:| | GFX1100 | 32 | 36 | 29 | 19.44% | | GFX1200/1201 | 32 | 38 | 30 | 21.05% | | All three | 64 | 30 | 24 | 20.00% | Consistent across low/high/edge/cull fixtures, register allocation and LDS unchanged. [Compiler artifacts](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47592392025/artifacts/15963417744). Compiler counts, not physical GPU timing. ## Why this should be merged Removes unnecessary guest lane reconstruction while preserving the original count semantics; no quality change. ## Validation [Isolated upstream-base CI 47593620781](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47593620781) both jobs passed, four exact WARP rendered images and production compile; prior ACO evidence on the original BTD audit branch, with identical Wave64 lowering. Actual title shader coverage and GPU timing remain unknown. ## Compatibility Default off; no dependency on #656 or #469. Both guest wave widths remain distinct admission families. Physical AMD validation required before enabling by default. ### Final-head census and combined validation [e61fdabe CI 47595108854](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47595108854) passed Linux and Windows with diagnostics-only VICTORY_MESH_LANE_CENSUS=1 (guest_wave=64, translated/eligible counters). [Combined CI 47595204584](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47595204584) passed four exact cross-switch controls and four exact Wave64 renders with the Wave32 switch enabled. The earlier compiler audit is not a new final-head audit; real-title frequency and physical GPU timing remain unknown. Draft retained.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 01:42:59 +00:00
This pull request can be merged automatically.
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/660/head:github-bot/gh-660'
git switch 'github-bot/gh-660'

Merge

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