d3d12: report textures that ended while descriptors still name them #567
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/567"
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 NickStallman on 2026-11-30T03:57:48Z.
Log-only, for anyone chasing a lost GPU (#232). Refs #533 (claimed there). Run in the game four times, see below.
Why. On an RTX 5090 (
10de:2b85, 620.70.10, GE-Proton11-14) ProjectScarlett loses the GPU some minutes into the story (Xid 13, an MMU fault in a shader). One run had a fault address: a read of0xdcf6068000, which vkd3d's binding log says was inside an image's range that was unbound 846 seconds before the fault ("very likely use-after-free"). The log can't say whose image it was or which descriptor still named it. From the code, the likely kind is a reserved placed texture (no dimensions in vkd3d's record), which is a guess.What it does. With
TUXBOX_CHECK_STALE_IMAGES=1(andTUXBOX_LOG), a shadow of the host descriptors follows creations and copies, separately from the tracking that keeps images alive. At a device loss it logs the ended images that descriptors still name, with up to 4 descriptors each (slot, kind, evicted or not, source), then every ended image kept, with its life in performance-counter seconds to match against vkd3d-proton's BIND and UNBIND times. Every 30 s it counts index-map entries without a slot and says what visible slot 0 names. Off by default; nothing is nulled or kept alive.Limits: D3D12 gives no image address, so images are matched by time and size. It takes one lock per descriptor write, so it costs CPU (not measured). At most 1,024 named images and 32,768 ended ones.
Results on an RTX 5090. Nothing to say in the first (84a: no loss, 8 minutes in the world). In the second (84b) the GPU was lost 11 minutes into the world with it on: no followed descriptor named an ended image (28,244 images live, 32,768 ended kept, 160,785 descriptors naming an image), and vkd3d called that fault address (
0x1030b5000) never-used memory or out of bounds. So a stale descriptor isn't supported as the cause of that loss. It can't see copy paths it doesn't follow, has no positive control in the game, and ran with neither of the earlier losses, so it says nothing about 83a. Index map: about 1.04 million unmapped indices held records, 46,000 empty, and visible slot 0 named no image.Tested
python tuxbox.py check --no-gpupassed (10 of 10). It merges cleanly with our integration branch, where its unit tests andcargo checkpass.A matching descriptor shows it existed, not that a shader read it. Please use it with
TUXBOX_HOLD_LOST-style delays if you have them, so the dump completes.python tuxbox.py checkof1006ca18(rebased ontoe5d2e913; no change in behaviour): RTX 5090 (10de:2b85, 620.70.10) 200 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 199 pass, 0 fail. GE-Proton11-14.Evidence: TuxBox check of
1006ca185a, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not runEvidence: TuxBox check of
1006ca185a, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T04:12:04Z.
Heads-up: main just landed a large cleanup (up to
e5d2e913), so this PR needs a rebase.rustfmt.toml).unwrap(), lossyascasts and undocumentedunsafeoutside tests.cargo fmt --check, rustdoc with warnings denied, and Miri on the providers' unit tests.The least painful way is to format your branch first, so the rebase only shows real changes:
Then run
python tuxbox.py check --no-gpu, which now includes the format step.If clippy flags something new:
Fromfor widening,TryFromfor narrowing, and a mask for bit fields.unwrap(): use?, orexpectwith the reason it can't fail.unsafeblock: it needs a// SAFETY:comment.CONTRIBUTING's "Code checks" section lists the commands. Thanks!
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:33:35Z.
Thanks, this was useful work: it answered its question. In your runs (and @ReverendOzmund's) the result was negative, which rules this theory out for #232.
That's also why I'm holding it rather than merging. On main it would be about 500 lines plus hooks in a hot path (every descriptor write and copy goes through the shadow's check), for a diagnostic that has already said what it can and that nobody needs right now. The branch keeps it available: anyone chasing #232 can merge it locally, and if a new loss points back at this, we'll merge it then.
Feel free to turn it into a draft so it stays findable. I'll leave it open.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T09:39:19Z.
Agreed on holding #567 and #568; both were meant for finding the cause, and the branches stay as they are. One limit on the conclusion, so nobody closes the question from it: #567 follows the descriptors TuxBox writes, so a clean result only rules out a followed descriptor naming a destroyed texture. It can't see a shader that uses an index outside the heap or the map, which is what @Jerkin42 has since found on #472. I've added that to the description.
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.