GPU: cache shader resource metadata with DXIL #1931

Closed
github-bot wants to merge 3 commits from gh-pr/1931/head into gh-pr/1931/base
Owner

@⁠nicolasveilleux on GitHub · 2026-11-25 01:09 UTC · original
nicolasveilleux:upstream/shader-resource-cache → main · +147 −60 · 4 files · 3 commits · closed without merging

Store the native program’s resource ranges alongside its translated DXIL so pipeline creation no longer parses the original container on cache hits. The tests cover round-trips, invalid entries and resource metadata on a synthetic shader.

Validation: all 3 shader-cache tests passed on Windows 11. The RTX 2070 Super integration branch also passed 478 workspace tests (0 failed, 7 ignored). No game files or gameplay measurements. Claimed in #1633.

**@⁠nicolasveilleux** on GitHub · 2026-11-25 01:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1931) `nicolasveilleux:upstream/shader-resource-cache` → `main` · +147 −60 · 4 files · 3 commits · closed without merging Store the native program’s resource ranges alongside its translated DXIL so pipeline creation no longer parses the original container on cache hits. The tests cover round-trips, invalid entries and resource metadata on a synthetic shader. Validation: all 3 shader-cache tests passed on Windows 11. The RTX 2070 Super integration branch also passed 478 workspace tests (0 failed, 7 ignored). No game files or gameplay measurements. Claimed in #1633.
Return the selected native program resource ranges with its DXIL and read both from the versioned cache entry. Avoid parsing and unpacking the original container again in pipeline creation. Cover round-trips, damaged and old entries, and resource extraction on a synthetic ACCC program.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:49:10 +00:00
github-bot closed this pull request 2026-11-26 04:49:10 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 02:18 UTC · original · edited 2026-11-25 03:24 UTC

Automated triage for the maintainers.

Merge candidate. On a cache hit, pipeline creation no longer re-parses the console container for its resource ranges. translate_with_resources returns native.used from the same program translate_with picks (the first Vs/Ps/Cs/Ms in the DXIL or ACCC part), which is what pipeline.rs::with_resources used to find. The cache entry format moves to VSH2, and the key already hashes shader_cache.rs, so old entries become misses. decode rejects bad kinds, root codes, reserved bytes and counts, and the new tests cover the round trip, damaged entries and the resource metadata of a synthetic shader. A minor point: the doc comment on translate_with and the pointer to crate::shadow::copy_back_marks were reworded or dropped without need; restoring them would be nice. This PR edits host_shader's options next to #1563, so whichever merges second needs a small rebase. CI (check) passes.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 02:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1931#issuecomment-7150560778) · edited 2026-11-25 03:24 UTC <!-- victory-triage v1 head=3845de8e6afa2f1fe49faa673884dfb8f7d625d5 verdict=merge-candidate at=2026-11-25T03:24:10Z --> Automated triage for the maintainers. **Merge candidate.** On a cache hit, pipeline creation no longer re-parses the console container for its resource ranges. `translate_with_resources` returns `native.used` from the same program `translate_with` picks (the first Vs/Ps/Cs/Ms in the DXIL or ACCC part), which is what `pipeline.rs::with_resources` used to find. The cache entry format moves to `VSH2`, and the key already hashes `shader_cache.rs`, so old entries become misses. `decode` rejects bad kinds, root codes, reserved bytes and counts, and the new tests cover the round trip, damaged entries and the resource metadata of a synthetic shader. A minor point: the doc comment on `translate_with` and the pointer to `crate::shadow::copy_back_marks` were reworded or dropped without need; restoring them would be nice. This PR edits `host_shader`'s options next to #1563, so whichever merges second needs a small rebase. CI (`check`) passes. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:10 UTC · original

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 3845de8. cargo test --workspace --locked --no-fail-fast -> 696 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/1931#issuecomment-7157975078) **Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24.** Branch at `3845de8`. `cargo test --workspace --locked --no-fail-fast` -> 696 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-25 11:24 UTC · original

Offline measurement on a retail dump

Result: no count change against main.

I merged head 3845de8e onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-25 11:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/1931#issuecomment-7161000765) ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 3845de8e onto `main` 940d32f (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 23,918 on `main`, 23,918 with this PR. No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:04 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because it buys nothing measurable and has a cost. In a title run the 2,787 shader-cache hits took 0 ms in 2,543 cases and 1 ms in 229, once per shader per process, on the pipeline workers; the PR offers no measurement. Against that it changes the cache format and the shader crate's public API, both of which invalidate every user's shader cache and pre-built pipeline list, and it collides with #2055.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 22:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1931#issuecomment-7175899942) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because it buys nothing measurable and has a cost. In a title run the 2,787 shader-cache hits took 0 ms in 2,543 cases and 1 ms in 229, once per shader per process, on the pipeline workers; the PR offers no measurement. Against that it changes the cache format and the shader crate's public API, both of which invalidate every user's shader cache and pre-built pipeline list, and it collides with #2055. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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!1931
No description provided.