D3D12.X: prevent stale texture unmaps after placement restoration #2065
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2065
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Mustafaiq1998x on GitHub · 2026-11-25 02:34 UTC · original
Mustafaiq1998x:fix/stale-texture-unmap→main· +208 −11 · 2 files · 1 commits · draftAddresses 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.
@WebIdentity1 on GitHub · 2026-11-25 02:37 UTC · original · edited 2026-11-25 02:39 UTC
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.
@Mustafaiq1998x on GitHub · 2026-11-25 02:50 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 04:55 UTC · original
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!
@dhillonjagdeep650-boop on GitHub · 2026-11-25 06:17 UTC · original · edited 2026-11-25 08:57 UTC
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.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.