Shaders: read programs in a VPCS part (VPP1): 644 of 869 programs that had no DXIL part translate #3458

Closed
github-bot wants to merge 1 commit from github-bot/gh-3458 into main AGit
Owner

@⁠OGShotz on GitHub · 2026-11-29 23:31 UTC · original
OGShotz:pr-shader-vpp1 → main · +982 −24 · 9 files · 1 commits · closed without merging

What it changes

869 of the title's shader containers carry their native program in a VPCS part, whose payload starts with VPP1, instead of DXIL or ACCC: 272 vertex and 597 pixel programs. translate_plain failed each one with malformed shader: no DXIL part, and every draw using it was dropped. A preload run met 69 different vertex programs of this kind.

The payload holds raw (uncompressed) GFX10 code ending in s_endpgm, with a header and metadata around it. This adds a reader for it (crates/victory-shader/src/vpp1.rs):

  • The header: stage, VGPRs, PS input address, DB_SHADER_CONTROL, colour formats; the vertex element and PS input tables; the code; and the loose metadata v2, which gives the root layout.
  • Vertex programs fetch their own vertices from the descriptor table at s[0:1]. Each fetch becomes moves from input VGPRs placed past the program's own, with the code laid out again and branch offsets moved.
  • native::container_programs picks DXIL, ACCC or VPCS; translate_plain, the GPU pipeline and the CLI use it.
  • lower: compressed (fp16 pair) colour exports are widened to 32-bit floats, a 32-bit export to a 16-bit SV_Target is taken as is, and POS_FIXED_PT is formed from SV_Position.

The other 225 hit gaps elsewhere in the translator, mostly one sampler-table pattern, and still fail as before, with their own error instead of "no DXIL part".

