ir::build: no unspill work without parked lanes; no Vec per VALU name #268

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

@⁠amine23012004 on GitHub · 2026-11-26 13:56 UTC · original
amine23012004:perf/ir-build-less-work → main · +17 −3 · 2 files · 1 commits · open

ir::build: no unspill work without parked lanes; no Vec per VALU name

What.

  • unspill decoded every instruction's fields and effects before finding out that nothing was parked. Without a v_writelane_b32 or v_readlane_b32, every park is None, and it returns an empty list without having touched list. It now checks that up front. Programs that do park lanes take the same path as before.
  • valu_dwords, which runs for every VALU instruction, collected the opcode name's _ parts into a Vec only to read up to four of them. It now reads them without allocating, with the same results (including the empty-name case).

Same output. IR and DXIL are identical before/after on the synthetic programs below (DXIL compared byte for byte).

Measured (Linux, release, best of 25, ir::build only; synthetic pixel programs with no parked lanes):

instructions main this PR
1,205 3.9-4.2 ms 3.1-3.4 ms
4,805 15.4-16.7 ms 12.4-12.7 ms

These are synthetic programs, not the title's shaders: programs that spill to lanes don't get the unspill part of the gain, and I have not measured victory shaders on a real dump.

Checks. cargo test -p victory-shader (209 passed), cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings clean.

🤖 Generated with Claude Code

**@⁠amine23012004** on GitHub · 2026-11-26 13:56 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/268) `amine23012004:perf/ir-build-less-work` → `main` · +17 −3 · 2 files · 1 commits · open ## ir::build: no unspill work without parked lanes; no Vec per VALU name **What.** - `unspill` decoded every instruction's fields and effects before finding out that nothing was parked. Without a `v_writelane_b32` or `v_readlane_b32`, every park is `None`, and it returns an empty list without having touched `list`. It now checks that up front. Programs that do park lanes take the same path as before. - `valu_dwords`, which runs for every VALU instruction, collected the opcode name's `_` parts into a `Vec` only to read up to four of them. It now reads them without allocating, with the same results (including the empty-name case). **Same output.** IR and DXIL are identical before/after on the synthetic programs below (DXIL compared byte for byte). **Measured** (Linux, release, best of 25, `ir::build` only; synthetic pixel programs with no parked lanes): | instructions | main | this PR | |---:|---:|---:| | 1,205 | 3.9-4.2 ms | 3.1-3.4 ms | | 4,805 | 15.4-16.7 ms | 12.4-12.7 ms | These are synthetic programs, not the title's shaders: programs that spill to lanes don't get the `unspill` part of the gain, and I have not measured `victory shaders` on a real dump. **Checks.** `cargo test -p victory-shader` (209 passed), `cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`unspill` decoded every instruction's fields and effects before finding
that nothing was parked; without a `v_writelane_b32` or `v_readlane_b32`
every park is `None` and it returns nothing, having changed nothing, so it
now says so up front. `valu_dwords`, run for every VALU instruction,
collected the opcode name's `_` parts into a Vec only to look at a few.

Same IR and DXIL; `ir::build` of a synthetic 4,805-instruction pixel
program: 15.4-16.7 ms -> 12.5 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:00:49 +00:00
Author
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 14:16 UTC · original · approved these changes

Checked against main: without writelane/readlane every park is None, so unspill already returned an empty Vec without touching list. The early return gives the same result. rsplit('_').next() equals the old parts.last(), the empty name included. Same output, less work.

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 14:16 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/268#pullrequestreview-6075636653) · **approved these changes** Checked against main: without writelane/readlane every park is None, so unspill already returned an empty Vec without touching list. The early return gives the same result. rsplit('_').next() equals the old parts.last(), the empty name included. Same output, less work.
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/268/head:github-bot/gh-268'
git switch 'github-bot/gh-268'

Merge

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