Shaders: link mesh and pixel programs whose mesh outputs pass 32 KiB #1562

Closed
claude-GTA6 wants to merge 4 commits from upstream-pr/1563 into main
claude-GTA6 commented 2026-11-24 19:12:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by claude-GTA6 on 2026-11-24T19:12:36Z.


From a tester working with Claude (AI-assisted); measured on my own machine.

Why

dxil.dll refuses 53 mesh programs of this title with "vertex plus primitive output size is greater than 32768". They export 65-68 output components from 128 lanes: 68 × 128 × 4 = 34,816 bytes, past 32 KiB even at one vertex per lane. NVIDIA builds such pipelines anyway, which is undefined behaviour on the GPU.

#459 lowered the declared maxima to the lane count. That lowering is correct, but it was closed because it cleared none of the 53: at the lane count they are still too big. Getting them under the cap needs fewer components, and a mesh program on its own cannot tell which of its outputs are unused. The pixel program it is drawn with can.

What

emit::translate_linked re-emits such a mesh program and its pixel program for each other when the pipeline is made:

  • arbitrary values the pixel program never reads leave both signatures;
  • the ones it reads end after their last read component.

D3D12 links equal masks only. I checked on the debug layer that both sides have to change together: a pruned mesh side alone is refused ("hardware register component mask that does not match the output of the previous stage"), and so are masks narrowed on one side.

The elements stay in the program while it is lowered, because packed 16-bit halves are placed from every element of a row. Removing them first moved halves onto other elements; the debug layer reported that as "always read by the downstream shader, but never written". Exports past the linked columns are dropped, and the signature is cut when the module is finished (lower::Parts::linked_cols). Reads past them stop the program, so the pair falls back to the original shaders.

The fewer components still have to fit at the lane count, so this keeps #459's measurement and lowering (container::mesh_output_bytes, the maxima in mesh_prologue, and its tests), credited to AnoHunted in the commit.

The GPU side (pipeline/host.rs, linked) uses the linked pair only when its bindings equal the originals' (the root signature is built from those). Otherwise, and for every mesh program that already fits, nothing changes.

Measured

Offline, on this branch (upstream main plus this change), with the title's shaders.rpf and executable. The validator was dxil.dll from SDK 10.0.26100 and the GPU an RTX 5090.

Mesh programs refused for the output size are still 53, because translate sees each program alone. To count what happens at pipeline creation, a scratch harness (not part of this PR) paired each of the 53 with every pixel program of the same effect, the shared suffix in the names. That made 3,505 pairs. For each pair it ran translate_linked, validated both programs, and built the mesh pipeline:

pairs
linked; both programs validate; pipeline created 1,988
linked; both programs validate; pipeline refused ("The parameter is incorrect"), and the same pair unlinked is refused too 1,517
refused linked but created unlinked 0
not linked, or a linked program fails validation 0

All 53 mesh programs link with at least one pixel program of their effect, and 6 of them link with every one. The 1,517 refused pairs are refused just the same without linking, so they look like pairs the effect never draws together, not a fault of the link.

On an RTX 5090, with the over-limit pair this title's world actually binds (a mesh program with 68 components and its pixel program):

  • Both linked programs pass dxil.dll (SDK 10.0.26100).
  • The pipeline is created, and the debug layer reports nothing.
  • In game the log shows the pair linked. It was the only over-limit pair bound in 33 of my runs, the longest 15 minutes.

This does not fix the world hang on NVIDIA (DRED still stops at the same pixel-loop draw as before); it only removes one source of invalid modules.

Other programs are unchanged: the linked path is off unless a pipeline needs it. On our fork, with this change, I compared every emitted program over the title's shaders before and after, and all programs that validated before are byte-identical.

Tests: five in victory-shader. Three are #459's (output size, maxima lowering, maxima still past the cap), and two are new:

  • a_linked_mesh_program_leaves_out_what_the_pixel_program_never_reads uses #459's synthetic mesh fixture (16 rows past the cap). The linked program declares 61 components and validates.
  • linked_elements_keep_system_values_and_read_columns covers the element rules.

cargo test -p victory-shader (125 pass) and cargo clippy --workspace --all-targets -- -D warnings are clean on this branch.

Not covered

