Shaders: signature rows keep the console's order and one interpolation mode #699

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

@⁠Praisser on GitHub · 2026-11-25 04:54 UTC · original
Praisser:shader-fixes → main · +162 −3 · 3 files · 1 commits · open

Two fixes to the ISG1/OSG1/PSG1 parts that make 142 more of the title's programs pass the DXIL validator.

Measured

victory translate --validate over all 26,148 programs, on main (310c6eb) against this branch, VICTORY_HOST_MAX_WAVE=32:

validated main this branch
vertex and pixel 14,065 14,173
mesh 8,657 8,691
compute 2,722 2,722

Changes

  • Element order. signature() sorted elements by (row, column). The validator rebuilds the parts from the metadata in element order and compares the bytes, so a program that lists elements out of register order (for example TEXCOORD16 before TANGENT0 in row 10) was refused. Elements now keep their order; the only reordering left puts unplaced elements (no row) last.
  • One interpolation mode per row (container::unify_row_modes, called at the start of Shader::finish). The validator refuses a row whose elements have different modes. A row takes the mode of the elements the program reads. When none of them is read, or on an output row that has a constant member, the row is constant. A row whose read elements disagree is left alone.
  • Tests: four unit tests for the above, plus a pixel test for a 16-bit write over an f16 first half (PS_DeferredTextured_c5fd36bb). The first-half change already on main passes that test.

cargo test -p victory-shader: 219 passed, 3 ignored (RTX 3070 Laptop and WARP). Clippy is clean for the crate.

🤖 Generated with Claude Code

**@⁠Praisser** on GitHub · 2026-11-25 04:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/699) `Praisser:shader-fixes` → `main` · +162 −3 · 3 files · 1 commits · open Two fixes to the ISG1/OSG1/PSG1 parts that make 142 more of the title's programs pass the DXIL validator. ## Measured `victory translate --validate` over all 26,148 programs, on main (310c6eb) against this branch, `VICTORY_HOST_MAX_WAVE=32`: | validated | main | this branch | |---|---|---| | vertex and pixel | 14,065 | **14,173** | | mesh | 8,657 | **8,691** | | compute | 2,722 | 2,722 | ## Changes - **Element order.** `signature()` sorted elements by (row, column). The validator rebuilds the parts from the metadata in element order and compares the bytes, so a program that lists elements out of register order (for example TEXCOORD16 before TANGENT0 in row 10) was refused. Elements now keep their order; the only reordering left puts unplaced elements (no row) last. - **One interpolation mode per row** (`container::unify_row_modes`, called at the start of `Shader::finish`). The validator refuses a row whose elements have different modes. A row takes the mode of the elements the program reads. When none of them is read, or on an output row that has a constant member, the row is constant. A row whose read elements disagree is left alone. - Tests: four unit tests for the above, plus a pixel test for a 16-bit write over an f16 first half (PS_DeferredTextured_c5fd36bb). The first-half change already on main passes that test. `cargo test -p victory-shader`: 219 passed, 3 ignored (RTX 3070 Laptop and WARP). Clippy is clean for the crate. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Measured with `victory translate --validate` over all 26,148 programs of
the title, against 310c6eb: vertex and pixel programs validated
14,065 -> 14,173, mesh 8,657 -> 8,691, compute unchanged (2,722).

- Signature parts keep the console's element order instead of sorting
  by register and column: the validator rebuilds the parts from the
  metadata in element order and compares bytes, so a program listing
  TEXCOORD16 before TANGENT0 in one row was refused.
- Elements sharing a row get one interpolation mode (the validator
  refuses a row whose modes differ): the mode of the elements the
  program reads; constant when none is read, or on an output row with
  a constant member.
- A test for a 16-bit write over an f16 first half
  (PS_DeferredTextured_c5fd36bb), which the first-half fix on main
  already passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:12 +00:00
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-25 05:54 UTC · original

Offline check on the retail shader pack: your +142 reproduces exactly here, with nothing lost. It also covers all 22 programs of #722.

Setup: RTX 5090, Windows 11. victory translate --validate --list over the title's full shader pack, main 310c6eb against this head merged onto it, default settings (no VICTORY_HOST_MAX_WAVE). I added a local DXIL hash on each validated line.

main this PR #722
validated 25,382 25,524 25,404
newly validated 142 (39 Vs, 69 Ps, 34 Ms) 22 (Ps)
lost 0 0
DXIL changed among programs validating on both 0 0
  • #722's 22 are a subset of these 142.
  • The 142 are exactly main's signature mismatches (72) and interpolation-mode failures (70), the two classes of #53 and #150. So this PR alone covers what the earlier signature PRs (#189, #124, #112, #110) and #150 fix on this pack.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

**@⁠JRamos1993** on GitHub · 2026-11-25 05:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/699#issuecomment-7154258676) **Offline check on the retail shader pack: your +142 reproduces exactly here, with nothing lost. It also covers all 22 programs of #722.** **Setup:** RTX 5090, Windows 11. `victory translate --validate --list` over the title's full shader pack, `main` `310c6eb` against this head merged onto it, default settings (no `VICTORY_HOST_MAX_WAVE`). I added a local DXIL hash on each validated line. | | `main` | this PR | #722 | |---|---|---|---| | validated | 25,382 | **25,524** | 25,404 | | newly validated | | 142 (39 Vs, 69 Ps, 34 Ms) | 22 (Ps) | | lost | | 0 | 0 | | DXIL changed among programs validating on both | | 0 | 0 | - **#722's 22 are a subset of these 142.** - **The 142 are exactly `main`'s signature mismatches (72) and interpolation-mode failures (70)**, the two classes of #53 and #150. So this PR alone covers what the earlier signature PRs (#189, #124, #112, #110) and #150 fix on this pack. AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/699/head:github-bot/gh-699'
git switch 'github-bot/gh-699'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-699'
git switch 'github-bot/gh-699'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-699'
git switch 'github-bot/gh-699'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-699'
git switch 'main'
git merge --squash 'github-bot/gh-699'
git switch 'main'
git merge --ff-only 'github-bot/gh-699'
git switch 'main'
git merge 'github-bot/gh-699'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.