GPU: use one warm-up key for reordered graphics shader stages #2986

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:19 UTC · original
andrewpozdnakov7-jpg:codex1/graphics-stream-stage-order-key → main · +50 −0 · 1 files · 1 commits · open

The graphics pre-build writes the vertex or mesh shader before the pixel shader. A guest stream can describe the same pipeline with those two subobjects reversed. The host already uses the same stage order to build the pipeline, but the warm-up key came from the stream order. This can miss the prebuilt entry and split usage across two early keys.

Normalize the two supported graphics stages when reading the stream. Pre-build and guest creation then name that pipeline the same way.

On main 63bcca43c6a00a758510398fa43096ce7e4f7df0, the synthetic Prebuild::graphics and guest CreatePipelineState test found a different key for each reversed vertex/pixel and mesh/pixel pair. Both orders agree after this change. A different pixel shader still changes the key. Six paired runs. Full Windows/WARP GPU diagnostics passed (247 passed, 1 ignored), along with strict GPU Clippy in both feature configurations and asset policy.

AI-assisted.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 02:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2986) `andrewpozdnakov7-jpg:codex1/graphics-stream-stage-order-key` → `main` · +50 −0 · 1 files · 1 commits · open The graphics pre-build writes the vertex or mesh shader before the pixel shader. A guest stream can describe the same pipeline with those two subobjects reversed. The host already uses the same stage order to build the pipeline, but the warm-up key came from the stream order. This can miss the prebuilt entry and split usage across two early keys. Normalize the two supported graphics stages when reading the stream. Pre-build and guest creation then name that pipeline the same way. On main `63bcca43c6a00a758510398fa43096ce7e4f7df0`, the synthetic `Prebuild::graphics` and guest `CreatePipelineState` test found a different key for each reversed vertex/pixel and mesh/pixel pair. Both orders agree after this change. A different pixel shader still changes the key. Six paired runs. Full Windows/WARP GPU diagnostics passed (247 passed, 1 ignored), along with strict GPU Clippy in both feature configurations and asset policy. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:19:24 +00:00
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 02:45 UTC · original

Verified across process restarts with a real D3D12 pipeline library on an RTX 5080 and Microsoft WARP, with #2952 (2cdb5e3) present in both builds. I prebuilt canonical VS+PS and MS+PS streams, exercised them once through guest creation / first use, saved the cache, then reopened it in a fresh process. The table shows the four guest creations per adapter (both stream orders for each stage pair).

Build Recognized as prebuilt Started early at creation Loaded from the host library Newly compiled
Before stage normalization 2/4 2/4 4/4 0
With 7ce9941 4/4 4/4 4/4 0

The old reversed streams could already load the canonical host PSO on first use. The change lets those streams also find the guest prebuild and prior-use records at creation. Both adapters showed the same counts.

The color-only PSOs stayed distinct from two D32_FLOAT variants: omitted depth state (enabled by the DSV) and explicitly disabled depth at the same DSV format. For both VS+PS and MS+PS, each new variant compiled once, then its opposite stage order loaded it. That gave four distinct PSO creations and four loads per adapter.

I also carried an old cache whose early list had only reversed-order uses into the updated build. On the first updated run, both streams found their prebuilt entries and loaded their PSOs at first use. On the next process start, both started early too. This was a synthetic stream/cache test using SDK-compiled shaders seeded at the translation boundary, guest CreatePipelineState, and the production prebuild, worker and library paths.

**@⁠steven-seagull27** on GitHub · 2026-11-26 02:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/2986#issuecomment-7181091737) Verified across process restarts with a real D3D12 pipeline library on an RTX 5080 and Microsoft WARP, with #2952 (`2cdb5e3`) present in both builds. I prebuilt canonical VS+PS and MS+PS streams, exercised them once through guest creation / first use, saved the cache, then reopened it in a fresh process. The table shows the four guest creations per adapter (both stream orders for each stage pair). | Build | Recognized as prebuilt | Started early at creation | Loaded from the host library | Newly compiled | |---|---:|---:|---:|---:| | Before stage normalization | 2/4 | 2/4 | 4/4 | 0 | | With `7ce9941` | 4/4 | 4/4 | 4/4 | 0 | The old reversed streams could already load the canonical **host** PSO on first use. The change lets those streams also find the **guest** prebuild and prior-use records at creation. Both adapters showed the same counts. The color-only PSOs stayed distinct from two D32_FLOAT variants: omitted depth state (enabled by the DSV) and explicitly disabled depth at the same DSV format. For both VS+PS and MS+PS, each new variant compiled once, then its opposite stage order loaded it. That gave four distinct PSO creations and four loads per adapter. I also carried an old cache whose early list had **only reversed-order uses** into the updated build. On the first updated run, both streams found their prebuilt entries and loaded their PSOs at first use. On the next process start, both started early too. This was a synthetic stream/cache test using SDK-compiled shaders seeded at the translation boundary, guest `CreatePipelineState`, and the production prebuild, worker and library paths.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:37 UTC · original

Automated triage for the maintainers.

Needs work. The change in read_stream (victory-gpu/src/pipeline.rs) swaps a two-shader stream that lists the pixel shader before the vertex or mesh shader, so the guest pipeline's warm-up key matches the pre-build's. The code is small and the test shows the keys now agree. A commenter confirms the effect on a synthetic cache.

What is missing is evidence that the title ever produces such a stream. All the tests here are synthetic; if the title always writes the producer stage first, this changes nothing at run time. Please add a log line or count from a real run showing pixel-first streams (stage order and count only, no game data). If they do occur, consider normalizing by stage rank instead of special-casing a two-element [pixel, vertex|mesh] slice, so amplification + mesh + pixel streams are covered too.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2986#issuecomment-7183649829) <!-- victory-triage v1 head=7ce9941a381581f38c06112faefa13cdd301c58f verdict=needs-work at=2026-11-26T05:36:54Z --> Automated triage for the maintainers. **Needs work.** The change in `read_stream` (`victory-gpu/src/pipeline.rs`) swaps a two-shader stream that lists the pixel shader before the vertex or mesh shader, so the guest pipeline's warm-up key matches the pre-build's. The code is small and the test shows the keys now agree. A commenter confirms the effect on a synthetic cache. What is missing is evidence that the title ever produces such a stream. All the tests here are synthetic; if the title always writes the producer stage first, this changes nothing at run time. Please add a log line or count from a real run showing pixel-first streams (stage order and count only, no game data). If they do occur, consider normalizing by stage rank instead of special-casing a two-element `[pixel, vertex|mesh]` slice, so amplification + mesh + pixel streams are covered too. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
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/2986/head:github-bot/gh-2986'
git switch 'github-bot/gh-2986'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2986'
git switch 'github-bot/gh-2986'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2986'
git switch 'github-bot/gh-2986'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2986'
git switch 'main'
git merge --squash 'github-bot/gh-2986'
git switch 'main'
git merge --ff-only 'github-bot/gh-2986'
git switch 'main'
git merge 'github-bot/gh-2986'
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/Marvisak--VIctory!2986
No description provided.