GPU: reuse decoded shader instructions for write classification #2935

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

@⁠ghptc on GitHub · 2026-11-29 18:54 UTC · original
ghptc:perf/reuse-decoded-shader-write-classification → main · +50 −59 · 1 files · 1 commits · open

What it changes

Follow-up to #1096. That PR gives buffer and raw-address stores one GFX10 decode. In pipeline::translate, programs without buffer stores still go through a second decode when writes checks for image stores and atomics. This happens when the host shader is retrieved from cache as well.

Reuse the decoded instructions to produce stores, stores_by_address and writes. Preserve the existing rules for scratch stores, indirect control flow, absent native programs, and unknown or undecodable instructions. The PR adds nine generated instruction sequences covering the flag distinctions.

Validation

The shader team compared the baseline and candidate using 24 generated read-only compute programs through the project’s parser and DXIL emitter. All three flags and the complete serialized VSH1 payload (DXIL and metadata) matched byte for byte. The classifier control additionally covered image, buffer, global and scratch writes, indirect flow, undecodable input and multiple-program aggregation.

CPU case Before per 24 After per 24
Read and decode a fixture VSH1 cache payload 7.4475 ms 3.7313 ms
Emit DXIL 12.8458 ms 9.1763 ms

These are medians over 11 paired batches with alternating order and two warm-ups. The controls used generated input and covered CPU preparation. Real cache key lookup, host PSO creation, GPU execution and in-game frame time were outside the measurement. The full Windows crate was outside this validation. This PR contains source and synthesized unit test cases.

Based on f889bb076fa884fff8d2b6f0b50ac86f72abfd98. Cherry-picked unchanged from 6bd9a7f01bc4bb74b0b1b3f6ab22060f3bc26f6c with original authorship.

**@⁠ghptc** on GitHub · 2026-11-29 18:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2935) `ghptc:perf/reuse-decoded-shader-write-classification` → `main` · +50 −59 · 1 files · 1 commits · open ## What it changes Follow-up to #1096. That PR gives buffer and raw-address stores one GFX10 decode. In `pipeline::translate`, programs without buffer stores still go through a second decode when `writes` checks for image stores and atomics. This happens when the host shader is retrieved from cache as well. Reuse the decoded instructions to produce `stores`, `stores_by_address` and `writes`. Preserve the existing rules for scratch stores, indirect control flow, absent native programs, and unknown or undecodable instructions. The PR adds nine generated instruction sequences covering the flag distinctions. ## Validation The shader team compared the baseline and candidate using 24 generated read-only compute programs through the project’s parser and DXIL emitter. All three flags and the complete serialized VSH1 payload (DXIL and metadata) matched byte for byte. The classifier control additionally covered image, buffer, global and scratch writes, indirect flow, undecodable input and multiple-program aggregation. | CPU case | Before per 24 | After per 24 | | --- | ---: | ---: | | Read and decode a fixture VSH1 cache payload | 7.4475 ms | 3.7313 ms | | Emit DXIL | 12.8458 ms | 9.1763 ms | These are medians over 11 paired batches with alternating order and two warm-ups. The controls used generated input and covered CPU preparation. Real cache key lookup, host PSO creation, GPU execution and in-game frame time were outside the measurement. The full Windows crate was outside this validation. This PR contains source and synthesized unit test cases. Based on `f889bb076fa884fff8d2b6f0b50ac86f72abfd98`. Cherry-picked unchanged from `6bd9a7f01bc4bb74b0b1b3f6ab22060f3bc26f6c` with original authorship.
(cherry picked from commit 6bd9a7f01bc4bb74b0b1b3f6ab22060f3bc26f6c)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:56:54 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2935'
git switch 'github-bot/gh-2935'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2935'
git switch 'github-bot/gh-2935'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2935'
git switch 'main'
git merge --squash 'github-bot/gh-2935'
git switch 'main'
git merge --ff-only 'github-bot/gh-2935'
git switch 'main'
git merge 'github-bot/gh-2935'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2935
No description provided.