D3D12.X: prevent stale texture unmaps after placement restoration #2055
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2065"
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 ivall/xcl. Originally posted by Mustafaiq1998x on 2026-11-25T02:34:30Z.
Addresses point 2 of #1897.
A delayed unmap can remove VRAM mappings from a texture that has already been restored to the active placement table. This fix revalidates mapping decisions under the texture table lock.
What is in it
Tested
cbc296a3ff9893Before:
After (three consecutive successful GPU runs):
cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture: 1154 passed, 1 failed, 46 ignored.Regression run
Pending paired real-title smoke tests.
Not tested
AI use
ChatGPT (GPT-6.2) assisted with implementation, source analysis and regression-test design. All reported GPU tests were executed on physical hardware.
Imported from ivall/xcl. Originally posted by WebIdentity1 on 2026-11-25T02:37:35Z.
Independent RTX 3090 check of exact
3ff98937f3bb94820b23b582355920c0396a6225: the deterministic stale-unmap regression reproduces without the state checks and passes with your unchanged fix.Tested — Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74 (
32.0.15.9174), Rust/Cargo 1.98.1 x64 MSVC, DXC 1.8.2502.11, debug,XCL_ADAPTER=3090.active=true mapped=falseactive=true mapped=trueThe negative control is the same head with identical author tests, not a parent checkout. The focused test prints
NVIDIA GeForce RTX 3090. Positive initial/restored/control texture-copy readbacks all match the expected contents, andSTALE_UNMAP_CONTROL unmap=true remap=true pixels=true/STALE_UNMAP_PIXELS_PASSare present. The negative test stops before reading the known-unmapped texture. The placement-table unit control passes both.The explicit skip in each run is
placed_title_textures_share_vram_and_preserve_pixels: this adapter makes no reserved cube with mips. It returns before its streaming/pixel controls, so those are not coverage. That existing test usesEnumAdapters1(0), not theXCL_ADAPTERselector; I cannot attribute its skip to the 3090 from its log. The new stale-unmap test selects and names the 3090 correctly.Both 322-file source manifests match before/after on Windows and locally; Cargo rebuilt XCL for both snapshots. No additional runtime change or competing PR.
Not tested — full workspace suite, retail smoke/world entry, performance, the reversed stale-remap interleaving independently, or the separate submitted-GPU-work/cross-queue lifetime hazards in #1897 point 1 / #594 / #799. This fills the NVIDIA gap for the deterministic restoration/unmap case; it is not a merge-readiness or gameplay claim.
AI use — Codex (GPT-6) reviewed the change, prepared the control, ran and verified the native comparison, and wrote this report. The runtime fix and regression are the PR author's.
Imported from ivall/xcl. Originally posted by Mustafaiq1998x on 2026-11-25T02:50:52Z.
Thank you for independently reproducing and verifying the fix on the RTX 3090.
Would you also be able to perform the required paired retail-title smoke tests on main and commit
3ff98937f3?I currently don't have a compatible unpacked retail title available. Your assistance would help satisfy the remaining PR regression requirement.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:55:18Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by dhillonjagdeep650-boop on 2026-11-25T06:17:19Z.
Regression pair for
3ff9893on a retail title, with the world-load path: RTX 3080 Ti, 180 s each, played by hand through the menus. No crash and no device removal on either side. One of three shorter runs of this head ended in the known null write at+0x2215c35; details below.Corrected 2026-11-25: I first wrote that the 60 s runs had no input, left one base run out, and said the title stops because pipelines compile cold, which I had not shown. The logs show a controller press in four of the six; the list below has all six.
Tested
3ff98937f3bb94820b23b582355920c0396a6225as it is, and its basecbc296ab65a2661a61e3e2da109134bcd5319f60(a commit ofmain), clean treesscripts/smoke.ps1 -Game <retail title> -Seconds 180, the base first. Each run started from the same copy of the title's data and of the DXIL cache. A person played both runs from the menus towards the world, so the two are not frame-for-frame the same input:-Seconds 60, no title data. Input was not controlled: a person was at the PC, and the log has the time of the first press of A:XCL_RUN_SECONDS(frames from its log; no smoke block, I had stopped the script)unhandled exception 0xc0000005 in game_scarlett_master.exe+0x2215c35 (write at address 0x0)at 55 sThe crash came with no fence time-out in its log, and its address is the one in #232 and #746, which are reported on
main. Three runs a side, with different input, cannot say whether this change makes it more likelyNot tested
stale_unmap_after_texture_restorationtest on this cardAI use: Claude Code with Claude Fable 5.2 built both trees, ran the scripts and wrote this report; a person played the 180 s runs. Claude Opus 5.5 wrote the correction.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:40:48Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:16:45Z.
Triage (#1607) – head
3ff9893No open or merged PR fixes point 2 of #1897. Main's
register/retire_overlapping/forgetintitle_textures.rsstill dropTEXTURESbeforevram::unmap_superseded/remap_if_unmapped.To check:
unmap_superseded_all/remap_restored_allnow holdTEXTURESwhilevramtakesPAGESand issuesUpdateTileMappings/pages.bind. That fixes the lock order to TEXTURES -> PAGES, and any path that releases a hooked resource or reachesforgetunderPAGESwould now deadlock. Main'svram.rshas grown by ~4.4k lines since this base, so the order needs checking again after the rebase.Point 1 of #1897 (no wait on title queues before the null-mapping) is not addressed, as the description says.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.