Skip to content

Prune unread varyings from oversized mesh pairs - #871

Closed
Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/prune-oversized-mesh-pairs
Closed

Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/prune-oversized-mesh-pairs

Conversation

@Kamiloj9

Copy link
Copy Markdown

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.

Specialize only the selected mesh and pixel stages when whole unread varyings bring the mesh output under the D3D12 size limit. Preserve binding metadata, other signature elements, and independent shader translations.

(cherry picked from commit 1e0ce45f2b8e95074459d4ccf10589083e9669c5)
@avt0m4t48

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

tototomate123 pushed a commit to tototomate123/victory-fork that referenced this pull request Nov 25, 2026
PiloteCode pushed a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…sor-range

GPU: extend HostHeap wraparound search range to cursor bounds (fixes fxceless#871)
@Kamiloj9 Kamiloj9 closed this Nov 26, 2026
@Kamiloj9
Kamiloj9 deleted the codex/prune-oversized-mesh-pairs branch November 26, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants