GPU: deserialize console pipeline states #3586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3586"
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?
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-27T19:15:24Z.
Device slots 56/57/66/67 — the console offline-pipeline (de)serialization entry points — are now wired and implemented. GTA VI uses both deserializers with
IID_ID3D12PipelineStateduring boot: graphics through a 0x108-byte description (root signature, two fixed-function state blobs, seven stage blocks) and compute through a 0x48-byte description (root signature plus kind 0/1/6/7 payloads). Previously the slots were absent, so every serialized pipeline lookup failed — leaving the title's pipeline tables incomplete.What is in it
0x1c0) / 66 (0x210) returnE_ACCESSDENIED(serialization is an offline content-build operation), deserializers 57 (0x1c8) / 67 (0x218) implemented.E_POINTER/E_NOINTERFACE/E_INVALIDARGbehavior.shader()/lazy-translation/hand-out path — identical descriptions share the shader-container cache, and the synthetic compute shader translates successfully through the real emit path.tracing::debug!logs pair sizes and short BLAKE3 hashes for real-game evidence.Tested
cargo test --locked -p victory-gpu --lib: 236 passed / 6 failed / 1 ignored — the 6 failures are the documented environmental baseline on this machine (bit-identical set on unmodified main: no SM 6.6, GTX 1050 driver, frame-timing flake); +11 vs baseline are the new tests.cargo clippy --locked -p victory-gpu --all-targets -- -D warningsclean.cargo test --locked -p xtask: 6 passed — repository policy green.Not tested
Real-game boot behavior (run planned as a follow-up — will be reported in comments); fixed-function state correctness (not decoded yet); graphics shader translation (future work).
AI use: design informed by static analysis of the title's call sites; implementation and verification AI-assisted (Devin / SWE-2.1).
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-27T19:35:30Z.
Real-title boot test of head
7b85a1a3(GTA VIgame_scarlett_master.exe, GTX 1050, debug build with diagnostics,VICTORY_LOG=info,victory_gpu::pipeline::deserialize=debug):The deserializers are heavily exercised immediately — 2,695 successful operations: 1,026 compute (kind0=28B/kind1=20B always; 178 unique kind6 shader hashes, 256B–26KB programs) and 1,669 graphics (state_a 380–480B in the measured families; state_b 80–224B; stage combinations overwhelmingly 0+1, mesh stage 2 in 25 cases). Input shapes match the reverse-engineered formats. Compute/deserialize input tuples are all unique; no malformed-input rejections are visible — though see the instrumentation caveat below.
Boot proceeds identically to before (frame 1024 at ~48 s, all draws dropped on this SM-6.2-capped machine as expected), and the original crash is unchanged:
0xc0000005reading[null+0x68]at image+0xb5a5f8 at ~59 s, same two thread stack shapes as baseline. So returning valid lazy pipeline objects for accepted descriptions is not by itself sufficient to populate the null effect-variant entries — the hypothesis is cleanly falsified in its simple form, which narrows the search considerably.New observational leads from this run:
E_INVALIDARG/E_NOINTERFACErejections are invisible; this is the biggest observational gap.0x1b8(index 55) with pointer arguments — per the console vtable map this is the derived-PSO creation entry point, a plausible source of the missing effect-variant entries (variant pipelines are typically derived from base pipelines).Instrumentation follow-ups in progress locally: failure-path logging and investigation of slot 55. This PR remains the correct foundation regardless — the 2,695 successful deserializations are real work the runtime previously couldn't do at all.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-27T23:33:28Z.
A risk with the graphics half, read from the code at
1960fa5and not run (I don't run the title):missing_table(device.rs:394), so a deserialize returnsE_NOTIMPL, and main reaches the world with its pipelines. xcl does the same: itsdeserialize_pso_xreturnsE_NOTIMPLwith the note "the title creates the pipeline from its desc" (xclhle/d3d12x/device_x.rs:581-592), and it renders the world too.deserialize::graphicsreturnsS_OKwith a pipeline that has no shaders and no host graphics state (hand_out(Vec::new(), None, Some(offline), …),deserialize.rs:631-638). Its draws take the no-host-pipeline drop path, as the description says.If the title builds a pipeline from its description only when the deserialize fails, the 1,669 graphics deserializations in your boot run would turn pipelines that render on main into dropped draws. That would only show on an SM 6.6 card: the GTX 1050 run drops every draw either way. The same scene on an SM 6.6 host, with and without this PR, would settle it from the frame line's
dropped N without a host pipelinecount and the draws per frame. The compute half builds a real shader from the payloads, so this is mostly about graphics (but see the compute result at the end).Until the fixed-function state is decoded, graphics could keep returning
E_NOTIMPLand still log the shapes, so the graphics description path stays as it is on main.Added later, confirming the fallback: ZigZagBoi1/ScarlettPort#223 (another VIctory-derived tree) states it directly. The title ships its pipelines precompiled in
platform:/shaders/v2.d3d12PipelineCache(the last file ofshaders.rpf) and hands the records to device methods0x1c8and0x218. "ScarlettPort fails those calls, so the title makes each pipeline itself while it plays." So on failure the title does build them from their descriptions. A graphicsS_OKwith an empty pipeline would skip that.Measured since: TaynanGT/Vice-Tay#296 (RTX 5080, under Proton) counted what the title does after each failed call. Each of 2,689 failed
0x218calls was followed on the same thread bycreate_compute, and the title's own log saysDeserializeComputePipelineStateX FAILED hr=0x80004001 ... falling back to NewBE.0x1c8failures came in runs of thousands, each followed within 0.2 s by tens of thousands ofcreate_streamcalls on other threads. Their conclusion: implementing the two methods "would only save the title its fallback; it wouldn't restore anything." So with this PR's graphicsS_OKand an empty pipeline, thosecreate_streambuilds would not happen.Compute too, on another tree: Machad3x/VIctory-nvidia (
docs/fork-machad3x.md, batch 1: RTX 3080 Ti, on a trustno1-coder/VIctory-NVIDIA base) tried the two deserializers after this PR and took them back out. The compute pipelines they made did not translate (840 shaders), while without them the title creates those pipelines the normal way. Their later batch made the lookups decline quietly and notes that nothing was ever missing. That tree's translator is not this one, so the 840 may not carry over. It is still worth onevictory shaders-style count of the payload shaders against the shaders the fallback creates.AI-assisted (Claude Code, Claude Opus 5.5 read this head, main and xcl's stub).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.