d3d12: record the root a raster pipeline is created with #585
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/585"
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 brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-30T08:12:29Z.
Problem. On my prefix (RTX 4070, GE-Proton11-14) the preparation replay creates only 6,159 of 23,142 recorded pipelines. All 16,983 failures are graphics, and
VKD3D_DEBUG=warn/VKD3D_SHADER_DEBUG=traceon a sample shows the same thing every time:The cause: when a raster pipeline's root is reflected (
TableLayout::Reflectedinstream.rs), the provider writes the reflected table's native root into the stream, butgraphics_root, which the PSO recorder saves asroot.bin, is still the title's serialized root. The replay then pairs translated stages, which were built against the reflected root, with the title's root, which lacks their space-1 CBVs. So those graphics pipelines are never warmed and all compile in game.Fix.
stream.rs: when the effective raster root differs from the title's, keep a copy of its serialized bytes (used_root) and record that.pso_record.rs: records now carryroot_used 1. A record without it is written again the next time its pipeline is created, so existing prefixes heal on their next run._rebuild_graphicstranslates rooted stages with--root root.bin. It now gets the reflected root, which is what the runtime translates against (raster_with_root(source, root.payload())).Checks: clippy (
-D warnings) and fmt are clean. d3d12 tests under Wine: pso_record 6/6, stream 12/12, placement 103/103. Not yet re-measured end to end. The next run records with the fix, then prep replays. Pairs with #579, which runs the replay on several threads.This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:51:42Z.
Thanks, and good diagnosis. I read it through, and the code agrees with you:
raster_with_root(source, root.payload()).graphics_root, the title's root.--root root.binrebuild and the replay are both working from a root the pipeline was never created with.The fix is small and in the right place. I merged #579 just now.
I'd like the end-to-end number before merging this too, since that's what it's for. Once a run has re-recorded under this branch and preparation has replayed, please post the receipt line (
threads=… records=… graphics=… failed=…). Thefailedcount should drop from 16,983 to roughly the records that weren't re-recorded in that run. If any graphics records still fail withroot_used 1in their recipe, list a couple of their vkd3d lines, because those would be a second cause.Two small things to check while you're there:
title != root.serialized()compares the whole serialized blob, whileCompiledRoot::matchescompares payloads. Is there a case where the bytes differ but the payload is the same? Recording the native root then is harmless, but say so in the comment if it's expected.Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-30T23:49:33Z.
Pushed
593c21d, which answers both questions; the receipt line still needs a game run.CompiledRoot::matchesdoes. Two roots can have the same payload inside different containers (hash, chunk order). That happens on theTUXBOX_RASTER_ROOT_FALLBACKpath, which hands back the title's root unchanged. When the payloads match, the record keeps the title's bytes. Recording the native bytes there would also replay correctly, and the comment now says so.threads=… records=… graphics=… failed=…and any vkd3d lines left fromroot_used 1records once it's done.(Written with AI assistance: Claude Code.)