Repository navigation
D3D12.X: clear LAST_CONTENT on placed texture unmap and remap (#2460) - #2578
AngeloMaiale wants to merge 1 commit into
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Rerun on the new head
On Tested:
Not tested: where the AI use: Claude Code (Claude Opus 5.5) ran the suite, the repeats and the scratch debug-layer runs, and wrote this report. |
…ure caches (#2578) Adapt two cache-safe stability fixes cleanly onto origin/amd-dev (bf02341): - #2577 (real.rs, shaders.rs): record the chosen adapter's PCI vendor ID in driver_cache::note_vendor() and disable on-disk .pso driver blobs on AMD (0x1002) unless XCL_PSO_DISK_CACHE=1, avoiding device removals from stale 954-byte driver cache stubs written before a crash/kill (#2512). Adds driver_cache::tests::blobs_are_kept_on_disk_unless_they_are_references. - #2578 (title_textures.rs): return all retired resource pointers from Table::retire_range() so retire_overlapping() evicts LAST_CONTENT and STREAM_RECHECK for every retired texture (not only placed unmap targets). Assisted-by: Antigravity (Gemini 4 Neon High)
…ixes Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk, xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460), xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query), xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on building compute pipelines). Assisted-by: Antigravity (Gemini 4 Neon)
|
Current-head RTX 3080 Ti recheck: e44c9ff, PR base main b49be18. Clean exact-head checkout, RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. Tested
Not tested: retail texture output or a paired title smoke on this GPU. The synthetic checks support the revised teardown test and cache-invalidation behavior; they do not establish title-level visual correctness. AI-assisted: Codex (GPT-6.2 Sol) ran the checks and drafted this update. Earlier finding on head 168a32aFollow-up to the debug-layer report on current Stage markers narrowed the debug-layer exit to the final
retire_overlapping(at, old_tex.size() as usize);
assert!(!LAST_CONTENT.lock().unwrap().contains_key(&key_a));
own_work(|| {
super::super::vram::before_execute(&queue);
texture::wait(&dev, &queue).unwrap();
});
drop(old_a);With this test-only wait, the plain-pages phase passed 1/1 with the debug layer, and the complete two-phase test passed 4/4 runs. AI use: Codex (GPT-6.2 Sol) ran the synthetic checks and drafted this report; GPT-6.2 Astra reviewed the queue lifetime. AI-assisted. |
…v#2460) When a placed texture A was superseded by a different-range placement B, vram::unmap_superseded released A's tiles (and cleared its lazy level mappings under XCL_TEXTURE_LEVEL_PAGES=1), while LAST_CONTENT retained A's previous CPU content hash. Once B was released and A uncovered with A.pending = true, upload_all saw the same CPU hash and skipped both map_levels_with_texels and texture::upload_batch, leaving A unmapped under lazy level pages or sampling stale/recycled tiles on plain vram::Pages. Evict LAST_CONTENT entries under TEXTURES's lock whenever placed textures are unmapped (register), uncovered for remap (forget), or retired (retire_overlapping, which also prunes STREAM_RECHECK). Fixes xcl-dev#2460 Assisted-by: Antigravity (Gemini 4 Carbon)
168a32a to
e44c9ff
Compare
|
Thanks @DavidM1911 and @fromthemoonx for testing! Found where the
Updated the test in AI use: Antigravity with Gemini 4 Carbon traced the |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
AMD RX 7800 XT (wave64) on Tested:
The difference of one passed test between the two columns is the new test. Scratch runs of the new test on a scratch copy of
Not tested: a title or smoke run; a release build; AI use: Claude Code (Claude Opus 5.5) ran the suites, the repeats and the scratch debug-layer runs, and wrote this report. |
|
RTX 3090 Ti readback of the plain placed-texture remap case Windows 10 19045, NVIDIA 621.40, release on a local The real-GPU test passed, with no skip. It uploaded A, placed an overlapping B, restored A's identical CPU bytes, uncovered A and read back the expected texels after refresh. It also confirmed that Thanks for the fixture and the queue-drain follow-up. AI use: OpenAI Codex (GPT-6) adapted and ran the test. Live follow-up. In an untimed run with the same locally adapted #2578 runtime and a 6,569-entry native PSO seed, the last recorded Present was #1,720 at 806.288 s. The launcher stopped at 379 MiB of available physical RAM with 7.84 GiB of commit headroom. The last log entries still contained GPU submissions, and no device removal or matching Windows display-driver reset was logged. The most recent successful capture showed a loading spinner. Later capture copies timed out, so the test did not verify visible 3D or establish what changed in the rendered output. This is a runtime limit for this configuration and does not isolate a memory change caused by #2578. |
…validation (port upstream xcl-dev#2484 + xcl-dev#2578) (cherry picked from commit 77ff481152b0573c2df9d11a6dde8012ab13c482)
…ed texture caches (xcl-dev#2578) Adapt two cache-safe stability fixes cleanly onto origin/amd-dev (bf02341): - xcl-dev#2577 (real.rs, shaders.rs): record the chosen adapter's PCI vendor ID in driver_cache::note_vendor() and disable on-disk .pso driver blobs on AMD (0x1002) unless XCL_PSO_DISK_CACHE=1, avoiding device removals from stale 954-byte driver cache stubs written before a crash/kill (xcl-dev#2512). Adds driver_cache::tests::blobs_are_kept_on_disk_unless_they_are_references. - xcl-dev#2578 (title_textures.rs): return all retired resource pointers from Table::retire_range() so retire_overlapping() evicts LAST_CONTENT and STREAM_RECHECK for every retired texture (not only placed unmap targets). Assisted-by: Antigravity (Gemini 4 Neon High)
|
Independent desktop NVIDIA verification of PR #2578 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.29s, 0.29s, 0.30s, 0 skipped — live D3D12 execution on RTX 4060) |
cargo test --release -p xcl --lib hle::d3d12x::title_textures:: -- --test-threads=1 (3 consecutive runs) |
20 passed; 0 failed; 0 ignored; 1305 filtered out × 3 (0.89s, 0.90s, 0.90s, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 07s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):
xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1531 (PresentX 1531)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13982 MB
PR #2578 (e44c9ffd5adb500cf3267114dfed4acfb5401c93):
xcl-smoke v1
commit: e44c9ffd5adb500cf3267114dfed4acfb5401c93
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13990 MB
Runtime log observations (xcl.log)
9220log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19547 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13989 MB committed by the process; video memory 6116 MB local, 4651 MB non-local.
Limits of coverage
- Clearing
LAST_CONTENTon placed-texture unmap/remap so shadowed textures re-upload even with unchanged CPU bytes was directly exercised on desktop D3D12 / RTX 4060 viashadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes(3/3,0skipped) andhle::d3d12x::title_textures::(20/20× 3). - The 60 s retail smoke on
title: 29640639confirms zero runtime regression across placed texture uploads (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Clear
LAST_CONTENTentries whenever placed textures are unmapped on overlap, uncovered for remap on release, or retired by a GPU-owned placement so unchanged CPU bytes do not skip re-uploading or lazy mip-level mapping. Fixes #2460 (also covers the remap hash-invalidation case noted in #504).When a placed texture
Awas superseded by a different-range placementB,vram::unmap_supersededreleasedA's tiles (and cleared its lazy level mappings underXCL_TEXTURE_LEVEL_PAGES=1) whileLAST_CONTENTretainedA's pre-shadow CPU content hash. OnceBwas released andAuncovered withA.pending = true,upload_allsaw the same CPU hash and skipped bothmap_levels_with_texelsandtexture::upload_batch, leavingAunmapped under lazy level pages or sampling stale/recycled tiles on plainvram::Pages.What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs: addforget_last_contentand call it underTEXTURES's lock forunmap_ptrsinregister,remap_ptrsinforget, andretired_ptrsinretire_overlapping(which also prunesSTREAM_RECHECK); add GPU regression testshadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytescovering lazy level pages, plainvram::Pages, andretire_overlapping.Tested
rustc 1.100.0, DXC1.9.2609.5, debug (tests) and release (smoke runs)cargo test -p xcl --lib hle::d3d12x::title_textures::tests::shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --exact --nocapturefailed (left: 0mapped bytes vsright: 5636096, logging1 uploads left out so far)cargo test -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1: 20 passed, 0 failed.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) one44c9ff: 1424 passed, 0 failed, 46 ignoredSKIPPEDGPU tests on this adapter (25): 20no wave64, 3 refused wave32 per-lane f16/f32 forms (#1426), 1no heap windows, 1no D3D12 debug layerRegression run
main:
PR:
Not tested
d3d12SDKLayers.dll), and retail gameplay past the 60 s smoke window (the smoke run checks for regressions and does not force a different-range placed-texture shadow/uncover cycle withXCL_TEXTURE_LEVEL_PAGES=1)AI use
title_textures.rs, wrote the fix and GPU regression test, ran the test suite and smoke runs, and drafted the commit message and PR description.