Which pixel program a mesh program is drawn with is only known at pipeline creation. The offline count pairs by effect, which may include pairs the title never draws and miss ones it does. In game I have seen one over-limit pair bound. The translate tool does not link pairs on this branch.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589429174 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563). Originally posted by [claude-GTA6](https://github.com/claude-GTA6) on 2026-11-24T19:12:36Z. --- *From a tester working with Claude (AI-assisted); measured on my own machine.* ## Why dxil.dll refuses 53 mesh programs of this title with "vertex plus primitive output size is greater than 32768". They export 65-68 output components from 128 lanes: 68 × 128 × 4 = 34,816 bytes, past 32 KiB even at one vertex per lane. NVIDIA builds such pipelines anyway, which is undefined behaviour on the GPU. #459 lowered the declared maxima to the lane count. That lowering is correct, but it was closed because it cleared none of the 53: at the lane count they are still too big. Getting them under the cap needs fewer components, and a mesh program on its own cannot tell which of its outputs are unused. The pixel program it is drawn with can. ## What `emit::translate_linked` re-emits such a mesh program and its pixel program for each other when the pipeline is made: - arbitrary values the pixel program never reads leave both signatures; - the ones it reads end after their last read component. D3D12 links equal masks only. I checked on the debug layer that both sides have to change together: a pruned mesh side alone is refused ("hardware register component mask that does not match the output of the previous stage"), and so are masks narrowed on one side. The elements stay in the program while it is lowered, because packed 16-bit halves are placed from every element of a row. Removing them first moved halves onto other elements; the debug layer reported that as "always read by the downstream shader, but never written". Exports past the linked columns are dropped, and the signature is cut when the module is finished (`lower::Parts::linked_cols`). Reads past them stop the program, so the pair falls back to the original shaders. The fewer components still have to fit at the lane count, so this keeps #459's measurement and lowering (`container::mesh_output_bytes`, the maxima in `mesh_prologue`, and its tests), credited to AnoHunted in the commit. The GPU side (`pipeline/host.rs`, `linked`) uses the linked pair only when its bindings equal the originals' (the root signature is built from those). Otherwise, and for every mesh program that already fits, nothing changes. ## Measured Offline, on this branch (upstream main plus this change), with the title's `shaders.rpf` and executable. The validator was dxil.dll from SDK 10.0.26100 and the GPU an RTX 5090. Mesh programs refused for the output size are still 53, because `translate` sees each program alone. To count what happens at pipeline creation, a scratch harness (not part of this PR) paired each of the 53 with every pixel program of the same effect, the shared suffix in the names. That made 3,505 pairs. For each pair it ran `translate_linked`, validated both programs, and built the mesh pipeline: | | pairs | |---|---| | linked; both programs validate; pipeline created | 1,988 | | linked; both programs validate; pipeline refused ("The parameter is incorrect"), and the same pair unlinked is refused too | 1,517 | | refused linked but created unlinked | 0 | | not linked, or a linked program fails validation | 0 | All 53 mesh programs link with at least one pixel program of their effect, and 6 of them link with every one. The 1,517 refused pairs are refused just the same without linking, so they look like pairs the effect never draws together, not a fault of the link. On an RTX 5090, with the over-limit pair this title's world actually binds (a mesh program with 68 components and its pixel program): - Both linked programs pass dxil.dll (SDK 10.0.26100). - The pipeline is created, and the debug layer reports nothing. - In game the log shows the pair linked. It was the only over-limit pair bound in 33 of my runs, the longest 15 minutes. This does not fix the world hang on NVIDIA (DRED still stops at the same pixel-loop draw as before); it only removes one source of invalid modules. Other programs are unchanged: the linked path is off unless a pipeline needs it. On our fork, with this change, I compared every emitted program over the title's shaders before and after, and all programs that validated before are byte-identical. Tests: five in `victory-shader`. Three are #459's (output size, maxima lowering, maxima still past the cap), and two are new: - `a_linked_mesh_program_leaves_out_what_the_pixel_program_never_reads` uses #459's synthetic mesh fixture (16 rows past the cap). The linked program declares 61 components and validates. - `linked_elements_keep_system_values_and_read_columns` covers the element rules. `cargo test -p victory-shader` (125 pass) and `cargo clippy --workspace --all-targets -- -D warnings` are clean on this branch. ## Not covered Which pixel program a mesh program is drawn with is only known at pipeline creation. The offline count pairs by effect, which may include pairs the title never draws and miss ones it does. In game I have seen one over-limit pair bound. The `translate` tool does not link pairs on this branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-24 20:02:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T19:20:49Z.

Review: APPROVED


Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 101. Execution/valu tests are #[cfg(all(test, windows))] and were not run here.

Mesh+pixel programs whose mesh outputs exceed 32 KiB are now linked (linked(ms, ps)) and the linked bytecode is what the D3D12 pipeline state receives for both stages; non-mesh pipelines are untouched. The shader-side linked() has unit tests that run on macOS (101 passed, +5). The victory-gpu host side is Windows-only and was not built here — the change is small and mirrors the existing bytecode selection, but please confirm on Windows before merge.

<!-- greyfinch-sync:Marvisak/VIctory:review:6045809296 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#pullrequestreview-6045809296). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T19:20:49Z. **Review:** APPROVED --- Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), `cargo test -p victory-shader --locked` → 101. Execution/valu tests are `#[cfg(all(test, windows))]` and were not run here. Mesh+pixel programs whose mesh outputs exceed 32 KiB are now linked (`linked(ms, ps)`) and the linked bytecode is what the D3D12 pipeline state receives for both stages; non-mesh pipelines are untouched. The shader-side `linked()` has unit tests that run on macOS (101 passed, +5). The `victory-gpu` host side is Windows-only and was not built here — the change is small and mirrors the existing bytecode selection, but please confirm on Windows before merge.
claude-GTA6 commented 2026-11-24 20:03:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by claude-GTA6 on 2026-11-24T19:47:43Z.


From a tester working with Claude (AI-assisted); measured on my own machine.

@catminou4 thanks. Confirmed on Windows 11 / RTX 5090 at this head (4df3d0ed on ffe310e): cargo clippy --workspace --all-targets -- -D warnings, which builds victory-gpu's Windows-only host side, is clean, and cargo test -p victory-shader passes 125 there, including the Windows-only execution tests. The linked pair the title's world binds validates on both sides, its pipeline is created, and the D3D12 debug layer reports nothing.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142599419 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7142599419). Originally posted by [claude-GTA6](https://github.com/claude-GTA6) on 2026-11-24T19:47:43Z. --- *From a tester working with Claude (AI-assisted); measured on my own machine.* @catminou4 thanks. Confirmed on Windows 11 / RTX 5090 at this head (`4df3d0ed` on `ffe310e`): `cargo clippy --workspace --all-targets -- -D warnings`, which builds `victory-gpu`'s Windows-only host side, is clean, and `cargo test -p victory-shader` passes 125 there, including the Windows-only execution tests. The linked pair the title's world binds validates on both sides, its pipeline is created, and the D3D12 debug layer reports nothing.
Marvisak commented 2026-11-25 02:06:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:30:52Z.


Automated triage for the maintainers.

Merge candidate. When a mesh program's outputs pass 32 KiB even at one vertex per lane, emit::translate_linked re-emits it together with its pixel program, dropping the arbitrary values the pixel side never reads and narrowing the ones it does. pipeline/host.rs::linked uses that pair only when every binding field matches the original shaders. I checked that:

  • mesh_prologue lowers the maxima to the lane count, which matches mesh_thread being the vertex and primitive index;
  • stores past the linked columns are skipped before usage is set, so the linked_cols check does not refuse ordinary linked programs;
  • pixel_reads takes the rw-mask byte at offset 25 of each ISG1 element.

The evidence is validator output, the debug layer and an in-game run. Two follow-ups: the pair is re-translated on every pipeline creation, so a cache keyed by the pair would help, and the pair counts in the description come from an older main. This also edits host_shader's options next to #1931, so whichever merges second needs a small rebase.

CI: no check runs reported for this head.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149632008 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7149632008). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:30:52Z. --- <!-- victory-triage v1 head=cd0da11b368e890712524b8cd3b91d6cc33fdbd5 verdict=merge-candidate at=2026-11-25T03:23:10Z --> Automated triage for the maintainers. **Merge candidate.** When a mesh program's outputs pass 32 KiB even at one vertex per lane, `emit::translate_linked` re-emits it together with its pixel program, dropping the arbitrary values the pixel side never reads and narrowing the ones it does. `pipeline/host.rs::linked` uses that pair only when every binding field matches the original shaders. I checked that: - `mesh_prologue` lowers the maxima to the lane count, which matches `mesh_thread` being the vertex and primitive index; - stores past the linked columns are skipped before `usage` is set, so the `linked_cols` check does not refuse ordinary linked programs; - `pixel_reads` takes the rw-mask byte at offset 25 of each ISG1 element. The evidence is validator output, the debug layer and an in-game run. Two follow-ups: the pair is re-translated on every pipeline creation, so a cache keyed by the pair would help, and the pair counts in the description come from an older `main`. This also edits `host_shader`'s options next to #1931, so whichever merges second needs a small rebase. CI: no check runs reported for this head. --- _Generated by [Claude Code](https://claude.ai/code)_
reboot0000-cmd commented 2026-11-25 02:06:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by reboot0000-cmd on 2026-11-25T01:50:11Z.


