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

Open
amine23012004 wants to merge 1 commit from upstream-pr/268 into main
amine23012004 commented 2026-11-26 13:56:39 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by amine23012004 on 2026-11-26T13:56:39Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6628195135 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/268). Originally posted by [amine23012004](https://github.com/amine23012004) on 2026-11-26T13:56:39Z. --- ## 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)
lerapeurdu62280-debug commented 2026-11-26 14:16:06 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by lerapeurdu62280-debug on 2026-11-26T14:16:06Z.


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.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:review:6075636653 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/268#pullrequestreview-6075636653). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-11-26T14:16:06Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/268:upstream-pr/268'
git switch 'upstream-pr/268'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/268'
git switch 'upstream-pr/268'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/268'
git switch 'upstream-pr/268'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/268'
git switch 'main'
git merge --squash 'upstream-pr/268'
git switch 'main'
git merge --ff-only 'upstream-pr/268'
git switch 'main'
git merge 'upstream-pr/268'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!268
No description provided.