How it was tested

  • GPU and profile: RTX 2070 8 GB + Ryzen 7 3700X, Windows 11, Series S, DLSS Balanced, no frame generation, no ray tracing.
  • Before: offline over the 869 VPCS containers of the local pipeline book (victory translate --validate): 0 translated.
  • After: 644 emitted and passed dxil.dll validation. In a preload with this change, "no DXIL part" no longer appears (it had 69 distinct vertex programs before); 4 pixel programs fail with "an address from a root parameter that is no address".
  • Played: 20 minutes in free roam on a build of ours with this change and others (the 29.11.02 hotfix, #2910, #2777, #2853), no crash; the player saw the scene render faster and more completely than before. Then 19 minutes on a later build that still carries it (main 41adb551 plus further PRs): no crash, 12.1 fps on average and never under 6 fps at about 6,400 draws a frame, on this CPU-limited PC. Both builds carry other changes too, so this is not a picture or speed comparison of this change alone.
  • For shader changes, the wave sizes tested: the host's 32-lane waves (NVIDIA).
  • cargo test passed for the crates it touches: on this branch (main 716a0c99 + this commit), victory-shader 470 passed, victory (CLI) 79 + 3 passed, victory-gpu 913 passed with the same 2 failures as main without this change (every_switch_of_the_translator_is_in_the_key, see #3210; places_written_after_sending_are_learned, which passes alone). The new tests build their inputs from synthetic bytes, no game data.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #154 lists "malformed shader: no DXIL part" among its preload errors; I found no open pull request that reads VPCS or VPP1.

🤖 Generated with Claude Code

**@⁠OGShotz** on GitHub · 2026-11-29 23:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3458) `OGShotz:pr-shader-vpp1` → `main` · +982 −24 · 9 files · 1 commits · closed without merging ## What it changes 869 of the title's shader containers carry their native program in a `VPCS` part, whose payload starts with `VPP1`, instead of `DXIL` or `ACCC`: 272 vertex and 597 pixel programs. `translate_plain` failed each one with `malformed shader: no DXIL part`, and every draw using it was dropped. A preload run met 69 different vertex programs of this kind. The payload holds raw (uncompressed) GFX10 code ending in `s_endpgm`, with a header and metadata around it. This adds a reader for it (`crates/victory-shader/src/vpp1.rs`): - The header: stage, VGPRs, PS input address, `DB_SHADER_CONTROL`, colour formats; the vertex element and PS input tables; the code; and the loose metadata v2, which gives the root layout. - Vertex programs fetch their own vertices from the descriptor table at `s[0:1]`. Each fetch becomes moves from input VGPRs placed past the program's own, with the code laid out again and branch offsets moved. - `native::container_programs` picks `DXIL`, `ACCC` or `VPCS`; `translate_plain`, the GPU pipeline and the CLI use it. - `lower`: compressed (fp16 pair) colour exports are widened to 32-bit floats, a 32-bit export to a 16-bit `SV_Target` is taken as is, and `POS_FIXED_PT` is formed from `SV_Position`. The other 225 hit gaps elsewhere in the translator, mostly one sampler-table pattern, and still fail as before, with their own error instead of "no DXIL part". ## How it was tested - GPU and profile: RTX 2070 8 GB + Ryzen 7 3700X, Windows 11, Series S, DLSS Balanced, no frame generation, no ray tracing. - Before: offline over the 869 `VPCS` containers of the local pipeline book (`victory translate --validate`): 0 translated. - After: 644 emitted and passed `dxil.dll` validation. In a preload with this change, "no DXIL part" no longer appears (it had 69 distinct vertex programs before); 4 pixel programs fail with "an address from a root parameter that is no address". - Played: 20 minutes in free roam on a build of ours with this change and others (the 29.11.02 hotfix, #2910, #2777, #2853), no crash; the player saw the scene render faster and more completely than before. Then 19 minutes on a later build that still carries it (main 41adb551 plus further PRs): no crash, 12.1 fps on average and never under 6 fps at about 6,400 draws a frame, on this CPU-limited PC. Both builds carry other changes too, so this is not a picture or speed comparison of this change alone. - For shader changes, the wave sizes tested: the host's 32-lane waves (NVIDIA). - `cargo test` passed for the crates it touches: on this branch (main 716a0c99 + this commit), `victory-shader` 470 passed, `victory` (CLI) 79 + 3 passed, `victory-gpu` 913 passed with the same 2 failures as main without this change (`every_switch_of_the_translator_is_in_the_key`, see #3210; `places_written_after_sending_are_learned`, which passes alone). The new tests build their inputs from synthetic bytes, no game data. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #154 lists "malformed shader: no DXIL part" among its preload errors; I found no open pull request that reads `VPCS` or `VPP1`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
869 containers of the title carry their native program in a VPCS part
(payload VPP1) instead of DXIL/ACCC: 272 vertex and 597 pixel programs.
Each failed with "no DXIL part" and every draw using one was dropped.

- vpp1.rs: the header (stage, VGPRs, PS input address, DB_SHADER_CONTROL,
  colour formats), the vertex element / PS input tables, the code and the
  loose metadata v2 that gives the root layout. Vertex programs fetch their
  own vertices from the descriptor table at s[0:1]; each fetch becomes moves
  from input VGPRs placed past the program's own, with the code laid out
  again and branch offsets moved.
- native::container_programs picks DXIL, ACCC or VPCS; translate_plain,
  the GPU pipeline and the CLI use it.
- lower: compressed (fp16 pair) colour exports are widened to 32-bit floats;
  a 32-bit export to a 16-bit SV_Target is taken as is; POS_FIXED_PT is
  formed from SV_Position.

Offline over the book's 869 VPCS containers (translate --validate):
0 translated before, 644 emitted and validated after.

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

@⁠nick0451 on GitHub · 2026-11-30 01:51 UTC · original

Exact translation check, with no game run: the title's shaders (game folder: 26,599 containers, 26,180 programs, 25,789 with emitted DXIL hashes), victory translate --list with VICTORY_HOST_WAVE=32, main 41adb551 (v2026.11.29.05) against this PR merged onto it, plus this PC's local shader book (cache/pipelines/known-shaders.bin, 19,121 containers).

Result: no change here. Neither set has a container with a VPCS part. On main, every program in both sets already translates, and none fails with "no DXIL part". With this PR all output hashes are identical. So I couldn't check the new reader against this dump. The 869 VPCS containers may come from a different build of the title than the one here. If you can say which title version or package yours is, I'll compare.

🤖 Generated with Claude Code

**@⁠nick0451** on GitHub · 2026-11-30 01:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3458#issuecomment-7266495928) Exact translation check, with no game run: the title's shaders (game folder: 26,599 containers, 26,180 programs, 25,789 with emitted DXIL hashes), `victory translate --list` with `VICTORY_HOST_WAVE=32`, main `41adb551` (v2026.11.29.05) against this PR merged onto it, plus this PC's local shader book (`cache/pipelines/known-shaders.bin`, 19,121 containers). **Result: no change here.** Neither set has a container with a `VPCS` part. On main, every program in both sets already translates, and none fails with "no DXIL part". With this PR all output hashes are identical. So I couldn't check the new reader against this dump. The 869 `VPCS` containers may come from a different build of the title than the one here. If you can say which title version or package yours is, I'll compare. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠OGShotz on GitHub · 2026-11-30 03:35 UTC · original

Thanks for checking. Ours is title version 1.0.2.1.

The 869 VPCS containers come from this PC's pipeline book (cache/pipelines/known-shaders.bin), recorded by play on that version: 272 vertex and 597 pixel programs, each one a DXBC container with only VPCS, ISG1 and OSG1 parts. Before this change, a preload here logged "malformed shader: no DXIL part" for 69 distinct vertex programs. Since your dump has none, the VPCS layout may only be in some builds or packages of the title. Where there is none, the change is inert, as your identical hashes show.

🤖 Generated with Claude Code

**@⁠OGShotz** on GitHub · 2026-11-30 03:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3458#issuecomment-7268022557) Thanks for checking. Ours is title version 1.0.2.1. The 869 VPCS containers come from this PC's pipeline book (`cache/pipelines/known-shaders.bin`), recorded by play on that version: 272 vertex and 597 pixel programs, each one a DXBC container with only `VPCS`, `ISG1` and `OSG1` parts. Before this change, a preload here logged "malformed shader: no DXIL part" for 69 distinct vertex programs. Since your dump has none, the VPCS layout may only be in some builds or packages of the title. Where there is none, the change is inert, as your identical hashes show. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠nick0451 on GitHub · 2026-11-30 15:25 UTC · original

Thanks. Ours is the same title version, 1.0.2.1 (appxmanifest), so the version isn't the difference.

Our pipeline book (19,121 containers) was recorded only in the places we test: the balcony, the city street, the boat, two interiors, and a few cutscenes. A preload here has never logged "no DXIL part". So the VPCS programs are more likely tied to content we haven't visited than to the build. If you know a mission or area where those 69 vertex programs show up, I can go there and check that the new reader translates them here too.

🤖 Generated with Claude Code

**@⁠nick0451** on GitHub · 2026-11-30 15:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3458#issuecomment-7282971032) Thanks. Ours is the same title version, 1.0.2.1 (appxmanifest), so the version isn't the difference. Our pipeline book (19,121 containers) was recorded only in the places we test: the balcony, the city street, the boat, two interiors, and a few cutscenes. A preload here has never logged "no DXIL part". So the VPCS programs are more likely tied to content we haven't visited than to the build. If you know a mission or area where those 69 vertex programs show up, I can go there and check that the new reader translates them here too. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot closed this pull request 2026-12-01 18:58:37 +00:00

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/trustno1-coder--VIctory-NVIDIA!3458
No description provided.