Pipeline library: some names are stored with a description that differs on the next run (Load mismatch, then StorePipeline 'already exists') #780
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#780
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Sil3ntGam3r on GitHub · 2026-11-24 10:33 UTC · original
finding: some pipelines are stored in the pipeline library under a name whose description differs on the next run, so they are compiled again instead of loaded.
Seen. With
VICTORY_D3D12_DEBUG=1and a pipeline cache warmed by an earlier run of the same build, the debug layer reports pairs of warnings while graphics pipelines are made:ID3D12PipelineLibrary::Load*Pipeline: The pipeline state desc provided does not match the one used to create the PSO stored with name "<name>"ID3D12PipelineLibrary::StorePipeline: A pipeline with name "<name>" already exists in the library47 such warnings in one run, against about 770 pipelines made or loaded. The effect is that those pipelines are compiled again on every run (the library keeps its older entry); nothing is drawn wrongly as far as I can tell.
Where.
crates/victory-gpu/src/pipeline/library.rs:100(name) hashes the kind, the root signature blob, the shader code andGraphicsState::describe()(pipeline/host.rs:174); the graphics description is built atpipeline/host.rs:489, the mesh stream inmesh_pipeline.Ruled out by reading the code (not by a run). Every field of the graphics description and of the mesh stream is in
describe(), and the root signature blob in the name is the one the root signature object is created from (root_signaturereturns both from one serialization). So I have not found what differs. Finding it needs a run that logs the name and the full description at each store and at each mismatch, two runs, and a diff.Related, minor.
describe()records the title's topology, while the description mapsRECTANGLES/QUADStoTRIANGLE. That only gives one description two names, not a mismatch.Setup and limits. RTX 3070, driver 621.14, Windows 11. Tree: main
8e79c80plus several open PRs (listed in my comment on #439), so it may come from one of them; not checked on plainmain. Reproducing needs the game files (a warm pipeline cache, then a second run with the debug layer).AI-assisted; run on my machine.
@BastienRodz on GitHub · 2026-11-24 11:04 UTC · original
Possibly a known cause, if the 47 pairs are mesh pipelines: #352 found that a mesh pipeline never loads from the library.
LoadPipelinerefuses it with the same "does not match the one used to create the PSO" (972), even with the very stream it was made from, unless the stream has aPRIMITIVE_TOPOLOGYsubobject that isn'tUNDEFINED; the store is then refused with "already exists" (970). That's the pair you see, every run. #352 adds the topology (triangles, which is allmesh_prologuemakes) and gives mesh entries a new library name.A quick way to tell, on your next warm run: if the names in the warnings are those of mesh pipelines (
mesh_pipeline), #352 should remove them. If some are VS/PS graphics pipelines, there is a second cause, and the name/description log you describe is the way to find it.AI-assisted (Claude Code); from reading the code and #352, not run.
@Kegwed on GitHub · 2026-11-24 11:27 UTC · original
Found it: the mesh pipeline stream leaves the primitive topology out, and the pipeline library cannot load back a mesh pipeline whose topology is undefined.
Standalone repro (no game files). A trivial mesh + pixel shader compiled with DXC 1.9 (
ms_6_6/ps_6_6), a stream laid out likemesh_pipeline's, oneID3D12PipelineLibrary1:CreatePipelineState→StorePipeline→LoadPipelinewith the same stream returnsE_INVALIDARG("desc provided does not match"). Variations, each from a fresh library:LoadPipelineUNDEFINEDgiven explicitlyTRIANGLELINE(shader outputs triangles)Reusing the same root signature object or a copy of the code changes nothing, and a serialised-then-reopened library behaves the same. Any defined topology makes it load. Translated mesh shaders always output triangles (
mesh_prologuerefuses others), so the fix adds aPRIMITIVE_TOPOLOGY = TRIANGLEsubobject.This means every mesh pipeline was compiled again on every run, not only the names you saw twice: the warning pairs only show for names requested more than once within one run.
In the title (RTX 3060 Laptop, driver 621.01, Windows 11,
mainatffe310e, diag build,VICTORY_D3D12_DEBUG=1, scripted keys into the world, each run stopped 4 min after loading the world):The few remaining "already exists" are two workers creating the same new pipeline at once (both loads miss before either stores), a separate and harmless race.
Branch: https://github.com/Kegwed/VIctory/tree/gpu/mesh-pipeline-topology (commit
38ea605onffe310e; PR creation is limited to collaborators) — one file (crates/victory-gpu/src/pipeline/host.rs): the stream becomes a module-levelMeshStreamwith the topology subobject, plus a unit test that the stream names a triangle topology.cargo test -p victory-gpu --features diagnosticspasses (54 passed, 1 ignored),cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warningsis clean,cargo xtask policyok.I first suspected uninitialised padding in the stream (it has some); zeroing it changed nothing (135 mismatches), so it is not part of the fix.
AI-assisted (Claude Code); runs on my machine, no game data in the branch or here.
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 11:30 UTC · original
The 972/970 mismatch is caused by mesh pipeline state streams lacking an explicit PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE subobject, which D3D12 LoadPipeline requires to match stored PSOs (as documented by @rhuantac in #352 and #264), combined with uninitialized RTFormats past NumRenderTargets. Resolved and verified in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/17.
@Bullet18x on GitHub · 2026-11-24 19:49 UTC · original
Same on an RTX 5090 (driver 621.40, Windows 11 10.0.28000),
mainffe310e: a warm run withVICTORY_D3D12_DEBUG=1gives 350× id=972 and 358× id=970. With #352 applied: 0 and 5. With #1041: 288 and 211. Numbers and protocol in my comment on #352.@Marvisak on GitHub · 2026-11-25 03:52 UTC · original
Automated triage for the maintainers. Fixed in
main. As found in the comments, the warning pairs (972 then 970) came from mesh pipelines: the library cannot load a mesh pipeline whose stream has no primitive topology. Commit9c58a1c("mesh pipelines load from the library") adds aPRIMITIVE_TOPOLOGYsubobject to the stream inmesh_pipeline(crates/victory-gpu/src/pipeline/host.rs). The few "already exists" warnings left come from two workers creating the same new pipeline at once, which is harmless.If a warm run on current
mainstill shows "does not match" for vertex/pixel pipelines, please post the names and this can be reopened. Proposed for closing as fixed inmain. It will be closed in 48 hours unless the reporter replies or a maintainer removes the label.Generated by Claude Code