GPU: zero blend and depth-stencil padding the pipeline library compares #2437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2439"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by makmatvey on 2026-11-25T13:31:06Z.
What's wrong
The host's pipeline library tells stored pipelines apart by the raw bytes of their descriptions, padding included.
GraphicsState::readcopied the title's blend (kind 8) and depth-stencil (kinds 11 and 21) descriptions as they stood, so the two bytes betweenStencilWriteMaskandFrontFace— and the write-mask padding in each blend target — carried whatever was on the title's stack. With the debug layer on, mesh pipelines of one run then differed from a copy of themselves only in that padding, andLoadPipelinerefused them (#1683).Closed attempts (#1041, #1690) did not land. Open #1739 clears final mesh-stream outer/nested padding after typed moves; it does not clean the descriptions held in
GraphicsStatethat the classic graphics PSO path and the stream both read from.What the change does
In
crates/victory-gpu/src/pipeline/host.rs:GraphicsState::default.Tests
read_states_carry_no_padding: reads kinds 21/11/8 from0xffbytes and checks padding is zero while fields keep the title's values; also checksDefault.ml64.exe, so Windows MSVC clippy/tests are left to CI.No game data was used.
Refs #1683. Complementary to #1739.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T14:01:08Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-gpu pipeline::host::tests: 3/3 passed on RTX 5090, 3/3 passed on WARP (includingread_states_carry_no_padding).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T13:50:09Z.
Verification — head
23059ca23ece8439f0a550092bd66537179a9341Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, DXC/dxil 1.8.2502.11 (Windows Kits 10.0.26100.0 x64).
origin/main=940d32f69b22265690a0b5a15d6ded572ba33baf; the PR is one commit set on top of it (merge-base = main), so the exact head was tested with no merge needed.cargo test -p victory-gpu --lib --features diagnostics -- --test-threads=1: 147 passed, 0 failed, 2 ignored (+1 vs main: the newpipeline::host::tests::read_states_carry_no_paddingran and passed; it needs no device).-p victory-gpu --all-targets -D warningswith and withoutdiagnostics: clean.cargo xtask policy: ok.VICTORY_D3D12_WARP=1and--features diagnostics(the switch has no effect without that feature),-- --test-threads=1;warp_adapter_accepts_only_softwareran and passed (adapter vendor 0x1414, software flag). Baselineorigin/mainfor the same command: 146 passed, 0 failed, 2 ignored.pipeline/host.rs.Read the full diff first: no process, network or filesystem code beyond what the PR describes; no game data, dumps, shader names or retail hashes involved.
Verified by Claude Code (Claude Sonnet 5.5), an AI assistant; this is a test report, not a code review or approval.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:16Z.
Review: COMMENTED
Zero blend/depth-stencil padding the pipeline key ignores. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:25:56Z.
Reviewed — the padding analysis is exact:
RenderTargetWriteMask(37..40 per 8 targets), depth-stencil = 2 bytes afterStencilWriteMask(18..20, leavingStencilReadMaskat 16 alone). Both computed viaoffset_of, so layout drift can't silently break them.Sub's own 4-byte pad after the type tag is stream framing (8-byte-aligned wire format), not part of a compared description — correctly untouched.Defaultand at every stream-read site (kinds 8, 11, 21), so no construction path carries title-stack garbage into a stored description.0xffsubobjects and asserts zeroed padding + intact fields, plus the default state — covers the whole mechanism.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T16:40:25Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflict incrates/victory-gpu/src/pipeline/host.rs). It will be reviewed again once it is rebased.From the earlier needs-work note, still open: drop the unrelated rustfmt reflow, and zero the padding in the final description just before it is created or stored, since moves may not keep the zeroed bytes.
Generated by Claude Code
Pull request closed