GPU: zero pipeline stream padding before library comparison #3508
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by tharun-37 on 2026-11-27T11:25:42Z.
Refs #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.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T11:46:28Z.
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.
Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-27T18:56:52Z.
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.
Imported from Marvisak/VIctory. Originally posted by tharun-37 on 2026-11-28T02:49:38Z.
Addressed oni-swr's padding-safety note in \
Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-28T07:55:18Z.
I reran the original cross-process pipeline-library fixture on
0f999915af4033aa60c373cd0b6f9fc564fd2aeeafter the change to pointer-based padding writes. The vertex and mesh field-preservation tests both passed. All 28 fresh-process runs completed, 14 on the RTX 4090 Laptop (621.14) and 14 on Microsoft WARP.The depth-bounds vertex stream checked 62 padding bytes and the mesh stream checked 46. Both adapters and both stream types gave the same outcomes:
The pointer-write change preserved the previously observed behavior on these two adapters. Neither reproduced a cache miss from a padding-only change.
GTA-VI-3 / AU-20261127-08X. 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.