Prune unread varyings from oversized mesh pairs #870

Closed
Kamiloj9 wants to merge 1 commit from upstream-pr/871 into main
Kamiloj9 commented 2026-11-25 11:16:21 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Kamiloj9 on 2026-11-25T11:16:21Z.


Summary

  • Specialize an oversized mesh shader for the pixel shader actually selected for the pipeline. Remove only whole, uniquely matched generic varyings that the consumer never reads, and keep the original layout of retained elements.
  • Remap the DXIL signature IDs on both stages and require the host binding metadata to match the shared translations. Use both specialized blobs in the PSO and its library key.
  • Preserve the existing pipeline as a fallback while the device is live.

The mesh portion of #854 tackles the same limit with broader liveness filtering. This PR is scoped to the paired mesh fix. #397 uses FP16 packing and pixel-side reconstruction for inputs that cannot simply be dropped.

Verification

  • Windows cargo check --workspace --all-features, mesh-link and container unit tests, and staged asset policy.
  • Windows SDK DXIL validator accepted both stages of two captured pairs previously rejected for exceeding the 32 KiB mesh output limit. The crossed pair was declined.
  • Tested offline. No D3D12 PSO creation or gameplay run. The existing VICTORY_MESH_OUTPUT_STRICT experiment still rejects oversized standalone translations before runtime linking.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6603252034 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/871). Originally posted by [Kamiloj9](https://github.com/Kamiloj9) on 2026-11-25T11:16:21Z. --- ## Summary - Specialize an oversized mesh shader for the pixel shader actually selected for the pipeline. Remove only whole, uniquely matched generic varyings that the consumer never reads, and keep the original layout of retained elements. - Remap the DXIL signature IDs on both stages and require the host binding metadata to match the shared translations. Use both specialized blobs in the PSO and its library key. - Preserve the existing pipeline as a fallback while the device is live. The mesh portion of #854 tackles the same limit with broader liveness filtering. This PR is scoped to the paired mesh fix. #397 uses FP16 packing and pixel-side reconstruction for inputs that cannot simply be dropped. ## Verification - Windows `cargo check --workspace --all-features`, mesh-link and container unit tests, and staged asset policy. - Windows SDK DXIL validator accepted both stages of two captured pairs previously rejected for exceeding the 32 KiB mesh output limit. The crossed pair was declined. - Tested offline. No D3D12 PSO creation or gameplay run. The existing `VICTORY_MESH_OUTPUT_STRICT` experiment still rejects oversized standalone translations before runtime linking.
avt0m4t48 commented 2026-11-25 12:07:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T11:22:43Z.


Independent verification on 7e656a3c689f73ddaf823603cc178bdb8986df40 against f85101b6095e8cf3cecf8f0647cc7f5428daa177, using synthetic shader containers.

  • A 128-lane mesh with 128 declared vertices, sixteen four-component outputs, and one scalar at row 16, column 2 emitted a 33,280-byte output layout. With an unread pixel input matching that scalar, prune_mesh_pair emitted a 32,768-byte mesh layout and removed the input from the pixel signature. All sixteen retained signature records matched their originals. The standalone mesh and pixel DXIL were byte-identical across base and head.
  • The linker declined a different semantic index, a different component column, a mesh already below the limit, reversed stages, and mismatched host binding metadata.
  • Two separate bitcode IR tests checked that removed vertex stores disappear, later vertex store and pixel read IDs shift, primitive store IDs stay fixed, and a surviving loadInput or attributeAtVertex read of a removed ID rejects the remap before editing the module.

The Linux shader library suite passed 171 tests on base and 172 on head, with 2 ignored on each. The head also passed cargo check -p victory-shader -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --features blake3/pure on Linux. This run checked emission and compile-time behavior. Microsoft DXIL validation, D3D12 PSO creation, and Windows/GPU execution remain unverified by these fixtures.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7160966304 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/871#issuecomment-7160966304). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T11:22:43Z. --- Independent verification on `7e656a3c689f73ddaf823603cc178bdb8986df40` against `f85101b6095e8cf3cecf8f0647cc7f5428daa177`, using synthetic shader containers. - A 128-lane mesh with 128 declared vertices, sixteen four-component outputs, and one scalar at row 16, column 2 emitted a 33,280-byte output layout. With an unread pixel input matching that scalar, `prune_mesh_pair` emitted a 32,768-byte mesh layout and removed the input from the pixel signature. All sixteen retained signature records matched their originals. The standalone mesh and pixel DXIL were byte-identical across base and head. - The linker declined a different semantic index, a different component column, a mesh already below the limit, reversed stages, and mismatched host binding metadata. - Two separate bitcode IR tests checked that removed vertex stores disappear, later vertex store and pixel read IDs shift, primitive store IDs stay fixed, and a surviving `loadInput` or `attributeAtVertex` read of a removed ID rejects the remap before editing the module. The Linux shader library suite passed 171 tests on base and 172 on head, with 2 ignored on each. The head also passed `cargo check -p victory-shader -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --features blake3/pure` on Linux. This run checked emission and compile-time behavior. Microsoft DXIL validation, D3D12 PSO creation, and Windows/GPU execution remain unverified by these fixtures.
MamaLeVrai commented 2026-11-25 13:05:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T12:23:16Z.


Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 7e656a3 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins, depth_written, a sort; PR #841 fixes them), also with --all-features; this PR adds none. cargo test --workspace --locked: run 1: 556 passed, 0 failed, 11 ignored; run 2: stopped at indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (the one that fails on main itself most runs here (PR #849 and #847 fix its assertion)) (main alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.

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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162304234 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/871#issuecomment-7162304234). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T12:23:16Z. --- Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `7e656a3` into `main` `f85101b` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins`, `depth_written`, a sort; PR #841 fixes them), also with `--all-features`; this PR adds none. `cargo test --workspace --locked`: run 1: 556 passed, 0 failed, 11 ignored; run 2: stopped at `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields` (the one that fails on `main` itself most runs here (PR #849 and #847 fix its assertion)) (`main` alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
upstream-sync closed this pull request 2026-11-26 01:05:59 +00:00

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
fxceless/victory-fork!870
No description provided.