D3D12.X: preserve pending CPU writes during sparse readback #1837
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1847"
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 gloger2003 on 2026-11-24T21:44:48Z.
A sparse readback can restore the previous GPU contents over CPU writes that have not been uploaded yet. A partial readback can also mark adjacent CPU bytes as synchronized even though the GPU has never seen those bytes.
What is in it
Tested
c160d86and passed on this branch. It reads the GPU bytes again after the next submit.cargo build --offline --locked --workspaceandcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output. The repeated workspace run reported 859 passed, 0 failed and 42 ignored. The optional heap-window test reported a skip in the standard configuration and passed separately withXCL_HEAP_WINDOWS=1. The first run hit the cubemap idle-page reclamation assertion, followed by two poisoned-lock failures. Those tests passed in the rerun. A controlled 2.2-second delay before the second placement also reproduced the original cubemap assertion on unmodified mainc160d86. Known cubemap test issue #718Regression run
main
PR
Not tested
AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T22:55:47Z.
Reproduced and fixed on NVIDIA: RTX 3070 8 GB, driver 616.56, Windows 11, debug.
main689f2dbwith onlytests/sparse_readback_cpu_writes.rscopied in:sparse_readback_preserves_an_unsubmitted_cpu_chunkfails, 2 of 2 runs ("the readback must preserve the unsubmitted CPU chunk").76ac614merged onto689f2db(clean): passes, 2 of 2. The lib tests matchingsparse(minusgpu_sparse_vram, for #1727): 16 passed, 0 failed.AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:15:35Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T06:00:29Z.
I tested the
copy_backimplementation from76ac614aas a local replacement for the chunk-level approach in the performance stack, on Windows x64 / RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC release. The exact stack parent3d8182c9passes the in-repo synthetic title. The next commit,7724ec49(same patch as054270ca), fails itspost-Wait32/64 writeassertion with0x0. This matches the existing stack report.I replaced that commit’s sparse copy-back logic locally with this PR’s implementation, retaining the stack’s readback completion handling. The unmodified synthetic title then passed 2/2 runs with zero failures. I also ran this PR’s focused GPU test after adapting its placement and the stack’s
before_executecall signature. It passed 1/1, with no skip. It preserved the pending CPU bytes through the next upload and verified the partial GPU write in the neighboring bytes of the same chunk. This tests a local adaptation on the stack. A clean upstream PR build, the full suite, and retail smoke were outside the run.OpenAI Codex assisted with the adaptation and verification (exact serving model not exposed).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:58:32Z.
Triage (#1607) – head
76ac614Main now does this in
sparse.rs. Commit04de323addedland_page, which copies GPU bytes only into chunks whose hash still matchessentand leaves CPU-dirty chunks and their hashes for the next upload. Commit5f284ccaddedgpu_written, so a list's own GPU writes still land in a CPU-changed chunk and that chunk stays dirty. Together they cover both scenarios insparse_readback_cpu_writes.rs: a full chunk the GPU did not change, and a partial GPU write next to a CPU write. Thesync_sent_range/ readback loop this PR rewrites has since been restructured (copy_backwithgen), and the branch conflicts with it.Recommendation: close (superseded by main commits
04de323and5f284cc).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:49:04Z.
Closing as superseded: this change is already on
main(5f284cc2). main land_page / gpu_written (04de323,5f284cc) keeps CPU-dirty chunks and their hashes on copy-back and lets the GPU's own writes land in a changed chunk; replaces sync_sent_range overwrite the PR fixesTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed