GPU: deserialize console pipeline states #3586
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3586
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@kotekompotek on GitHub · 2026-11-27 19:15 UTC · original
kotekompotek:gpu/offline-pipeline-deserialize→main· +1095 −1 · 5 files · 2 commits · openDevice 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).
@kotekompotek on GitHub · 2026-11-27 19:35 UTC · original
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.
@upipibi on GitHub · 2026-11-27 23:33 UTC · original
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 about graphics only.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.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.