perf(shader): experiment with block-local descriptor reuse #606

Open
github-bot wants to merge 7 commits from github-bot/gh-606 into main AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-05 17:04 UTC · original
tommiehansen:perf/phase12-descriptor-local-reuse-20261205 → main · +307 −6 · 3 files · 7 commits · draft

Why

Cross-block common-subexpression reuse of immutable descriptor and constant-buffer loads can extend scalar value lifetimes. On descriptor-heavy shaders, excessive SGPR pressure may lead to spilling, but recomputing loads also has a cost.

What changes

Experiment with limiting cross-block CSE for these loads while keeping ordinary CSE and default behavior unchanged. Opt-in VICTORY_SHADER_OPT=575 (default 63 + bit 512). Adapted to the current reusable expression-table optimizer and scratch storage. Independent of #601 and #542's wave-control-flow change.

Benchmark results

No measured register allocation or runtime improvement established. Current scope is exactness and switch coverage.

Current CI at 27544fe Result
Optimizer 16 passed
Local reuse and switch parser Passed
Translated scalar-buffer WARP Both arms exact

Why this should be merged

Selective rematerialization could reduce long-lived scalar values in affected shaders, but NIR may reintroduce CSE and extra loads may outweigh the benefit. Keep draft until actual matched ACO results demonstrate a useful tradeoff.

Validation and compatibility

Initial audit at baseline 8bf4878/candidate f42945d, six exact cases per arm; initial switch filter selected zero tests. Corrected switch audit selects the parser test. Current synchronized head all three jobs pass. Request representative descriptor-heavy DXIL exports, final GFX11/GFX12 ISA, SGPR/VGPR allocations, spills/scratch, translation cost and physical execution. No hardware/FPS claim.

2026-12-06 — multi-region descriptor pressure control

Exact WARP CI, head 2d2f3eda: eight regions, repeated descriptor/constant-buffer loads and 6 independent offset cases per mode (12 exact cases, including out-of-range controls). Offline compiler audit found identical exported DXIL in both arms; descriptor SPIR-V did not satisfy the single-binding compile harness ABI. Neither actual activation nor AMD SGPR/load/occupancy benefit is established. Do not treat this as a qualifying performance comparison. Keep draft; the next workload must exhibit actual cross-block reuse and carry its correct descriptor ABI.

**@⁠tommiehansen** on GitHub · 2026-12-05 17:04 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/606) `tommiehansen:perf/phase12-descriptor-local-reuse-20261205` → `main` · +307 −6 · 3 files · 7 commits · draft ## Why Cross-block common-subexpression reuse of immutable descriptor and constant-buffer loads can extend scalar value lifetimes. On descriptor-heavy shaders, excessive SGPR pressure may lead to spilling, but recomputing loads also has a cost. ## What changes Experiment with limiting cross-block CSE for these loads while keeping ordinary CSE and default behavior unchanged. Opt-in `VICTORY_SHADER_OPT=575` (default 63 + bit 512). Adapted to the current reusable expression-table optimizer and scratch storage. Independent of #601 and #542's wave-control-flow change. ## Benchmark results No measured register allocation or runtime improvement established. Current scope is exactness and switch coverage. | Current CI at `27544fe` | Result | |---|---| | Optimizer | 16 passed | | Local reuse and switch parser | Passed | | Translated scalar-buffer WARP | Both arms exact | ## Why this should be merged Selective rematerialization could reduce long-lived scalar values in affected shaders, but NIR may reintroduce CSE and extra loads may outweigh the benefit. Keep draft until actual matched ACO results demonstrate a useful tradeoff. ## Validation and compatibility [Initial audit](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47545058993) at baseline 8bf4878/candidate f42945d, six exact cases per arm; initial switch filter selected zero tests. [Corrected switch audit](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47545725427) selects the parser test. [Current synchronized head](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47551301725) all three jobs pass. Request representative descriptor-heavy DXIL exports, final GFX11/GFX12 ISA, SGPR/VGPR allocations, spills/scratch, translation cost and physical execution. No hardware/FPS claim. ### 2026-12-06 — multi-region descriptor pressure control [Exact WARP CI](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47599287372), head `2d2f3eda`: eight regions, repeated descriptor/constant-buffer loads and 6 independent offset cases per mode (12 exact cases, including out-of-range controls). [Offline compiler audit](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47599998626/artifacts/15965864773) found identical exported DXIL in both arms; descriptor SPIR-V did not satisfy the single-binding compile harness ABI. Neither actual activation nor AMD SGPR/load/occupancy benefit is established. Do not treat this as a qualifying performance comparison. Keep draft; the next workload must exhibit actual cross-block reuse and carry its correct descriptor ABI.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 17:07: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/606/head:github-bot/gh-606'
git switch 'github-bot/gh-606'

Merge

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