[BUNDLE] High-yield shader PRs (+295/+520/+153/+117 programs in #1247): #1067 #305 #306 #176, stacked on #1319 #1402

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

@⁠MamaLeVrai on GitHub · 2026-11-24 17:46 UTC · original
MamaLeVrai:bundle/shader-high-yield → main · +1867 −160 · 10 files · 35 commits · closed without merging

One PR in place of 4. The four open shader PRs that gain the most programs in #1247's offline benchmark on a retail dump (295, 520, 153 and 117 programs; none loses one), merged on top of the bundle #1319 (a descriptor read only as data, 64-bit image atomics, biased image samples with 16-bit coordinates, packed 16-bit pixel inputs). Every head is merged unchanged onto main plus #1319, and the result is built and tested together.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. The re-verification commands are below, so one run covers all of it.

What is inside

PR Author Head Title
#1067 undeadhuman37 6d30fd71c Shaders: a descriptor only read as data takes its kind from its table (+295 programs in #1247)
#305 tarcisioads 78dae8362 Shaders: lower 64-bit image atomics (+520 programs in #1247)
#306 wbkepler e3067aeaa Shader: fix biased 16-bit image samples and DXIL validator failures (+153 programs in #1247)
#176 Yaekai 70278092a Shaders: pair packed fp16 pixel inputs with unlisted signature rows (+117 programs in #1247)

Changes made while bundling

No PR needed a change of its own; four merges needed a hand resolution against the PRs of #1319. Each commit of the bundle is a plain merge of one PR head, with the resolution inside it.

  1. #1067: it restructures descriptor_data (the use-site match moved into a Some((at, first)) branch). #953 (in #1319) adds an s_buffer_load arm to the old match. Resolution: the same arm, unchanged, inside the new match.
  2. #305: both it and #1004 (in #1319) add a test at the end of emit/lower.rs. Both tests are kept.
  3. #306: it reads gradients and the level clamp through its new addr_dword / addr_val(at, k) helpers (a16 packs two components per VGPR); #563 (in #1319) adds cube gradients on the face coordinates (graded) and a _cl clamp read after the coordinates. Resolution: the cube gradient loop runs over graded with addr_dword (gradients are one 32-bit dword each even with a16, as #306's comment says), and the clamp is addr_val(self, at, coords), the same dword as before without a16. There is no test of a16 together with cube gradients; that combination is the part of this resolution to look at.
  4. #176: both it and the bundle add tests at the end of emit/lower.rs. Both are kept.
  5. #306 at its new head (e3067ae, a commit by wrothgaril at 20:36 UTC on Nov 24): two of #306's tests, compute_shader_implicit_sample_uses_valver_1_8_and_validates and row_interp_harmonizes_packed_elements_and_validates, failed with the stock Windows SDK's dxil.dll, which is validator 1.7 (found by alexdeliu on an RX 9070, see #1495). The new head of #306 handles it itself: a Validator::version() query with a skip below validator 1.8, and PSV0 semantic names written per element (its commit message: "write PSV0 semantic names per element; skip valver 1.8 check on old validators"). I have no 1.7 dxil.dll here to confirm it on the stock SDK. An earlier version of this bundle had a commit of mine that did the same thing; it is reverted in the history, just before the merge of the new head, so nothing is duplicated.

Left out, and why

  • #539: gains the same 520 programs as #305 (#1247). One of the two is enough; #305 is the older.
  • #592, #621: gain the same 117 programs as #176 (#1247).
  • #996: gains 52 programs, 36 of them shared with #306, and implements the same a16 biased sample; it conflicts with #306 here.
  • #298: overlaps #1074 (in #1319) on 23 of its 29 programs and conflicts with it.
  • #585: gains 25 programs, a superset of #1084's two (in #1319), and conflicts with it.
  • #453: gains 182 programs but adds six validator errors (#1247).

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 359 passed, 0 failed, 6 ignored (main: 342 passed, 6 ignored)

The title was not run, so this says nothing about in-game effect. No game data is used or committed.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/shader-high-yield
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

To confirm that no component PR moved since this was built, compare each Head above with gh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.

If this lands

The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-24 17:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402) `MamaLeVrai:bundle/shader-high-yield` → `main` · +1867 −160 · 10 files · 35 commits · closed without merging **One PR in place of 4.** The four open shader PRs that gain the most programs in #1247's offline benchmark on a retail dump (295, 520, 153 and 117 programs; none loses one), merged on top of the bundle #1319 (a descriptor read only as data, 64-bit image atomics, biased image samples with 16-bit coordinates, packed 16-bit pixel inputs). Every head is merged unchanged onto `main` plus #1319, and the result is built and tested together. > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a `[BUNDLE]` PR. The re-verification commands are below, so one run covers all of it. ## What is inside | PR | Author | Head | Title | |---|---|---|---| | #1067 | undeadhuman37 | `6d30fd71c` | Shaders: a descriptor only read as data takes its kind from its table (+295 programs in #1247) | | #305 | tarcisioads | `78dae8362` | Shaders: lower 64-bit image atomics (+520 programs in #1247) | | #306 | wbkepler | `e3067aeaa` | Shader: fix biased 16-bit image samples and DXIL validator failures (+153 programs in #1247) | | #176 | Yaekai | `70278092a` | Shaders: pair packed fp16 pixel inputs with unlisted signature rows (+117 programs in #1247) | ## Changes made while bundling No PR needed a change of its own; four merges needed a hand resolution against the PRs of #1319. Each commit of the bundle is a plain merge of one PR head, with the resolution inside it. 1. **#1067**: it restructures `descriptor_data` (the use-site match moved into a `Some((at, first))` branch). #953 (in #1319) adds an `s_buffer_load` arm to the old match. Resolution: the same arm, unchanged, inside the new match. 2. **#305**: both it and #1004 (in #1319) add a test at the end of `emit/lower.rs`. Both tests are kept. 3. **#306**: it reads gradients and the level clamp through its new `addr_dword` / `addr_val(at, k)` helpers (a16 packs two components per VGPR); #563 (in #1319) adds cube gradients on the face coordinates (`graded`) and a `_cl` clamp read after the coordinates. Resolution: the cube gradient loop runs over `graded` with `addr_dword` (gradients are one 32-bit dword each even with a16, as #306's comment says), and the clamp is `addr_val(self, at, coords)`, the same dword as before without a16. There is no test of a16 together with cube gradients; that combination is the part of this resolution to look at. 4. **#176**: both it and the bundle add tests at the end of `emit/lower.rs`. Both are kept. 5. **#306 at its new head** (`e3067ae`, a commit by wrothgaril at 20:36 UTC on Nov 24): two of #306's tests, `compute_shader_implicit_sample_uses_valver_1_8_and_validates` and `row_interp_harmonizes_packed_elements_and_validates`, failed with the stock Windows SDK's `dxil.dll`, which is validator 1.7 (found by alexdeliu on an RX 9070, see #1495). The new head of #306 handles it itself: a `Validator::version()` query with a skip below validator 1.8, and PSV0 semantic names written per element (its commit message: "write PSV0 semantic names per element; skip valver 1.8 check on old validators"). I have no 1.7 `dxil.dll` here to confirm it on the stock SDK. An earlier version of this bundle had a commit of mine that did the same thing; it is reverted in the history, just before the merge of the new head, so nothing is duplicated. ## Left out, and why - **#539**: gains the same 520 programs as #305 (#1247). One of the two is enough; #305 is the older. - **#592, #621**: gain the same 117 programs as #176 (#1247). - **#996**: gains 52 programs, 36 of them shared with #306, and implements the same a16 biased sample; it conflicts with #306 here. - **#298**: overlaps #1074 (in #1319) on 23 of its 29 programs and conflicts with it. - **#585**: gains 25 programs, a superset of #1084's two (in #1319), and conflicts with it. - **#453**: gains 182 programs but adds six validator errors (#1247). ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 359 passed, 0 failed, 6 ignored (`main`: 342 passed, 6 ignored) | The title was not run, so this says nothing about in-game effect. No game data is used or committed. ## Re-verify in one go ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/shader-high-yield git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` To confirm that no component PR moved since this was built, compare each `Head` above with `gh pr view <n> --repo Marvisak/VIctory --json headRefOid`. If one differs, the branch needs a rebuild: merge the new head in the same order. ## If this lands The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
image_sample_d_cl was refused by name, and behind it every program hit
a cube sample with explicit gradients, refused as "a cube sample with
... gradients". Both now translate to sampleGrad:

