Repository navigation
Conversation
…e keys A pipeline state stream carries DEPTH_STENCIL1/2's depth-bounds flag and DEPTH_STENCIL2's back-face stencil masks beside the graphics description, and create_graphics builds from them, but the console-stream cache key and order_key (pipeline_order.log, the prewarm plan) hashed the description alone. Two streams that differ only there shared a key. stream_graphics_key folds them in where they change the pipeline (back masks only when unlike the front's); a stream without them keeps its old key, so older order logs only miss the changed entries. New d3d12_pipeline_stream_key test. RT-STATE-PIPELINE-KEY-DS2, item 5 of kevincommits' RT-STATE-AUDIT-PIPELINE finding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Independent Linux/Wine + NVIDIA check at head
AI-assisted. |
Collaborator
|
Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked. Reading (marked):
Limits: one machine, one run for the PR, one run for each main witness. AI-assisted (Claude Code, Claude Opus 5.5) |
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: RT-STATE-PIPELINE-KEY-DS2 (#1608 (comment)), item 5 of @kevincommits'
RT-STATE-AUDIT-PIPELINEfinding (#2464 Part B, #1608 (comment)). Thanks to kevincommits for finding it.What and why
A pipeline state stream (
ID3D12Device2::CreatePipelineState) can carry state that the plainD3D12_GRAPHICS_PIPELINE_STATE_DESCcannot hold:DEPTH_STENCIL1/DEPTH_STENCIL2'sDepthBoundsTestEnable, andDEPTH_STENCIL2's per-face stencil masks.parse_pipeline_streamkeeps them beside the description (PipelineStream::depth_bounds,back_masks/back_stencil), andcreate_graphicsbuilds from them. But the keys were made from the description alone:GetCachedBlob), set for console-stream PSOs, waspipeline_key(stream.graphics);pipeline_order.logkey (order_key(PipelineStream), used by the order log and the prewarm plan from runtime: record the order of first pipeline requests (LEONIDA_PIPELINE_ORDER_LOG=1, RT-PIPELINE-PREWARM-ORDER phase 1) #2220/runtime: prewarm graphics pipelines in recorded order on the compile pool (RT-PIPELINE-PREWARM-ORDER phase 2) #2260) was that key with only the mesh shader folded in.So two streams that differ only in the depth-bounds flag, or only in the back face's stencil masks, got the same key, and the order log and prewarm plan mixed the two pipelines up.
stream_graphics_key(stream)(runtime/shims/d3d12_vulkan_device.cpp) is now the graphics key of a stream. It folds in the depth-bounds flag, and the back face's masks when they differ from the front face's (withoutDEPTH_STENCIL2the back face takes the front's, so equal masks build the same pipeline). Both the console-stream cache key andorder_keyuse it. A stream with neither keeps exactly the key it had, which is also the keyCreateGraphicsPipelineStategives the same description.Old order logs: every key stays the same except for streams with depth bounds on, or with back-face masks unlike the front's. In an older
pipeline_order.logsuch a pipeline is named by the plain key. That entry now simply finds nothing: the prewarm plan skips it and the pipeline is built on first use, as without a plan. Nothing misreads the log, and the next run's log has the new key.docs/d3d12_vulkan.mdsays so where the key is described.Not in this PR: the other items of the finding (6:
DEPTH_STENCIL2/RASTERIZER1/2in derived-PSO overlays; 7: depth bounds without a DSV), and the plainCreatePipelineStatepath, which sets an order key but no cache key. That last one is unchanged here.Tested
d3d12_pipeline_stream_key(runtime/test/d3d12_pipeline_stream_key_test.cpp, throughrt::d3d12::pipeline_stream_keys_for_test, parse only, no device). Synthetic streams: depth bounds on vs off; back-face masks unlike the front's (read or write) vs equal; and both at once. Each gets a cache and order key of its own. Off, or equal masks, gives the plainDEPTH_STENCILstream's key. With the fold taken out (keys as onmain) it fails with 7 failures; with it, it passes.pipeline_order,pipeline_prewarm,replay_pipeline_order_hook: pass.tests/test_ci_registration.py: pass. Full runtime build (RelWithDebInfo, MSVC): clean.GPUs tested: n/a (the new test only parses streams; the other tests are CPU-only). Build host: profile M (NVIDIA GeForce RTX 4070 SUPER, Windows 11).
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code