Repository navigation
d3d12: LEONIDA_STUB_PIPELINES, a pipeline without a translated shader is a no-op stub (boot past stop 18) - #7417
rafaelpssz wants to merge 5 commits into
Conversation
… shader as a no-op stub A diagnostic switch for following a boot without translated shaders. When a graphics or compute pipeline has no shader library, or no library entry for its program, CreateGraphicsPipelineState / CreateComputePipelineState return S_OK with a pipeline that is never registered: SetPipelineState then binds no PSO and the draws and dispatches recorded with it are no-ops (D3D-482). Off by default; every other refusal is unchanged. d3d12_stub_pipelines_test: with no library, a graphics PSO is E_FAIL with the switch off or "0", S_OK and unregistered with it on, and a bad description is still E_INVALIDARG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows + GPU test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
Xiiano
left a comment
There was a problem hiding this comment.
Copilot:
Review complete. Verdict: approve / no blocking findings. The diff is narrowly scoped, preserves existing validation and refusal behavior, and the added test covers the switch's off, explicit-zero, enabled, unregistered-stub, and invalid-description cases. There are no existing review comments; all five CI checks were still queued.
|
Independent native Windows 11 dual-GPU review of Environment
Results
Non-blocking notes
Synthetic tests only, no game data. AI-assisted. |
…4996 under MSVC /W4) KarolKurzyna's review on ItsNotRexed#7417. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@KarolKurzyna thanks for the two-GPU run. 1: fixed in 9c99166. The switch is now read with |
|
Source review at Please return E_INVALIDARG for ambiguity before calling stub_or, and add a synthetic loaded-library case with two differing translations for one bare kind-6 program. That would keep this diagnostic limited to missing translations as described. AI-assisted source review. I checked this branch directly; I have not built or run this PR. |
A bare kind-6 program whose translations differ has translations; it is refused with E_INVALIDARG even with the switch on, as the description says. Only a missing translation becomes a stub. d3d12_fspx_compute_test checks both with a loaded library: an unknown kind-0 state is stubbed, the ambiguous bare program is still refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Alpha325 Good catch, thanks. Fixed in 780d1a4: in I added the synthetic case to |
|
Independent Windows GPU check of PR #7417 at
Synthetic fixtures only. Retail boot and PresentX were outside this check. AI-assisted with Codex. |
Only the PR's own commit is applied (its branch also carries 49 newer main commits, left out). Slot 57 handler and its dispatch added beside slots 17-24 and the lease/initial-state code; in the Vulkan layer the new FSSM/FSPX lookup keeps ItsNotRexed#7417's stub_or on both 'no translated shader' paths. device_proxy_test: the fspx_gfx spv filename check expects the folder prefix the loader adds. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
finding: with a stubbed pipeline, a dispatch or draw is not a no-op on main's replay. AI-assisted (Claude Code). |
|
Heads-up from testing The comment in Tracking |
|
Tested 780d1a4 (as merged in |
…wn containers
Slot 57 (desc, riid, out) gets a 0x108-byte description: root signature, state
blobs A and B, and seven {code, records} stage blocks (layout from issue ItsNotRexed#7496,
contents from ItsNotRexed#7049). Each stage's records carry the source container's HASH
digest; tools/native_pso_hashes.py (run by the shaders stage) maps digests to
containers in <spirv>/native_hashes.txt, and the proxy hands those containers
to PC CreateGraphicsPipelineState (VS/GS/PS) or a Device2 MS stream, so the
Vulkan device finds the translated modules by fssm_sha256 as for a PC title.
Blob B gives formats, sample state, topology and the input layout; blob A is
not decoded (blend off, cull none, depth ALWAYS). An unresolved stage refuses
with E_NOTIMPL, or with LEONIDA_STUB_PIPELINES set asks the device for ItsNotRexed#7417's
stub; LEONIDA_NATIVE_PSO=0 refuses every call. The returned pointer must be
even (the title stores it shifted right by one).
Tests: native_pso_test (portable), xs_native_pso_test (mock device through the
proxy, under Wine), tests/test_native_pso_hashes.py; all inputs hand-built.
… list stays valid LEONIDA_STUB_PIPELINES documented a stub's draws and dispatches as no-ops, but SetPipelineState on a stub left no pipeline bound, so record_draw, record_dispatch and DispatchMesh marked the list invalid and Close returned E_INVALIDARG: the whole list was dropped at ExecuteCommandLists. Reported by AAyberkU and TanmaySatyam on ProjectLeonida#7417. The command list now knows when the bound pipeline state is a stub (pipeline_is_stub: this device's pipeline state holding no pipeline) and records nothing for DrawInstanced, DrawIndexedInstanced, Dispatch, DispatchMesh and ExecuteIndirect while it is bound. With no pipeline state at all the same calls still make Close fail. d3d12_stub_pipelines_test: red before the change (Close == S_OK fails at the two stub lists), green after; the control (no pipeline state) stays E_INVALIDARG. With d3d12_draw, d3d12_compute, d3d12_close_parity, d3d12_execute_indirect_validation, d3d12_bundle, d3d12_bundle_forbidden and command_list: 8/8 pass on this head and on main f5bcc67 (clang-cl, RTX 3060 610.88). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@AAyberkU @TanmaySatyam you were both right: a stub's draws and dispatches marked the list invalid and Fixed in
The test now binds the stub, draws and dispatches, and checks One thing I could not do: run it on current @sh1shu1 that explains the one failing |
Two conflicts in runtime/shims/d3d12_com.cpp, both additive: - ExecuteIndirect: main's new argument validation is kept, and the stub return stays after it. - command list members: stub_pipeline_ next to main's descriptor heap members. d3d12_com.cpp and d3d12_stub_pipelines_test.cpp compile on the merged tree. The D3D12 library as a whole does not link here: d3d12_vulkan_device.cpp has main's own two errors in create_console_descriptor_heap.
|
Tried to build and run It does not compile, so the test could not run: My reading: the merge this branch carries ( So this one needs a rebase onto the new No game files. Approved by @fortkolbast1. AI-assisted. |
Claimed in the coordination issue: #7231 (comment)
No dependency any more: #7007, which made every draw or dispatch with no PSO bound a no-op, was closed. Since
f8dad8586the command list drops a stub's draws and dispatches itself, so the list stays valid onmainas it is.What and why
The retail title creates every pipeline it needs at boot. One of them is
XboxBvhBuilder.dll's 52 compute programs (stop 18 of the boot chain). If a single creation fails, the title stops: the builder throws a C++ exception, and other sites assert. To follow the boot past that point, every pipeline currently needs its translated shader inLEONIDA_SHADERS. That means a full translation, and running those shaders on the GPU. On a machine whose GPU also drives the display, a bad shader can hang it.With
LEONIDA_STUB_PIPELINES=1, a pipeline whose translated shader is missing is created as a stub. That covers two cases: no shader library at all, or no library entry for this program. The stub is aPipelineStatethatcreate_graphics/create_computereturnS_OKfor before any Vulkan pipeline is built. It's never registered, so:compute_pipeline_id/graphics_pipeline_idgive 0;SetPipelineStatebinds no PSO;pipeline_is_stub) and records nothing forDrawInstanced,DrawIndexedInstanced,Dispatch,DispatchMeshandExecuteIndirectwhile it is bound.Closesucceeds and the list holds none of them. With no pipeline state bound at all, the same calls still makeClosefail, as before.No game shader is translated or run, and nothing the title draws reaches the screen. Like
LEONIDA_SKIP_INT3, this is a diagnostic for finding the next boot stop, not a way to play.0or empty is off too.[rt] d3d12: LEONIDA_STUB_PIPELINES: compute pipeline without a translated shader is a no-op stub (64 so far).On the retail executable (my own copy, local integration tree with the open boot PRs), the switch takes the run past stop 18. The builder's programs and the title's 64 compute pipelines are stubbed, and the title gets as far as recording frames and reaching
PresentX. Integration report: #7231 comment 7107135285.Changes
runtime/shims/d3d12_vulkan_device.cpp:stub_pipelines()andstub_or()inPipelineState, used at four places:create_graphics;create_compute;create_graphics;create_compute.runtime/test/d3d12_stub_pipelines_test.cpp(new), registered next tod3d12_draw, with skip code 77 when there is no Vulkan device. WithLEONIDA_SHADERSunset, it checks a graphics PSO description:E_FAILand no object;0: the same;1:S_OK, an object, andgraphics_pipeline_id/compute_pipeline_id0;E_INVALIDARG.runtime/test/d3d12_fspx_compute_test.cpp: with a loaded library and the switch on, a compute PSO whose kind-0 state has no translation is stubbed (S_OK), while the bare kind-6 program with two differing translations (ambiguous) is stillE_INVALIDARG.runtime/shims/d3d12_com.cpp,d3d12_com.h:pipeline_is_stub, andstub_pipeline_in the command list, set bySetPipelineStateandReset. A stub no longer logs "pipeline from another device".runtime/test/d3d12_stub_pipelines_test.cppalso binds the stub, draws, draws indexed and dispatches, and checksClose() == S_OKwith no recorded command. The control is the same draw with no pipeline state:E_INVALIDARG.docs/boot.md: the switch, next to the other diagnostic switches.Tested
Windows 11 Pro 26200, RTX 3060, clang-cl/xwin cross build (MSVC 14.44 headers), RelWithDebInfo:
d3d12_stub_pipelines_test: PASS.d3d12_vulkan_device.cppchange stashed, it FAILs at theS_OKand object checks.d3d12_fspx_compute_test: PASS. With the ambiguity return reverted (ambiguous program stubbed), it FAILs at the ambiguous check.f8dad8586(the stub's draws and dispatches): with thed3d12_com.cppchange reverted, the test FAILs at bothClose() == S_OKchecks; with it, PASS. Together withd3d12_draw,d3d12_compute,d3d12_close_parity,d3d12_execute_indirect_validation,d3d12_bundle,d3d12_bundle_forbiddenandcommand_list: 8/8 pass, on this head and with the same change onmainf5bcc679d.mainf48adad76:runtime/does not compile there with this toolchain (three errors aroundcreate_console_descriptor_heap, in files this PR does not touch).Thanks
Closefail, against the description. Fixed inf8dad8586along the lines TanmaySatyam suggested (a stub flag on the list).C4996onstd::getenv, fixed by reading the switch withGetEnvironmentVariableW, and noted that the compute and loaded-library paths had no test.E_INVALIDARG, with a synthetic loaded-library test.Closeon a stubbed list.