- A cube's gradients on GFX10 are of the face coordinates (s, t), four
  addresses rather than six, so the coordinates follow at 4. They become
  the direction's gradients through the face's linear part of
  cube_direction (u = 2s - 3, v = 2t - 3; the major axis does not move),
  in the new cube_gradient.
- `_cl`: the level-of-detail clamp follows the coordinates and is passed
  as sampleGrad's clamp.

translate --validate on shaders.rpf: vertex/pixel 12172 -> 12197
validated; both errors are gone from the list. Not yet compared against
the console's sampling at runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A descriptor fetched from the resource heap by index has no used-resource
entry, so a scalar buffer load (s_buffer_load_dword*) through it was
lowered through a 64 KiB constant buffer handle. When vector buffer loads
read the same descriptor, the slot holds a buffer SRV (the title made it
one), and reading it through a CBV handle is a descriptor of the wrong
type, which D3D12 leaves undefined. Such loads now read the slot as a raw
buffer, as table SRVs already do. A descriptor also written through
(a UAV) and one only scalar loads read are unchanged.

In the title's shaders.rpf this changes 38,829 scalar loads in about 1,900
of 26,084 programs; emit and validation counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
s_buffer_load_dword* through a table's UAV took the constant buffer
path: a CBV handle at the heap index of a UAV. Reading through it
removes the device (WARP: "The GPU device instance has been
suspended"). Such a load now reads the UAV raw, as a raw SRV is read
and as vector buffer accesses read a UAV.

The test writes a value to the VALU tests' raw UAV, reads it back with
a scalar buffer load and stores that; it removed the WARP device before
this change and passes on the hardware GPU and WARP after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An s_load_dword* whose address is a root descriptor's, and whose
result the program never uses as a descriptor, reads that buffer's
data. It stopped with "a descriptor read only as data". It is now read
as global loads from a root view already are: a root SRV raw, a root
CBV (or a root view the used-resource list does not name) as a
constant buffer. A root UAV still stops, with its own reason.

Test: dwords 2 and 3 of a root SRV and of a root CBV read with one
s_load_dwordx2 and stored, exact on the hardware GPU and WARP; main
refuses the program.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An s_load_dword* of a descriptor whose dwords the code reads as numbers
(an image's width and levels) but never samples was refused with "a
descriptor read only as data": the view's kind came only from a use. Now
the table's range names it, and an entry in the resource heap that no
range names (a run-time index reaches it) is an image if it is eight
dwords, taken for 2D (shortcut noted in the code).

Offline over the whole corpus, programs refused: 4123 -> 3749; "a
descriptor read only as data" 395 -> 18; compute programs emitted
1441 -> 1743 (validated 1417 -> 1647). Tested with a hand-assembled
waterfall program that reads two textures' sizes, on the host GPU and
WARP; it fails with the old refusal without the change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A register can hold a compare result's high dword on one path and a loaded
number on another; the compiler only reads it where the number is live. The
join's mask side was "a lane mask read as data", which refused the program.
A pixel or vertex program now takes the mask's ballot as that incoming value
(counts and zero tests mean the same on any wave size). shortcut: the ballot
is the host wave's, so a join read some other way would differ from the console.

Offline corpus: "a lane mask read as data" 250 -> 212, vertex/pixel programs
emitted 12243 -> 12250; the other 31 move on to descriptor/scalar-memory
refusals. Synthetic wave64 pixel program fails before, lowers after.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The console compiler spills scalars, lane-mask pairs among them, with
v_writelane_b32 into constant lanes of a VGPR and restores them with
v_readlane_b32 of the same lane. The restored pair was an opaque mask, so
the selects, EXEC writes and joins that used it refused ("a select on an
untracked mask", "an opaque lane mask", "a lane-mask join of an untracked
mask"). structure now follows a constant-lane readlane back through a plain
chain of writelanes to the scalar written to that lane, and gives the
restored pair that scalar pair's mask. A chain with a phi or another write
of the VGPR stays opaque (shortcut noted in code).

Offline corpus, against fix/mask-phi-ballot (neither branch carries #585):
vertex/pixel programs emitted 12250 -> 12269, compute 1443 -> 1452,
"a lane-mask join of an untracked mask" 20 -> 0, "an opaque lane mask"
29 -> 8, "a conditional export" 8 -> 0. Synthetic pixel program fails
before, lowers after. Stacked on fix/mask-phi-ballot (shares its test helper).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
v_cndmask_b32 and v_*_co_ci_u32 refused when their scalar mask was not one
structure followed (a plain SGPR number). In compute with console lanes the
lane now tests its own bit of the register (pair in wave64); inline 0 and -1
masks are constants. Taken from upstream PR #585 (mask part only; its
descriptor-dimension hunk is left to the resource work).

Offline corpus (26148 programs): "a select on an untracked mask" 288 -> 0, no
new refusal text; those programs now stop at later refusals (descriptor read
as data +205, unknown stride +32, descriptor address/format +33), so compute
programs emitted only 1441 -> 1443. Synthetic test on hardware: fails before,
passes after. WARP cannot pin a wave size, so the test skips it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Fixes 5 shader emission and DXIL container/validator issues in `victory-shader`,
raising validated shaders across the test corpus from 21,983 to 22,159 (+176;
100% of emitted VS/PS/CS shaders now validate cleanly):

1. Biased 16-bit image samples (`emit/lower.rs`):
   - Remove the `a16` rejection on `image_sample_b` and separate 32-bit prefix
     operands (offsets, bias, comparison reference) from `a16`-packed tail
     operands (gradients, coordinates, explicit LOD) starting at `regs[first]`,
     matching GFX10 MIMG hardware operand layout.

2. Conservative depth `SV_Position` interpolation (`emit/mod.rs`):
   - Declare `SV_Position` with `linear_noperspective_centroid` (5) instead of
     `linear_noperspective` (4) in pixel shaders outputting `SV_DepthLessEqual`
     or `SV_DepthGreaterEqual` (kinds 18/19).

3. Per-row interpolation mode consistency (`emit/mod.rs`, `emit/lower.rs`):
   - Add `harmonize_row_interp()` so elements sharing a signature row always
     declare the same interpolation mode: rows containing integer attributes or
     `SV_IsFrontFace` propagate `nointerpolation` (1) to sibling elements, and
     after pixel-shader lowering unread siblings inherit the actual read mode
     of sibling elements in the same row.

4. Container signature row ordering (`emit/container.rs`):
   - Sort `ISG1`/`OSG1` rows stably by register only (`row`) rather than
     `(row, col)`, preserving DXIL element-ID order within a row so the
     container signature matches DXIL validator expectations byte for byte.

5. SM 6.6 compute-shader implicit derivatives (`emit/shader.rs`, `emit/container.rs`, `emit/lower.rs`):
   - Track compute shaders emitting implicit-derivative sampling ops and emit
     `dx.valver = 1.8` with `PSVRuntimeInfo3` (52 bytes, carrying
     `EntryFunctionName`), enabling validation and D3D12 compute PSO creation.

Adds 5 unit + `dxil.dll` validation (+ D3D12 compute PSO) tests in `emit::tests`.
With a16 the bias of `image_sample_b` keeps its own address dword but
holds an f16 in the low half (as LLVM's AMDGPU lowering builds it), so
reading the dword as f32 silently dropped the bias. Unpack the low half
and convert it like the other 16-bit addresses.

Derivatives are only 16-bit in the `_g16` opcodes; under a16 alone they
stay one 32-bit dword each and only the coordinates and LOD are packed.
Fix the decoder's address dword count (2D `image_sample_d ... a16` is
five dwords) and read the gradients as full dwords, starting the packed
coordinates after them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first commit left a heap descriptor of no listed kind that a vector
buffer store or atomic also uses on the constant buffer path, which is a
CBV handle on the UAV the title made. Scalar loads through it now read a
raw UAV (11 | 0x1000), as #1055 does for a table's UAV; read-only use
stays a raw SRV. The test's store case now expects no CBV handle.

In the title's shaders.rpf no program has this case (all 38,829 changed
loads are the read-only one); emit and validation counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
#	crates/victory-shader/src/emit/valu_tests.rs
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
Merges #1057 #1073 #1074 #1084 #953 #1056 #1015 #1055 #563 #1004 onto main
(ffe310e), each head unchanged. Two merges needed a hand resolution:

- #1015 + #1055 (emit/lower.rs, the raw-view choice for a scalar buffer
  load of a descriptor): an SRV range reads a raw SRV view, a UAV range a
  raw UAV view, a descriptor of no listed kind the heap buffer view of #1015.
  Both of their tests (emit/valu_tests.rs) are kept.
- #563 + #1004 (emit/lower.rs, cube sample refusal): #563 lowers gradients
  and #1004 the level query, so only texel coordinates are still refused.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(350 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
# Conflicts:
#	crates/victory-shader/src/emit/lower.rs
Merges #1067 #305 #306 #176 on top of the bundle of #1319 (itself on main,
ffe310e), each head unchanged. In #1247's offline benchmark on a retail dump
they gain 295, 520, 153 and 117 programs. Each needed a hand resolution
against the PRs of #1319 (see the pull request text); the combined
semantics are the ones of both sides.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(359 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
compute_shader_implicit_sample_uses_valver_1_8_and_validates and
row_interp_harmonizes_packed_elements_and_validates (both #306) fail with
the stock Windows SDK's dxil.dll (validator 1.7): the first because the
module declares validator 1.8 ("Validator version in metadata (1.8) is not
supported; maximum: (1.7)"), the second with "Container part 'Pipeline
State Validation' does not match expected for module" (reported by
alexdeliu on #1495, RX 9070). A runner with the stock SDK would fail them.

Validator::version() asks the validator for its IDxcVersionInfo, and the
two tests validate through validate_if_1_8_available, which skips with a
message when the version is below 1.8 and validates as before otherwise.
Checked here with validator 1.9 (they run) and with an old SDK's 1.5 (they
skip).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
PSV0 shared one string-table copy of a repeated semantic name (TEXCOORD0
and TEXCOORD1 pointing at the same "TEXCOORD"). DXC's PSV writer writes
one copy per element, and validators before 1.8 compare PSV0 byte for
byte, so any signature repeating a name was rejected there ("Pipeline
State Validation does not match"); 1.8 compares the strings and accepted
both. Checked against dxil.dll 1.7, 1.8 and 1.9.

Validator::version() reads IDxcVersionInfo; the compute-derivative test
skips dxil.dll validation when the validator predates 1.8, which rejects
dx.valver 1.8 outright. Translated shaders never go through dxil.dll.

Reported by @alexdeliu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 119b7630d7.
The author's head now does what the bundle's own commit did (a validator version query and the
skip below 1.8), and fixes the second failing test at its cause; the bundle's commit is
reverted just before this merge.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:30:31 +00:00
github-bot closed this pull request 2026-11-26 04:30:31 +00:00
Author
Owner

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

Offline measurement on a retail dump, as asked in #1247

Result: +1,688 programs over main, 0 programs lost. The hand-resolved merges did not cost a program on this data.

Method: the same as #1247. I ran victory translate --validate --list on shaders.rpf from a retail dump (1.0.2.1), with dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100). Then I compared the results program by program, 25,889 listed programs. I built each head in its own worktree and target dir, release profile.

Build Validated Change Lost
main ffe310e 21,724
#1319 head 643aef6 22,009 +285 vs main 0
#1402 head 2310409 23,412 +1,403 vs #1319 0

The sum holds, and it is larger. On top of #1319, the four PRs gain 1,403 programs. Measured one by one on main in #1247, they gained 1,085 (295 + 520 + 153 + 117). The difference comes from #1319: it moves 247 programs past the mask and scalar-read failures. These programs then stop at "a descriptor read only as data", and #1067 handles them too. Under that reason, the bundle gains 590 programs here; #1067 alone gained 295.

What the four PRs gain on top of #1319, by the reason each program failed with on #1319:

Failure on #1319 Gained
a descriptor read only as data 590
a 64-bit image atomic 520
a packed input half no element holds 131
validator: signature or interpolation-mode mismatches 118
a biased image sample with 16-bit coordinates 44

The next wall. With this PR, the largest failure is "a descriptor's address or format read as data": 809 programs, against 92 on main and 653 on #1319. Most of these programs moved forward from other reasons. In the main → #1402 comparison:

  • 497 come from "a scalar memory read as data"
  • 104 come from "a 64-bit image atomic"
  • 48 come from "a biased image sample with 16-bit coordinates"

The next-largest failures are the lane-mask reasons (270 and 264), computed barycentrics (207), and SGPR addresses that are no root parameter (195).

Limits. These are counts of programs that translate and pass the validator offline. They do not tell whether the output is correct. I did not render anything or run the PR's tests. Shader names and data are left out per the asset policy.

AI-assisted (Claude Code). Measured on my own machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2.

**@⁠sinan-cmyk** on GitHub · 2026-11-24 18:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7140318094) ### Offline measurement on a retail dump, as asked in #1247 **Result: +1,688 programs over `main`, 0 programs lost.** The hand-resolved merges did not cost a program on this data. Method: the same as #1247. I ran `victory translate --validate --list` on `shaders.rpf` from a retail dump (1.0.2.1), with dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100). Then I compared the results program by program, 25,889 listed programs. I built each head in its own worktree and target dir, release profile. | Build | Validated | Change | Lost | |---|---|---|---| | `main` ffe310e | 21,724 | | | | #1319 head 643aef6 | 22,009 | +285 vs `main` | 0 | | #1402 head 2310409 | 23,412 | +1,403 vs #1319 | 0 | **The sum holds, and it is larger.** On top of #1319, the four PRs gain 1,403 programs. Measured one by one on `main` in #1247, they gained 1,085 (295 + 520 + 153 + 117). The difference comes from #1319: it moves 247 programs past the mask and scalar-read failures. These programs then stop at "a descriptor read only as data", and #1067 handles them too. Under that reason, the bundle gains 590 programs here; #1067 alone gained 295. What the four PRs gain on top of #1319, by the reason each program failed with on #1319: | Failure on #1319 | Gained | |---|---| | a descriptor read only as data | 590 | | a 64-bit image atomic | 520 | | a packed input half no element holds | 131 | | validator: signature or interpolation-mode mismatches | 118 | | a biased image sample with 16-bit coordinates | 44 | **The next wall.** With this PR, the largest failure is "a descriptor's address or format read as data": 809 programs, against 92 on `main` and 653 on #1319. Most of these programs moved forward from other reasons. In the main → #1402 comparison: - 497 come from "a scalar memory read as data" - 104 come from "a 64-bit image atomic" - 48 come from "a biased image sample with 16-bit coordinates" The next-largest failures are the lane-mask reasons (270 and 264), computed barycentrics (207), and SGPR addresses that are no root parameter (195). **Limits.** These are counts of programs that translate and pass the validator offline. They do not tell whether the output is correct. I did not render anything or run the PR's tests. Shader names and data are left out per the asset policy. AI-assisted (Claude Code). Measured on my own machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 19:23 UTC · original

New head 119b763: one commit on top that skips two of #306's tests when dxil.dll is older than validator 1.8 (they failed with the stock SDK's 1.7, reported by alexdeliu on #1495). See the PR text. The measurement above was on the previous head 2310409; the commit only touches the validator wrapper and those two tests. AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-24 19:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7142023720) New head `119b763`: one commit on top that skips two of #306's tests when `dxil.dll` is older than validator 1.8 (they failed with the stock SDK's 1.7, reported by alexdeliu on #1495). See the PR text. The measurement above was on the previous head `2310409`; the commit only touches the validator wrapper and those two tests. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠YaBulochka on GitHub · 2026-11-24 19:51 UTC · original

Linux/RADV result from a retail run, measured, not estimated: this bundle plus #1319 removes the pixel-side walls completely, and leaves two compute classes.

Before (base ffe310e + #994 + #491 + #1583):

  • mesh 63083c777948927a: a lane mask read as data is not supported;
  • pixel a402e650d0acbc92, 46395a33fdf2a3fa: the same lane-mask error;
  • pixel a223e485dd8247a3: a packed input half no element holds is not supported.

After #1319 + this bundle on the same tree:

  • mesh 63083c777948927a translates (0 errors) - its draws stop being dropped;
  • pixel errors: 0. Every pixel shader that ran in the intro/menu translates now;
  • the only does not translate lines left are compute: 6 x a structured buffer of unknown stride is not supported (0452fc2d2e2fc4c3, 17af15c4015cb4b6, 1c4b3c0547e3e6fa, 42f717f1b4d18e94, 55679a0547649d0b, 89d08e561897d4e5, 9209777e8face9dd, fdd56d97a806bcca) and 3 x image_gather4_l is not supported (0452fc2d2e2fc4c3, 9f017d9011377efa, fc5e66f8f873d3bb).

So on this title the pixel path is done: what is still black can no longer be blamed on a missing pixel translation. The next two walls are #704/#193 (unknown stride) and #160 (gather4_l); both conflict with #1548 in descriptor/host.rs and with this bundle in gfx10/fields.rs, so I am testing them one at a time.

Setup, for reproduction: Linux, Wine 11.22 in a Proton 11.0 prefix, vkd3d-proton from Proton, RADV from Mesa 26.3.1, RX 7600 XT; VICTORY_PIPELINE_JOURNAL=1.

**@⁠YaBulochka** on GitHub · 2026-11-24 19:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7142678977) Linux/RADV result from a retail run, measured, not estimated: this bundle plus #1319 removes the pixel-side walls completely, and leaves two compute classes. Before (base `ffe310e` + #994 + #491 + #1583): - mesh `63083c777948927a`: `a lane mask read as data is not supported`; - pixel `a402e650d0acbc92`, `46395a33fdf2a3fa`: the same lane-mask error; - pixel `a223e485dd8247a3`: `a packed input half no element holds is not supported`. After #1319 + this bundle on the same tree: - mesh `63083c777948927a` translates (0 errors) - its draws stop being dropped; - **pixel errors: 0**. Every pixel shader that ran in the intro/menu translates now; - the only `does not translate` lines left are compute: 6 x `a structured buffer of unknown stride is not supported` (`0452fc2d2e2fc4c3`, `17af15c4015cb4b6`, `1c4b3c0547e3e6fa`, `42f717f1b4d18e94`, `55679a0547649d0b`, `89d08e561897d4e5`, `9209777e8face9dd`, `fdd56d97a806bcca`) and 3 x `image_gather4_l is not supported` (`0452fc2d2e2fc4c3`, `9f017d9011377efa`, `fc5e66f8f873d3bb`). So on this title the pixel path is done: what is still black can no longer be blamed on a missing pixel translation. The next two walls are #704/#193 (unknown stride) and #160 (gather4_l); both conflict with #1548 in `descriptor/host.rs` and with this bundle in `gfx10/fields.rs`, so I am testing them one at a time. Setup, for reproduction: Linux, Wine 11.22 in a Proton 11.0 prefix, vkd3d-proton from Proton, RADV from Mesa 26.3.1, RX 7600 XT; `VICTORY_PIPELINE_JOURNAL=1`.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 20:09 UTC · original

Thank you, YaBulochka: that is a very useful reading, pixel path done on this title and two compute walls left. Those two are what I try next on top of the stack: #193 with #704 (unknown stride) and #160 (image_gather4_l), resolving the conflicts you name in gfx10/fields.rs and descriptor/host.rs (and #1548). I will post the branch here and on #1495 when it passes the usual checks. The head of #1402 has since gained one commit (119b763, two of #306's tests skipped below validator 1.8); it touches only the validator wrapper and those tests. AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7143122064) Thank you, YaBulochka: that is a very useful reading, pixel path done on this title and two compute walls left. Those two are what I try next on top of the stack: #193 with #704 (unknown stride) and #160 (`image_gather4_l`), resolving the conflicts you name in `gfx10/fields.rs` and `descriptor/host.rs` (and #1548). I will post the branch here and on #1495 when it passes the usual checks. The head of #1402 has since gained one commit (`119b763`, two of #306's tests skipped below validator 1.8); it touches only the validator wrapper and those tests. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 20:30 UTC · original

YaBulochka: the unknown-stride wall from your list is now #1644 (branch bundle/stride-stack): #704 on #193, on top of #1511, both heads unchanged. They merge with the stack with no conflict besides the tests at the end of emit/mod.rs (both sets kept) and one field, stride_table, in two test literals. cargo clippy (both runs) and cargo test --workspace pass here: 412 tests, two runs, on WARP and an RX 6950 XT. I did not run the title, so I cannot say how many of your 6 unknown stride shaders translate now; a VICTORY_PIPELINE_JOURNAL=1 run on that branch would show it.

Left out: #160 (image_gather4_l). It replaces the lowering's match on sample opcode names with a parsed SampleForm and conflicts with the stack in 13 hunks (emit/lower.rs 10, gfx10/fields.rs 2, emit/host.rs 1). Making it agree with #563, #306 and #1004 is a design choice, not a mechanical merge, so I left it. #1548 conflicts with the view-heap sizing already on the stack in descriptor/host.rs.

bundle/all (every bundle but #1632 and #1638, one tree) has #1644 now: 751 tests, both clippy runs clean.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-24 20:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7143653465) YaBulochka: the unknown-stride wall from your list is now #1644 (branch `bundle/stride-stack`): #704 on #193, on top of #1511, both heads unchanged. They merge with the stack with no conflict besides the tests at the end of `emit/mod.rs` (both sets kept) and one field, `stride_table`, in two test literals. `cargo clippy` (both runs) and `cargo test --workspace` pass here: 412 tests, two runs, on WARP and an RX 6950 XT. I did not run the title, so I cannot say how many of your 6 `unknown stride` shaders translate now; a `VICTORY_PIPELINE_JOURNAL=1` run on that branch would show it. Left out: #160 (`image_gather4_l`). It replaces the lowering's match on sample opcode names with a parsed `SampleForm` and conflicts with the stack in 13 hunks (`emit/lower.rs` 10, `gfx10/fields.rs` 2, `emit/host.rs` 1). Making it agree with #563, #306 and #1004 is a design choice, not a mechanical merge, so I left it. #1548 conflicts with the view-heap sizing already on the stack in `descriptor/host.rs`. `bundle/all` (every bundle but #1632 and #1638, one tree) has #1644 now: 751 tests, both clippy runs clean. AI-assisted (Claude Code); no game data.
Author
Owner

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

PRs that add programs on top of this bundle (measured on the retail dump, stacked on head 2310409, program by program):

PR On top of #1402 Lost Merge
#1423 +214 0 One test-module hunk in emit/lower.rs; both tests kept. details
#1597 (mine) +473 0 Stacked on this PR already.
#1407 +1 0 Clean.
#1221 0 0 Conflicts in the v_cndmask_b32 arm. Combined with #1423 it costs 1 program. details

#1423 gained nothing on main alone. Its 214 programs need #1067, which is inside this PR. #1130, #1291, #1409 and #995 also conflict with this PR in emit/lower.rs or emit/mod.rs. On main, all of their gains are already among this bundle's gains.

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

**@⁠sinan-cmyk** on GitHub · 2026-11-24 20:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7143670400) **PRs that add programs on top of this bundle** (measured on the retail dump, stacked on head 2310409, program by program): | PR | On top of #1402 | Lost | Merge | |---|---|---|---| | #1423 | **+214** | 0 | One test-module hunk in `emit/lower.rs`; both tests kept. [details](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1423) | | #1597 (mine) | **+473** | 0 | Stacked on this PR already. | | #1407 | +1 | 0 | Clean. | | #1221 | 0 | 0 | Conflicts in the `v_cndmask_b32` arm. Combined with #1423 it costs 1 program. [details](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1221) | #1423 gained nothing on `main` alone. Its 214 programs need #1067, which is inside this PR. #1130, #1291, #1409 and #995 also conflict with this PR in `emit/lower.rs` or `emit/mod.rs`. On `main`, all of their gains are already among this bundle's gains. AI-assisted (Claude Code). No shader names or data are included, per the asset policy.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 22:06 UTC · original

Heads moved. #306 got a new commit from its author (e3067ae) that handles the validator 1.7 case itself, so the bundle's own commit for it (119b763) is reverted and the new head is merged. The stack was brought forward by merging, in order: #1402 7e7c5be, #1492 ea33d12, #1504 56f7da3, #1511 4ac9e91, #1589 60fa5d7, #1593 5996b87, #1644 8bf13c4, #1632 8de76a2, #1638 ab4a6e6. Each passes clippy (both runs) and cargo test --workspace (two runs) here; test counts are unchanged. Any measurement on the earlier heads (sinan-cmyk's offline counts, for example) was made before #306's new commit. The loader bundle #1456 also has new heads of #214 and #324, and bundle/all is refreshed (754 tests).

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-24 22:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7145819696) Heads moved. #306 got a new commit from its author (`e3067ae`) that handles the validator 1.7 case itself, so the bundle's own commit for it (`119b763`) is reverted and the new head is merged. The stack was brought forward by merging, in order: #1402 `7e7c5be`, #1492 `ea33d12`, #1504 `56f7da3`, #1511 `4ac9e91`, #1589 `60fa5d7`, #1593 `5996b87`, #1644 `8bf13c4`, #1632 `8de76a2`, #1638 `ab4a6e6`. Each passes clippy (both runs) and `cargo test --workspace` (two runs) here; test counts are unchanged. Any measurement on the earlier heads (sinan-cmyk's offline counts, for example) was made before #306's new commit. The loader bundle #1456 also has new heads of #214 and #324, and `bundle/all` is refreshed (754 tests). AI-assisted (Claude Code); no game data.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:39 UTC · original

Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7148747111) Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) 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!1402
No description provided.