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>
|
Independent Linux/Wine + NVIDIA check at head
AI-assisted. |
|
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) |
|
Reviewed at head Verification
Finding (Request changes)
AI-assisted review + local MSVC verification. |
timbot103's review of ProjectLeonida#2477: the public stream path made its PSO without set_cache_key, so GetCachedBlob gave an empty key for every stream PSO (the stream key test calls the key helper directly and did not see it). CreatePipelineState now sets the same key prepare_console_stream sets: pipeline_key for a compute stream, stream_graphics_key (with the depth bounds flag and back-face stencil masks) for a graphics or mesh one. d3d12_compute_test: a compute PSO made through CreatePipelineState gives the same GetCachedBlob bytes as the one CreateComputePipelineState makes from the same root signature and CS, and that blob is accepted back as CachedPSO. It fails without the fix. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@timbot103 thanks, you were right: the public
No game files used. AI-assisted (Claude Code). |
…k oracle (TEST-545) tests/semantic/test_valu_div_fixup.py compared a hand-written Python model of the fixup against itself and never imported tools/rdna2spirv.py, so it passed whatever the translator did, and its rules had drifted from native RDNA2 (gfx1036) on six points (NaN priority, the sign of 0/0 and inf/inf, inf(S2), the copysign of the pass-through, NaN(S0), and the exponent-difference cutoff). It now translates hand-written listings and asserts what the translator emits: the pure-integer lowering's op order and classification constants, NaN(S2) above NaN(S1) read off the dataflow, one word per measured rule through spirv_mini_interp, and the EXEC-masked and null-destination cases. The f16 model is gone rather than ported: the translator has no v_div_fixup_f16 lowering yet (ProjectLeonida#2477 adds it with its own translator tests). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
lixonik
left a comment
There was a problem hiding this comment.
Reviewed and verified at head 19186132a (Windows 11, MSVC 19.44, Ninja Release, LEONIDA_VK_VALIDATION=1).
Verification
- Built
d3d12_pipeline_stream_key_test,d3d12_compute_test, andgta6rt. ctest -R "^(d3d12_pipeline_stream_key|d3d12_compute)$"(LEONIDA_VK_VALIDATION=1): 2/2 passed (0 validation errors).python -I scripts/check_no_game_data.py: clean.
Review notes
stream_graphics_keypreserves exact key compatibility when neither depth bounds nor differing back-face stencil masks are present, and folds both fields cleanly into both cache (GetCachedBlob) andpipeline_order.logkeys when active.ID3D12Device2::CreatePipelineStatenow sets the same cache key asprepare_console_streamand the description paths, and the newd3d12_compute_testround-trip verifies byte-identicalGetCachedBloboutput accepted back viaCachedPSO.
GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341, VK_LAYER_KHRONOS_validation 1.4.363).
AI-assisted (Antigravity, Gemini).
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