Heads-up on the engine behind these numbers, useful for the rebase the triage bot is asking for: the counts here (and in #1247's leaderboard) are taken with dxil.dll from SDK 10.0.26100, which is the validator 1.7.2308 engine - its FileVersion resource prints 1.8.2502, which is easy to read as 1.8. That engine regenerates PSV0 from the module and byte-compares it, and our writer deduplicates the PSV0 semantic-name string table, so it rejects roughly 15k emitted modules with Container part 'Pipeline State Validation' does not match expected for module on this archive even when the shader is fine. DXC 1.8+ replaced that with a content verifier that never rebuilds the table. Full write-up and the mechanical proof in #1945.

That matters specifically for this PR: it rewrites both mesh and pixel signatures, so a linked pair can look like a regression or no gain purely because of the PSV0 comparison, and #1208's string-table change is exactly what a linked pair needs to read as a win on a current engine. Worth re-measuring with VICTORY_DXIL pointed at DXC 1.8.2502's or 1.9.2609's dxil.dll.

Our own measurement on main 70564ae0 with the 1.8 engine: 71 mesh programs fail with vertex plus primitive output size is greater than 32768 (this description's 53 were counted on an older main), and once the compute stage/dx.valver class is cleared by #1065 these 71 are the only mesh validator failures left - i.e. this is the last outstanding validation gap for mesh, and the two output-size families (71 mesh now, 12,231 VS/PS before #1208) are the only things standing between the corpus and a clean --validate run. Happy to re-measure a rebased branch here with the 1.8 engine and report program-by-program.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150013132 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7150013132). Originally posted by [reboot0000-cmd](https://github.com/reboot0000-cmd) on 2026-11-25T01:50:11Z. --- Heads-up on the engine behind these numbers, useful for the rebase the triage bot is asking for: the counts here (and in #1247's leaderboard) are taken with `dxil.dll` from SDK 10.0.26100, which is the validator **1.7.2308** engine - its `FileVersion` resource prints `1.8.2502`, which is easy to read as 1.8. That engine regenerates `PSV0` from the module and byte-compares it, and our writer deduplicates the PSV0 semantic-name string table, so it rejects roughly 15k emitted modules with `Container part 'Pipeline State Validation' does not match expected for module` on this archive even when the shader is fine. DXC 1.8+ replaced that with a content verifier that never rebuilds the table. Full write-up and the mechanical proof in #1945. That matters specifically for this PR: it rewrites **both** mesh and pixel signatures, so a linked pair can look like a regression or no gain purely because of the PSV0 comparison, and #1208's string-table change is exactly what a linked pair needs to read as a win on a current engine. Worth re-measuring with `VICTORY_DXIL` pointed at DXC 1.8.2502's or 1.9.2609's `dxil.dll`. Our own measurement on main `70564ae0` with the 1.8 engine: **71** mesh programs fail with `vertex plus primitive output size is greater than 32768` (this description's 53 were counted on an older main), and once the compute stage/`dx.valver` class is cleared by #1065 these 71 are the only mesh validator failures left - i.e. this is the last outstanding validation gap for mesh, and the two output-size families (71 mesh now, 12,231 VS/PS before #1208) are the only things standing between the corpus and a clean `--validate` run. Happy to re-measure a rebased branch here with the 1.8 engine and report program-by-program.
mercuryVM commented 2026-11-25 03:02:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-25T02:47:40Z.

Review: APPROVED


Tested 93f718d ported onto our fork's main (upstream 70564ae plus our merges) on Windows 11, RTX 5070, MSVC: builds, clippy -D warnings clean with and without --all-features, and the diagnostics build compiles. cargo test --workspace --no-fail-fast: 720 passed.

  • mesh_output_size_counts_components_and_aligned_maxima, linked_elements_keep_system_values_and_read_columns and mesh_outputs_past_32_kib_at_the_lane_count_keep_the_lane_maxima pass.
  • a_linked_mesh_program_leaves_out_what_the_pixel_program_never_reads and mesh_maxima_past_the_lanes_come_down_to_fit fail here with "Container part 'Pipeline State Validation' does not match expected for module". They fail the same way at this PR's own head on upstream, as does the existing elements_sharing_a_row_keep_their_order on plain upstream main, with this host's dxil.dll 101.7.2308.24 (SDK 10.0.26100). So it's a PSV0/validator mismatch on this machine that predates the PR, not the port. It may still be worth checking which validator you ran them with. I didn't re-measure pipeline creation: offline translate sees each program alone, as the PR says.

On reading:

  • Lowering the maxima. mesh_output_bytes measures what the validator measures: components, not rows, with the maxima rounded up to 32. Lowering the maxima to the lane count only when they don't fit leaves every program that already fits untouched.
  • Cost. translate_linked returns None early unless the mesh program is over the cap at the lane count and the pruned outputs would fit, so ordinary pipelines pay only a container and signature parse. The re-emit happens only for the over-limit programs.
  • Both sides change. The mesh outputs and pixel inputs are pruned together, which matches D3D12's equal-mask linking rule and the debug-layer findings in the description.
    • Elements stay during lowering, so packed 16-bit halves land where they did. Only stores past the linked columns are dropped.
    • A read past them refuses the pair, so it falls back to the original shaders rather than reading something undefined.
  • Root signature. pipeline/host.rs uses the linked pair only when user_data, samplers, root CBVs and root SRVs equal the originals'. The root signature is built from those, so a linked pair can't bind differently.
  • Shortcut. Outputs still over the cap after all this are emitted as before. It's marked shortcut:, and I agree it's better than dropping draws that drivers accept.

Small things:

  • The doc comment /// The bytes of shader code (none for an absent stage). now sits above the new linked function instead of code_bytes (pipeline/host.rs). Move it back down.
  • When one mesh program is drawn with several pixel programs, each pipeline re-emits the mesh program. A small cache keyed by the (mesh, pixel) pair would avoid that if it shows in load time.

Porting notes:

  • Against current upstream, the only conflict is in the emit/mod.rs tests, next to the new min-precision signature test.
  • Our fork also carries the geometry-stage work (#877), where translate became translate_program(container, wanted, missing) and the pipeline picks bytecode by visibility. There, translate_program takes the link argument too, and the linked pair replaces the MESH and PIXEL stages by visibility instead of by index.

Merged into our fork's main as a port.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051075908 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#pullrequestreview-6051075908). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-25T02:47:40Z. **Review:** APPROVED --- Tested 93f718d ported onto our fork's main (upstream 70564ae plus our merges) on Windows 11, RTX 5070, MSVC: builds, clippy `-D warnings` clean with and without `--all-features`, and the diagnostics build compiles. `cargo test --workspace --no-fail-fast`: 720 passed. - `mesh_output_size_counts_components_and_aligned_maxima`, `linked_elements_keep_system_values_and_read_columns` and `mesh_outputs_past_32_kib_at_the_lane_count_keep_the_lane_maxima` pass. - `a_linked_mesh_program_leaves_out_what_the_pixel_program_never_reads` and `mesh_maxima_past_the_lanes_come_down_to_fit` fail here with "Container part 'Pipeline State Validation' does not match expected for module". They fail the same way at this PR's own head on upstream, as does the existing `elements_sharing_a_row_keep_their_order` on plain upstream main, with this host's dxil.dll 101.7.2308.24 (SDK 10.0.26100). So it's a PSV0/validator mismatch on this machine that predates the PR, not the port. It may still be worth checking which validator you ran them with. I didn't re-measure pipeline creation: offline `translate` sees each program alone, as the PR says. On reading: - **Lowering the maxima.** `mesh_output_bytes` measures what the validator measures: components, not rows, with the maxima rounded up to 32. Lowering the maxima to the lane count only when they don't fit leaves every program that already fits untouched. - **Cost.** `translate_linked` returns `None` early unless the mesh program is over the cap at the lane count and the pruned outputs would fit, so ordinary pipelines pay only a container and signature parse. The re-emit happens only for the over-limit programs. - **Both sides change.** The mesh outputs and pixel inputs are pruned together, which matches D3D12's equal-mask linking rule and the debug-layer findings in the description. - Elements stay during lowering, so packed 16-bit halves land where they did. Only stores past the linked columns are dropped. - A read past them refuses the pair, so it falls back to the original shaders rather than reading something undefined. - **Root signature.** `pipeline/host.rs` uses the linked pair only when `user_data`, samplers, root CBVs and root SRVs equal the originals'. The root signature is built from those, so a linked pair can't bind differently. - **Shortcut.** Outputs still over the cap after all this are emitted as before. It's marked `shortcut:`, and I agree it's better than dropping draws that drivers accept. Small things: - The doc comment `/// The bytes of shader code (none for an absent stage).` now sits above the new `linked` function instead of `code_bytes` (pipeline/host.rs). Move it back down. - When one mesh program is drawn with several pixel programs, each pipeline re-emits the mesh program. A small cache keyed by the (mesh, pixel) pair would avoid that if it shows in load time. Porting notes: - Against current upstream, the only conflict is in the `emit/mod.rs` tests, next to the new min-precision signature test. - Our fork also carries the geometry-stage work (#877), where `translate` became `translate_program(container, wanted, missing)` and the pipeline picks bytecode by visibility. There, `translate_program` takes the `link` argument too, and the linked pair replaces the `MESH` and `PIXEL` stages by visibility instead of by index. Merged into our fork's main as a port. AI-assisted (Claude Code).
claude-GTA6 commented 2026-11-25 03:03:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by claude-GTA6 on 2026-11-25T02:51:44Z.


From a tester working with Claude (AI-assisted); measured on my own machine.

Merged current main (940d32f6) into the branch; the head is now 132eda67 and the PR shows as mergeable again.

What the merge needed:

  • lower::Parts has view_marks next to linked_cols now (the conflict the triage named), in lower.rs and in the test literals.
  • translate_linked takes Options, and the GPU side passes the ones it translates every shader with (shader_cache::OPTIONS), so a linked pair is made like the pair it stands in for.
  • The linked pair is used only when every binding field equals the originals': root UAVs, the memory and heap flags and the view marks are compared too.

Checks on this head:

  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p victory-shader on WARP (VICTORY_WARP=1): 250 pass, 2 fail (gathers_at_a_level_match_the_hardware, permutes_read_the_lane_named_and_zero_from_lanes_left_out). Plain main 940d32f6 fails the same two on WARP (245 pass), so they are not from this PR. The run on the GPU itself is still queued; I will add it.

On the validator question from reboot0000-cmd, thank you for the write-up in #1945. What I see here:

  • The dxil.dll my counts use is the Windows SDK one, Windows Kits\10\bin\10.0.26100.0\x64\dxil.dll. Its FileVersion and ProductVersion are both 1.8.2502.11 (239921522), and dxc --version from the same folder prints dxil.dll: 1.8(1.8.2502.11). fxc.exe beside it is 10.0.26100.8249.
  • It behaves like the 1.8 row of your table: on merged main it reports 0 "Container part 'Pipeline State Validation' does not match expected for module". So the SDK folder name does not pin the engine; different 10.0.26100 revisions seem to ship different ones. Mine is not the 1.7.2308 build.
  • I have no other dxil.dll on this machine (no 1.9.2609), so I have not compared engines myself.

Counts on this head with that DLL, over the title's executable and shader archive (26,148 programs):

emitted validated
vertex + pixel 14,217 13,350
compute 2,696 1,961
mesh 8,765 8,694

The validator failures are 867 "Flags must match usage" (#1973), 735 compute "incompatible with the shader stage", and 71 mesh "vertex plus primitive output size is greater than 32768".

So I agree with your 71: the description's 53 was counted on ffe310e, when fewer mesh programs emitted. They stay 71 in this offline count because translate sees each program alone; the link happens when a pipeline is made. The pair numbers in the description (3,505 pairs for the 53) are from that older main and I have not re-run them on this merge. A program-by-program re-measure from you would be welcome.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151282522 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7151282522). Originally posted by [claude-GTA6](https://github.com/claude-GTA6) on 2026-11-25T02:51:44Z. --- *From a tester working with Claude (AI-assisted); measured on my own machine.* Merged current main (940d32f6) into the branch; the head is now 132eda67 and the PR shows as mergeable again. What the merge needed: - `lower::Parts` has `view_marks` next to `linked_cols` now (the conflict the triage named), in `lower.rs` and in the test literals. - `translate_linked` takes `Options`, and the GPU side passes the ones it translates every shader with (`shader_cache::OPTIONS`), so a linked pair is made like the pair it stands in for. - The linked pair is used only when every binding field equals the originals': root UAVs, the memory and heap flags and the view marks are compared too. Checks on this head: - `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p victory-shader` on WARP (`VICTORY_WARP=1`): 250 pass, 2 fail (`gathers_at_a_level_match_the_hardware`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`). Plain main 940d32f6 fails the same two on WARP (245 pass), so they are not from this PR. The run on the GPU itself is still queued; I will add it. On the validator question from reboot0000-cmd, thank you for the write-up in #1945. What I see here: - The `dxil.dll` my counts use is the Windows SDK one, `Windows Kits\10\bin\10.0.26100.0\x64\dxil.dll`. Its FileVersion and ProductVersion are both 1.8.2502.11 (239921522), and `dxc --version` from the same folder prints `dxil.dll: 1.8(1.8.2502.11)`. `fxc.exe` beside it is 10.0.26100.8249. - It behaves like the 1.8 row of your table: on merged main it reports 0 "Container part 'Pipeline State Validation' does not match expected for module". So the SDK folder name does not pin the engine; different 10.0.26100 revisions seem to ship different ones. Mine is not the 1.7.2308 build. - I have no other `dxil.dll` on this machine (no 1.9.2609), so I have not compared engines myself. Counts on this head with that DLL, over the title's executable and shader archive (26,148 programs): | | emitted | validated | |---|---:|---:| | vertex + pixel | 14,217 | 13,350 | | compute | 2,696 | 1,961 | | mesh | 8,765 | 8,694 | The validator failures are 867 "Flags must match usage" (#1973), 735 compute "incompatible with the shader stage", and 71 mesh "vertex plus primitive output size is greater than 32768". So I agree with your 71: the description's 53 was counted on ffe310e, when fewer mesh programs emitted. They stay 71 in this offline count because `translate` sees each program alone; the link happens when a pipeline is made. The pair numbers in the description (3,505 pairs for the 53) are from that older main and I have not re-run them on this merge. A program-by-program re-measure from you would be welcome. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-GTA6 commented 2026-11-25 03:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by claude-GTA6 on 2026-11-25T02:55:04Z.


From a tester working with Claude (AI-assisted); measured on my own machine.

Thank you for the port and the point-by-point read. The code_bytes doc comment is back on code_bytes in cd0da11b; linked keeps its own.

On a cache for the (mesh, pixel) pair: translate_linked returns early for every mesh program whose outputs fit, after parsing the container and measuring the signature, so nothing is re-emitted for those. Only pipelines of the over-limit mesh programs re-emit, both programs each time. In my runs of this title one such pair is bound, so I have not seen it in load time; a cache keyed by the pair is the right follow-up if a scene binds many.

On the validator: the comment just above yours has what I ran with (the SDK's dxil.dll here reports 1.8.2502.11 and shows no PSV0 mismatch), which fits your finding that 101.7.2308.24 fails those tests on plain main as well.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151356134 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7151356134). Originally posted by [claude-GTA6](https://github.com/claude-GTA6) on 2026-11-25T02:55:04Z. --- *From a tester working with Claude (AI-assisted); measured on my own machine.* Thank you for the port and the point-by-point read. The `code_bytes` doc comment is back on `code_bytes` in cd0da11b; `linked` keeps its own. On a cache for the (mesh, pixel) pair: `translate_linked` returns early for every mesh program whose outputs fit, after parsing the container and measuring the signature, so nothing is re-emitted for those. Only pipelines of the over-limit mesh programs re-emit, both programs each time. In my runs of this title one such pair is bound, so I have not seen it in load time; a cache keyed by the pair is the right follow-up if a scene binds many. On the validator: the comment just above yours has what I ran with (the SDK's `dxil.dll` here reports 1.8.2502.11 and shows no PSV0 mismatch), which fits your finding that 101.7.2308.24 fails those tests on plain `main` as well.
upstream-sync closed this pull request 2026-11-25 10:06:00 +00:00
StExpeditus commented 2026-11-25 10:07:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:22:23Z.


Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at cd0da11. cargo test --workspace --locked --no-fail-fast -> 701 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158241348 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7158241348). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:22:23Z. --- **Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24.** Branch at `cd0da11`. `cargo test --workspace --locked --no-fail-fast` -> 701 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.
KainanP commented 2026-11-25 10:07:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T10:01:09Z.


@claude-GTA6 this was closed a few minutes before StExpeditus's report, together with your other PRs, so I wanted to ask before doing anything: is it closed on purpose (a problem you found, or another PR replacing it), or would you reopen it?

It is still the only fix I could find for the 71 mesh programs over the 32 KiB output budget that keeps them drawing (#1385 narrows the maxima but its own census shows 71 before and after; #1961 turns them into refusals). I checked the column bookkeeping and the debug-layer linking constraint and found nothing wrong, and I wrote a GPU test for it: a 128-lane mesh program with 68 output components (34,816 bytes), whose unlinked module dxil.dll 1.8 rejects with "greater than 32768", while the linked pair validates, creates a pipeline and draws the expected values on an RTX 4060 Laptop and on WARP. On cd0da11 rebased onto main 940d32f with that test: RTX 702 passed / WARP 703 passed, the only failures being main's own #1835 ones.

If you'd rather not reopen it, I can open it again from my fork with your commits and authorship unchanged, the test on top as a separate commit, and a link back here — only if you're fine with that.

AI use: Claude Code (Claude Opus 5.5) reviewed the PR, wrote the test and this comment.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159112306 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7159112306). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T10:01:09Z. --- @claude-GTA6 this was closed a few minutes before StExpeditus's report, together with your other PRs, so I wanted to ask before doing anything: is it closed on purpose (a problem you found, or another PR replacing it), or would you reopen it? It is still the only fix I could find for the 71 mesh programs over the 32 KiB output budget that keeps them drawing (#1385 narrows the maxima but its own census shows 71 before and after; #1961 turns them into refusals). I checked the column bookkeeping and the debug-layer linking constraint and found nothing wrong, and I wrote a GPU test for it: a 128-lane mesh program with 68 output components (34,816 bytes), whose unlinked module `dxil.dll` 1.8 rejects with "greater than 32768", while the linked pair validates, creates a pipeline and draws the expected values on an RTX 4060 Laptop and on WARP. On `cd0da11` rebased onto main `940d32f` with that test: RTX 702 passed / WARP 703 passed, the only failures being main's own #1835 ones. If you'd rather not reopen it, I can open it again from my fork with your commits and authorship unchanged, the test on top as a separate commit, and a link back here — only if you're fine with that. _AI use: Claude Code (Claude Opus 5.5) reviewed the PR, wrote the test and this comment._
KainanP commented 2026-11-25 19:06:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T19:03:22Z.


#2398 (Texbirds) now covers this: it links over-budget mesh and pixel shaders at pipeline creation and is a merge candidate (tested on RTX, WARP, AMD and Intel UHD), so we won't revive this one from our fork. Thanks @claude-GTA6 for the original approach. AI use: Claude Code (Claude Opus 5.5) wrote this note.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171760104 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1563#issuecomment-7171760104). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T19:03:22Z. --- #2398 (Texbirds) now covers this: it links over-budget mesh and pixel shaders at pipeline creation and is a merge candidate (tested on RTX, WARP, AMD and Intel UHD), so we won't revive this one from our fork. Thanks @claude-GTA6 for the original approach. _AI use: Claude Code (Claude Opus 5.5) wrote this note._

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1562
No description provided.