GPU: zero pipeline stream padding before library comparison #3508
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!3508
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3508"
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?
@tharun-37 on GitHub · 2026-11-27 11:25 UTC · original
tharun-37:gpu/pipeline-stream-padding→main· +510 −21 · 1 files · 1 commits · openRefs #1683.
The pipeline library compares the whole description it is given, including bytes no subobject field reads. A stream built from the same state could therefore differ from the pipeline already stored under the same name, and a later load was refused.
This zeroes those unread bytes on the final stream, immediately before it is handed to
LoadPipelineorCreatePipelineState. It covers the gaps after subobject types, the tails of subobjects, the padding inside blend, depth-stencil and input-layout descriptions, and the mesh and vertex stream forms. It does not change the descriptions held inGraphicsState, so it is complementary to #2439.Two regression tests poison the computed padding with
0xaa, zero it, and check byte-for-byte that every padding byte was cleared and every field byte was left alone.Verification:
cargo test -p victory-gpu --lib: the two new tests pass; the suite has the same three pre-existing adapter-specific failures asmain, and one ignored test.cargo clippy -p victory-gpu --all-targets -- -A clippy::undocumented_unsafe_blocks -D warningsand the same with--features diagnostics: clean.git diff --check: clean.AI assistance (OpenCode) was used to draft the change and its tests; I reviewed the layout calculations and verified them locally.
@oni-swr on GitHub · 2026-11-27 11:46 UTC · original
WARP/CPU verification of #3508 (head
50043815624c873cdd2cd731546643820987a187, base63bcca43c6a00a758510398fa43096ce7e4f7df0= merge base = main tip). No physical GPU used. Claim on #1633.Environment: Windows 11 Pro 10.0.26200, WARP
d3d10warp.dll10.0.26100.9818, rustc 1.98.1,VICTORY_WARP=1+VICTORY_D3D12_WARP=1,dxil.dllfrom Windows SDK 10.0.26100.0 (VICTORY_DXIL). Command:cargo test -p victory-gpu --lib --locked --features diagnostics -j 4 -- --test-threads=1(thediagnosticsfeature is needed, otherwise the WARP variable is ignored).63bcca450043815New tests, both pass:
pipeline::host::tests::mesh_stream_padding_is_zeroed_without_touching_fieldsandvertex_stream_padding_is_zeroed_without_touching_fields. No new failure. I saw no failures on this lane at either commit (the PR text mentions three pre-existing adapter-specific failures; none showed up with WARP here), so there are no flakes to separate out.Findings:
host.rs; padding is zeroed on the final stream right beforeLoadPipeline/CreatePipelineState;GraphicsStateis untouched. The two tests check byte by byte that padding is cleared and field bytes are unchanged, for the mesh and the vertex stream forms.zero_padding,rawandraw_mutbuild a&[u8]/&mut [u8]over bytes that include uninitialised padding, which is strictly not allowed foru8;ptr::write_byteson the padding ranges would avoid it. Part of the diff is rustfmt reflow ofstream_pipelineunrelated to the change.Numbers are WARP/CPU only; no real-GPU effect measured.
AI use: Claude Code (Claude Sonnet 5.5). No game files, dumps, install paths, shader names or hashes were used.
@passerbyyhx on GitHub · 2026-11-27 18:56 UTC · original
Windows synthetic verification at
50043815624c873cdd2cd731546643820987a187.I exercised two real D3D12 pipeline-library streams in independent processes on RTX 4090 Laptop (621.14) and WARP. One used a depth-bounds vertex pipeline (62 padding bytes), the other a mesh pipeline (46). Each adapter ran 14 processes including the comparison paths.
Both streams stored cold and loaded warm across processes after changing the filler from AA to BB through the normalized path. Changing the sample mask gave a real miss and a successful fallback creation. A raw-stream bypass with the same padding change also hit on both drivers, as did a fixed reader opening the old raw library. These data verify canonicalization and cold/warm interoperability; the padding-only miss did not reproduce on either configuration.
Reproducible fixture. GTA-VI-3/EIGHT-20261127. AI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.