Repository navigation
d3d12_xs: slot 57 DeserializeGraphicsPipelineStateX, fspx_gfx index, and pipeline blob input layout - #8890
d3d12_xs: slot 57 DeserializeGraphicsPipelineStateX, fspx_gfx index, and pipeline blob input layout#8890RipcuBAN wants to merge 1 commit into
Conversation
…and pipeline blob input layout
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Verified on Windows 11.
- Critical boot progress fix for retail graphics PSO deserialization in
untime/shims/d3d12_xs_device.cpp:- Accurately decodes 13-qword \XboxNativeGraphicsPipelineStateDesc\ for \ID3D12Device\ slot 57 (\DeserializeGraphicsPipelineStateX).
- Correctly pairs Stage 2 (pixel shader) and Stage 4 (vertex shader) against measured boot PSOs (8916, 8917, 12511), looking up binaries via \sha256\ in <shaders>/fspx_gfx/index.json.
- Parses 188-byte pipeline input layout safely with bounds validation, guarding against truncated final descriptors.
- Non-intrusive logging for unconfirmed state blob offsets without inventing state assumptions.
- \compileall, \git diff --check, and clean-room checks pass.
LGTM!
|
Reproduced a real test failure on head Defect
Root cause
e.spv_file = prefix + spv->string;(which ps_entry->spv_file == "9e5ffd2c6c521c03_libps_00842.spv"
vs_entry->spv_file == "160fbe4368fb1a63_libvs_00843.spv"Steps to reproduce
AI-assisted. |
|
Offline cache coverage check on f1ab75a, before a runtime comparison. Our existing translated work folder has 26,566 root entries, a compute-only library, and no fspx_gfx/index.json. For the first three boot graphics records, none of the five distinct stage/program pairs matched a same-stage root fssm_sha256 using either the whole native program or its extracted instruction range. Across all 18,838 distinct graphics stage/program pairs, both exact-match counts were zero. These hashes cover different representations, so this only rules out direct rekeying by those two byte ranges. Does your local fspx_gfx producer also resolve the source graphics interface, and is there a reproducible command for producing the index from the player's work folder? No runtime or frame result from this comparison. AI-assisted. |
|
checked: Wine 11.22 / RTX 5070 Ti / NVIDIA 620.73.04, offline. base: dd44a4b53 boot integration with #7685, #7448, #8591, #7880, #8458 and #8763, plus adapted runtime hunks from f1ab75a. shader_library CTest passes. The full private graphics catalog contains 16,684 SPIR-V-validated modules from 18,837 graphics programs attempted. With original #8890 parsing and the five modules for the initial checks, one PSO that had translated stages reached the device but returned E_INVALIDARG for an invalid vertex attribute format. With the parser from #8754 wired to the same runtime path and the full catalog, all 10,241 slot-57 calls in that retail run reached CreateGraphicsPipelineState and returned S_OK. No missing-stage or invalid-layout message was emitted. The title still presented black at both the 45 s and 95 s screen samples. This measures PSO creation and does not validate the guessed fixed-function state or explain the remaining black frames. AI-assisted. No game files, blobs, identifiers, images or trace lines attached. |
|
Follow-up on the first three boot graphics records: each of their five stage records resolves to exactly one source container using the library stage digest and the carved container HASH. With those source interfaces beside the local disassembly, the translator at 867d922 produced 3 VS and 2 PS modules, all five passing spirv-val. Each generated fspx_code_sha256 matches the full native program bytes independently. This gives a five-entry private fspx_gfx index for a bounded runtime comparison. Pipeline creation and presented pixels remain unmeasured with that index. AI-assisted. |
|
I'd like to test this on Linux + Wine 11.21 with a GTX 1650 Mobile (4 GB, NVIDIA, 32-wide subgroups only), on One question before I build: how do you generate Once I can build it, I'll post: slot-57 calls served and refused, whether the first draws appear, and how far the boot gets, 2 runs each with and without this PR. AI-assisted. No game data. |
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>
|
@gkissel For the five-module Windows check, I used the program bytes and code_range from tools/shader_library.py, matched each stage digest via carve_digests on the dxbc work folder, and put the matching source .dxbc beside disasm/ under the same stem. These are the operations of |
|
Thanks @kacper-serewis, that is what I needed. I will build AI-assisted. |
|
Windows offline retail comparison, RTX 5070 616.56, MSVC 14.50. Private boot stack at 4ecae894d plus its recorded local changes and #8890 f1ab75a. Each measured run issued 25,450 slot-57 calls. On the same instrumented executable the empty graphics index served 0 calls; adding only the five verified modules served 4. With the same five modules and #8754 at 4a04398 wired into the runtime handler, 5 calls returned S_OK. The remainder returned E_INVALIDARG in each run. Full swapchain RGB readbacks were black in all 539, 375 and 337 images respectively. One additional launch stopped before slot 57 and was excluded from this comparison. All reached runs ended at a breakpoint within the 75 s bound. These are five-module results; the full-catalog Wine run above measures a different configuration. One synthetic discrepancy on my integration: device_proxy_test fails its two custom-filename comparisons because spv_file contains the fspx_gfx/ prefix while the test expects a bare filename. Both forms can be checked independently via a real module read. AI-assisted. |
|
Checked the bare-program code-base path on A bare graphics stage with A hand-written pixel shader using The bare graphics path needs to retain the matching native program bytes for that upload, as the compute path does. The same synthetic shader would make a regression fixture for creating a PSO and reading back its embedded constant. AI-assisted. Synthetic input only. |
|
For the state blob (pair 0), which this PR records but doesn't turn into PSO state: #8507 decodes it.
One measurement that supports keying by bytes (Windows 11, RTX 5080,
That's the same PS-first order you measured on records 8916/8917/12511. So besides the program hashes, a handler can also find the exact record, and with it the decoded blend/depth state, from the state blob's bytes. There are 5,680 distinct state blobs. AI-assisted (Claude Code). |
|
Windows retail integration result for
The local index used the normal translator output filenames, keyed by |
|
Coverage detail while building the full catalog on Windows: 12,062 of the 25,471 graphics library records reference a mesh program (10,726 MS+PS and 1,336 MS only). At f1ab75a the stage lookup can return ms, but the slot-57 handler assigns VS, PS or GS only; a resolved ms takes the same E_INVALIDARG path as a missing stage. This is a static library count, not the number of mesh records reached on boot. Separating known-but-unsupported MS from lookup misses in the counters would make full-cache results easier to interpret. AI-assisted. |
Summary
Adds measured support for Xbox
ID3D12Deviceslot 57 (DeserializeGraphicsPipelineStateX,+0x1c8, measured at RVA0x2477578) and<shaders>/fspx_gfx/index.jsonloading for native RDNA2 graphics stages (vs/ps/ms/gs), along with full documentation of the measured slot-57 blobs indocs/fspx.md.Unlike
slot 67(DeserializeComputePipelineStateXat RVA0x24800d5), which falls back toslot 62(CreateComputePipelineStateat RVA0x247fe66) whenslot 67fails,slot 57at RVA0x2477578has no fallback: on a negativeHRESULT(test r14d, r14d; js 0x2477a07) it leaves the PSO entry in the title's table null, causing a null graphics PSO dereference (mov r14, [rax+0x68]at RVA0xb5a5f8) once boot shader creation finishes and offlinexgamesaveinitialization begins.Measured Facts Included
ShaderLibrary<shaders>/fspx_gfx/index.jsonloading (runtime/src/shader_library.h):{fspx, bvh}to{fspx, fspx_gfx, bvh}.fspx_gfx_size()sofspx_size()(computefspx/),fspx_gfx_size()(graphicsfspx_gfx/), andbvh_size()(bvh/) remain separate.spvfilename overrides inShaderEntry(wherefspx_gfx/index.jsonuses the 64-characterfspx_code_sha256as the JSON key and stores<sha256[:16]>_lib(ps|vs)_<id>.spvinspv).PipelineState::create_graphicsfallback for bare RDNA2 program blobs vialibrary->fspx_candidates(stage.name, hash)(runtime/shims/d3d12_vulkan_device.cpp).Xbox
slot 57(DeserializeGraphicsPipelineStateX) layout (0x68bytes, 13 qwords) (runtime/shims/d3d12_xs_device.cpp,docs/fspx.md):+0x00:ID3D12RootSignature*+0x08/+0x10:state_blob(388 Bin boot PSOs 1–2,380 Bin boot PSO 3; magic0x4005d800/0x4005d808/0x4005d810)+0x18/+0x20:pipeline_blob(188 B/0xbcin boot PSOs 1–3; contains vertex input layout)+0x28/+0x30:prog_a(native RDNA2 program Add pytest regression tests for the RDNA2 -> SPIR-V translator, plus a Linux CI job #1, ornullptr/0in VS-only PSOs such as boot PSO 3)+0x38/+0x40:stage_a(kind-2 stage blob Add pytest regression tests for the RDNA2 -> SPIR-V translator, plus a Linux CI job #1, e.g.208 B, ornullptr/0)+0x48/+0x50:prog_b(native RDNA2 program Vulkan tools: fix builds on Linux #2, e.g.320..384 B)+0x58/+0x60:stage_b(kind-2 stage blob Vulkan tools: fix builds on Linux #2, e.g.752 B)8916,8917,12511), pair 2 (+0x28/+0x30,448 B/768 B) is the pixel shader (ps) and pair 4 (+0x48/+0x50,384 B/320 B) is the vertex shader (vs). Stage assignment is therefore taken fromentry->stageinfspx_gfx/index.jsonbysha256(program_bytes), never assumed from blob position.ID3D12Device4::CreateProtectedResourceSessionforwarding on slot 57 whenriid != IID_ID3D12PipelineState.Measured
188 B(0xbc)pipeline blobinput-layout parser & tail-truncation guard:+0x10: per-element field block size (0x1c= 28 B in PSOs 1–2,0in PSO 3)+0x38:4 + n*28 + sum(len(name)+1)(0x70= 112 in PSOs 1–3)+0x4c:num_elements(3)+0x54..: array ofNUL-terminated ASCII semantic name + 7u32s (+0x00InputSlot,+0x04DXGI_FORMAT,+0x08SemanticIndex,+0x0cAlignedByteOffset).POSITION(DXGI_FORMAT_R32G32B32_FLOAT@0),COLOR(DXGI_FORMAT_R8G8B8A8_UNORM@12),TEXCOORD(DXGI_FORMAT_R32G32_FLOAT@16).TEXCOORDat0x9b+ 9 B name + 28 B fields ends at0xc0, truncated at0xbc),parse_xbox_pipeline_blob_input_layoutchecks bounds withmemchrand never reads pastblob_size.Measured
380..388 Bstate bloboffset logging:[rt] d3d12_xs: state blob: campo sin identificar en 0x%03x = 0x%08x) without guessing unconfirmed fixed-function D3D12 state fields.Verification
python -I scripts/check_no_game_data.pypassed on all modified files.device_proxy,xs_proxy_mock,d3d12_compute,d3d12_fspx_compute,root_signature,pipeline_cache_fileall 100% PASS, including aPAGE_NOACCESSguard-page test on the truncated 188-byte pipeline blob and syntheticfspx/fspx_gfx/bvhindex count isolation test).