GPU: zero pipeline library description padding #1690
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!1690
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1690/head"
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?
@Calvix2k on GitHub · 2026-11-24 20:46 UTC · original
Calvix2k:codex/gpu-pipeline-library-mesh-1683→main· +194 −24 · 1 files · 1 commits · closed without mergingRebased onto upstream
70564aeand reduced to the part that is still needed.Why: upstream commit
9c58a1cnow gives a mesh pipeline's topology explicitly, so mesh pipelines load from the library again. The two later commits here (per-kind refusal tracking and the in-flight store recheck) are therefore obsolete and were dropped; thanks @andrewpozdnakov7-jpg for the race fix, it was correct for the old state.What remains: the pipeline library compares raw description bytes, padding included. This zeroes the padding in the descriptions read from the title's stream, in the built depth-stencil description and in the mesh stream before handover. Authorship of the remaining commit stays with Pablo Barros.
Validation on
70564ae+ this commit:read_states_carry_no_paddingandstream_subobjects_carry_no_padding— passed.-D warningsandcargo xtask policy— passed.draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_viewfails on this machine, but it fails identically on plainorigin/main, so it is unrelated.@andrewpozdnakov7-jpg on GitHub · 2026-11-24 21:29 UTC · original
A worker can miss in the library, compile outside its mutex, then reach
StorePipelineafter another worker has disabled that kind. I added a recheck under the library mutex immediately before storing. The worker still returns the compiled PSO.634ecc3 is one commit directly on
1cd223804cb5edd393e8997ce64c510c9503baf2. The regression synchronizes two workers, injects the reload refusal, and uses a real WARP pipeline library for the stores. The PR head stored two entries in 10/10 runs. With the recheck, only the initial probe entry was stored in 10/10 runs. The full GPU suite passed 57 tests with one ignored. Strict GPU Clippy andcargo xtask policypassed.@Calvix2k on GitHub · 2026-11-24 21:40 UTC · original
Applied as ␀6487b7 on top of the PR, with your authorship preserved. Locally: cargo test -p victory-gpu 54 passed, 0 failed, 1 ignored (including the new regression), clippy -D warnings and cargo xtask policy clean.
The recheck under the library mutex before StorePipeline closes exactly the window between the miss and the store; thanks for the repro and the 10/10 before/after counts.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 21:45 UTC · original
A warm library can already contain a name whose descriptor differs from the current pipeline. In that case both the load and the duplicate-name store fail. At
06487b74b8dc8209c45d2653c7f23c0af3821d3athis also set the verdict for the whole kind toNO, even though the first successful store and reload were still untested.4a53788 is directly on
06487b7. It leaves the verdict pending when the store fails. The WARP test puts a real compute PSO in the library under an occupied name and requests a different shader under that name. Before the change the kind was disabled in 10/10 runs. After it, a fresh name could be stored and loaded in 10/10 runs. The GPU suite passed 58 tests with one ignored. Strict GPU Clippy andcargo xtask policypassed.@Calvix2k on GitHub · 2026-11-24 21:47 UTC · original
Rebased onto
70564aeand reduced to the padding fix only: upstream9c58a1cnow supplies the mesh topology, so the library loads mesh pipelines and the per-kind refusal / in-flight store commits (including your 634ecc3) are no longer needed. The padding zeroing is still required because the library compares raw bytes. See the updated PR body.@Marvisak on GitHub · 2026-11-25 03:34 UTC · original
Automated triage for the maintainers.
Needs work. The blend (3 bytes per target) and depth-stencil (2 bytes) padding ranges in
pipeline/host.rsare right. Two points:stream_paddingmisses the 4 bytes afterStream::blend(4 + 328 = 332, aligned to 336). The blend and depth descriptions are also moved intoStreamafter zeroing, which the PR's own comment says may rewrite padding.To change the verdict: add a WARP test that stores a pipeline built from junk-padded descriptions and shows
LoadGraphicsPipeline/LoadPipelinefailing before this change and succeeding after it, cover the blend tail, and drop the unrelated line re-wrapping inmesh_pipeline. CI passes.Generated by Claude Code
@Calvix2k on GitHub · 2026-11-25 08:37 UTC · original
Closing this: I could not substantiate the premise, and on a closer look it does not hold for our own path either.
make::key, which hashesGraphicsState::describe().describeformats the fields ({:?}of each struct plus explicit components), so padding bytes never reach the key; two states that differ only in padding already hash the same.CreateGraphicsPipelineStateandCreatePipelineLibrary/StorePipelinedo not read padding; the library is loaded by name, not by comparing descriptions, so "an entry stored with other padding bytes never loads" has no mechanism behind it.stream_paddingmisses the four bytes after the blend subobject (4 + 328→ 336), and the tests only compare the zeroed ranges with themselves.If a fixture exists that shows a load failing because of padding — a WARP pipeline library stored with junk in a field's padding and loaded with zeros — reopen with that and I will do the narrow fix. The
sample_mask/mesh rewrap in this branch is unrelated and should not ride along either.Pull request closed