GPU: zero blend and depth-stencil padding the pipeline library compares #2439
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2439
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@makmatvey on GitHub · 2026-11-25 13:31 UTC · original
makmatvey:cursor/gpu-pipeline-desc-padding-d4e6→main· +167 −27 · 1 files · 1 commits · openWhat'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.
@oni-swr on GitHub · 2026-11-25 13:50 UTC · original
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.
@kotekompotek on GitHub · 2026-11-25 14:25 UTC · original
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.@Marvisak on GitHub · 2026-11-25 16:40 UTC · original · edited 2026-11-25 22:23 UTC
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
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.