D3D12.X: refresh staged texture states before submission #3790
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3790"
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 Prime1997 on 2026-12-03T14:47:07Z.
A title submission can update a texture’s state while XCL fills a CPU staging buffer. Refresh the destination’s registered subresource states under the native queue turn before recording its copy transitions. The upload carries the ownership revision selected before staging. A prior GPU writer on an eligible pending texture can stay valid. A replacement or a later GPU writer, copy-back, or source change invalidates the queued CPU copy.
What is in it
Tested
67651700045c940eadd0ebf6ef5996f546c7b4a5on upstreammaina815de932c4dc8da3b383ca44f4b094aa406fec9. Windows x64, Rust 1.100.0, RTX 3060 Ti.cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture --exactwith the two upload ownership and retry fixtures. 2 passed, 0 failed, 0 ignored, 0 skips.Regression run
The paired retail smoke is pending for this draft.
Not tested
The specific retail removal, independent cross-queue behavior, and the full workspace suite.
AI use
OpenAI Codex (GPT-6) investigated the queue path, wrote the patch and regression, and ran the targeted checks.
Contributors can use this optional temporary Discord to coordinate testing and compare results.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T17:42:15Z.
merge-check
base:
16c2fd082ahead:
6765170004merge: clean
build: ok
tests: 3019 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 6 medium, 3 nits (below)
performance: 60 s smoke run: 1683 → 1659 frames (98 % of main), peak commit 18505 → 17840 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 238 s there, 0 device removals, 0 crashes, 3.6 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet: it is a draft, and
PR descriptionis red; otherwise no blocking finding, the suite passes and the smoke run is cleanhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: The PR records title texture uploads inside the title queue's ordered submission slot ("queue lease"). There it re-reads each destination's current resource states and drops any upload whose texture was replaced, written by the GPU, downloaded or remapped while the CPU filled the staging buffer. The new push adds a per-entry revision counter and moves retries under the texture table lock. The reading found no deadlock and no wrong barrier, and the code is consistent. The stale-drop path is still untested end to end, a retry assertion was reversed, and the conflict with #3791 remains, but nothing blocks merging.
Medium
9894873931), also open, changes title_textures.rs. A test merge of both onto origin/main conflicts in that file. One has to be rebased on the other.Nit
Checked and fine
How this was tested
16c2fd08, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main16c2fd08and on this merge; presents per 2 s at the end: 61 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-03T17:42:42Z.
@Prime1997 I found one case on
67651700where an interrupted copy-back leaves two older mip uploads eligible. I ran the revision’s publication and queue-recording functions on Windows and varied how much progress the write callback reported.67651700I tried advancing the upload revision as soon as the callback reports partial progress, while keeping the GPU writer pending for retry. That discarded both older copies in the 4-byte case and preserved the zero-byte and complete-write behavior. All nine cases passed across three trials. The fixture injected the write outcomes, so whether the native page writer reports partial progress this way remains open.
Separately, on the earlier
da0bf0dcrevision, I replayed the selected barriers and copies on my RTX 3080 after a fenced state change on the same queue. All 640 texel bytes across 16 mips matched expectations, including the 400 bytes that should stay untouched.AI disclosure: OpenAI Codex GPT-6.2 Sol ran the comparisons and wrote the local correction. An independent Codex reviewer reproduced the partial-write results. GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
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.