D3D12.X: clear LAST_CONTENT on placed texture unmap and remap (#2460) #2578

Open
github-bot wants to merge 1 commit from github-bot/gh-2578 into main AGit
Owner

@⁠AngeloMaiale on GitHub · 2026-11-25 23:51 UTC · original
AngeloMaiale:d3d12x/clear-shadowed-texture-hash → main · +212 −11 · 1 files · 1 commits · open

Clear LAST_CONTENT entries 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 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 pre-shadow 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.

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: add forget_last_content and call it under TEXTURES's lock for unmap_ptrs in register, remap_ptrs in forget, and retired_ptrs in retire_overlapping (which also prunes STREAM_RECHECK); add GPU regression test shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes covering lazy level pages, plain vram::Pages, and retire_overlapping.

Tested

  • NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.16.2124, wave32), 12th Gen Intel Core i7-12650H, 16 GB RAM, Windows 11 Home 26200, rustc 1.100.0, DXC 1.9.2609.5, debug (tests) and release (smoke runs)
  • Failing-first check before the fix: cargo test -p xcl --lib hle::d3d12x::title_textures::tests::shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --exact --nocapture failed (left: 0 mapped bytes vs right: 5636096, logging 1 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) on e44c9ff: 1424 passed, 0 failed, 46 ignored
  • SKIPPED GPU tests on this adapter (25): 20 no wave64, 3 refused wave32 per-lane f16/f32 forms (#1426), 1 no heap windows, 1 no D3D12 debug layer

Regression run
main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 274 (PresentX 274)
presents per 2 s (last 3): 18 19 18
device removals: 0
crashes: 0
peak commit: 14900 MB

PR:

xcl-smoke v1
commit: e44c9ffd5adb500cf3267114dfed4acfb5401c93
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 221 (PresentX 221)
presents per 2 s (last 3): 8 12 16
device removals: 0
crashes: 0
peak commit: 14898 MB

Not tested

  • AMD GPUs (wave64), D3D12 debug layer (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 with XCL_TEXTURE_LEVEL_PAGES=1)

AI use

  • Antigravity with Gemini 4 Carbon: audited 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.
**@⁠AngeloMaiale** on GitHub · 2026-11-25 23:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578) `AngeloMaiale:d3d12x/clear-shadowed-texture-hash` → `main` · +212 −11 · 1 files · 1 commits · open Clear `LAST_CONTENT` entries 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 `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 pre-shadow 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`. **What is in it** - `crates/xcl/src/hle/d3d12x/title_textures.rs`: add `forget_last_content` and call it under `TEXTURES`'s lock for `unmap_ptrs` in `register`, `remap_ptrs` in `forget`, and `retired_ptrs` in `retire_overlapping` (which also prunes `STREAM_RECHECK`); add GPU regression test `shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes` covering lazy level pages, plain `vram::Pages`, and `retire_overlapping`. **Tested** - NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.16.2124, wave32), 12th Gen Intel Core i7-12650H, 16 GB RAM, Windows 11 Home 26200, `rustc 1.100.0`, DXC `1.9.2609.5`, debug (tests) and release (smoke runs) - Failing-first check before the fix: `cargo test -p xcl --lib hle::d3d12x::title_textures::tests::shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --exact --nocapture` failed (`left: 0` mapped bytes vs `right: 5636096`, logging `1 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`) on `e44c9ff`: 1424 passed, 0 failed, 46 ignored - `SKIPPED` GPU tests on this adapter (25): 20 `no wave64`, 3 refused wave32 per-lane f16/f32 forms (`#1426`), 1 `no heap windows`, 1 `no D3D12 debug layer` **Regression run** main: ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 4050 Laptop GPU title: 419239bf seconds: 60 exit: 0x0 frames shown: 274 (PresentX 274) presents per 2 s (last 3): 18 19 18 device removals: 0 crashes: 0 peak commit: 14900 MB ``` PR: ``` xcl-smoke v1 commit: e44c9ffd5adb500cf3267114dfed4acfb5401c93 gpu: NVIDIA GeForce RTX 4050 Laptop GPU title: 419239bf seconds: 60 exit: 0x0 frames shown: 221 (PresentX 221) presents per 2 s (last 3): 8 12 16 device removals: 0 crashes: 0 peak commit: 14898 MB ``` **Not tested** - AMD GPUs (wave64), D3D12 debug layer (`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 with `XCL_TEXTURE_LEVEL_PAGES=1`) **AI use** - Antigravity with Gemini 4 Carbon: audited `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.
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 #2460

Assisted-by: Antigravity (Gemini 4 Carbon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:17 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:08 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.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 00:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7178431485) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 00:49 UTC · original · edited 2026-11-26 09:08 UTC

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

  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked -p xcl --lib shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 skips on the stock head.
  • To recheck my earlier 0x87D failure, I added only a local EnableDebugLayer() call before that fixture created its device. The same test then passed 1/1 with D3D12SDKLayers.dll active and no 0x87D termination. I restored the file afterward; no production change was tested in this scratch run. I did not inspect the InfoQueue message count.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet on the restored, clean exact head: 1,424 passed, 0 failed, 46 ignored across 37 test targets; 25 explicit GPU skip notices. Skips are not counted as GPU coverage.

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 168a32a

Follow-up to the debug-layer report on current 168a32a. I reproduced exit 0x87D on an RTX 3080 Ti (621.35), Windows 11 build 26300, with a scratch EnableDebugLayer() call before this test creates its device. The stock test without that call passes 1/1.

Stage markers narrowed the debug-layer exit to the final drop(old_a), after retire_overlapping returned. The lazy-level phase alone passed; the plain-pages phase alone reproduced the exit. Its re-upload and GPU readback had already completed, so the last aliasing log line did not identify the failing operation. The earlier no-invalidation control stops at the lazy assertion and does not reach this release.

retire_overlapping calls vram::unmap_superseded, which queues UpdateTileMappings on the private mapping queue and signals its fence. The test's prior readback waits precede this final unmap. In scratch, I waited for that mapping dependency on the test queue before releasing old_a:

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. before_execute queues a wait for the latest mapping fence; texture::wait then waits for the test queue. This supports a teardown-order explanation, but I did not capture a D3D12 InfoQueue error ID or termination stack. It does not establish a retail-title fix. No production code or game files were changed.

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.

**@⁠thehollowedone** on GitHub · 2026-11-26 00:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7179155397) · edited 2026-11-26 09:08 UTC **Current-head RTX 3080 Ti recheck:** [e44c9ff](https://github.com/xcl-dev/xcl/commit/e44c9ffd5adb500cf3267114dfed4acfb5401c93), PR base [main b49be18](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). 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** - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked -p xcl --lib shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes -- --nocapture --test-threads=1`: **1 passed, 0 failed, 0 ignored, 0 skips** on the stock head. - To recheck my earlier `0x87D` failure, I added only a local `EnableDebugLayer()` call before that fixture created its device. The same test then passed **1/1** with `D3D12SDKLayers.dll` active and no `0x87D` termination. I restored the file afterward; no production change was tested in this scratch run. I did not inspect the InfoQueue message count. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet` on the restored, clean exact head: **1,424 passed, 0 failed, 46 ignored** across 37 test targets; 25 explicit GPU skip notices. Skips are not counted as GPU coverage. **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. <details><summary>Earlier finding on head 168a32a</summary> Follow-up to [the debug-layer report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2578) on current [`168a32a`](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2578/commits/168a32a7c9242034d5857d44f80d586511d4c46f). I reproduced exit `0x87D` on an RTX 3080 Ti (621.35), Windows 11 build 26300, with a scratch `EnableDebugLayer()` call before this test creates its device. The stock test without that call passes 1/1. Stage markers narrowed the debug-layer exit to the final `drop(old_a)`, after `retire_overlapping` returned. The lazy-level phase alone passed; the plain-pages phase alone reproduced the exit. Its re-upload and GPU readback had already completed, so the last aliasing log line did not identify the failing operation. The earlier no-invalidation control stops at the lazy assertion and does not reach this release. `retire_overlapping` calls `vram::unmap_superseded`, which queues `UpdateTileMappings` on the private mapping queue and signals its fence. The test's prior readback waits precede this final unmap. In scratch, I waited for that mapping dependency on the test queue before releasing `old_a`: ```rust 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. `before_execute` queues a wait for the latest mapping fence; `texture::wait` then waits for the test queue. This supports a teardown-order explanation, but I did not capture a D3D12 InfoQueue error ID or termination stack. It does not establish a retail-title fix. No production code or game files were changed. 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. </details>
Author
Owner

@⁠AngeloMaiale on GitHub · 2026-11-26 01:01 UTC · original

Thanks @⁠DavidM1911 and @⁠fromthemoonx for testing!

Found where the 0x87D exit under the D3D12 debug layer comes from:

  • 0x87D (_FACD3D12) is the SEH exception raised by d3d12SDKLayers.dll on D3D12_MESSAGE_SEVERITY_CORRUPTION.
  • The last logged line (CreatePlacedResourceX at … 512x512 … – aliases an earlier resource there (… 1024x1024 …)) is the start of step 2 of the test, after step 1's lazy level remap + re-upload + 11 mip readbacks have already passed. Nothing else logs between step 2 and the end of the test.
  • At the very end of the test (step 3), retire_overlapping(at, old_tex.size()) calls vram::unmap_superseded(&old_a), which queues an asynchronous UpdateTileMappings(&old_a, NULL) on vram::Pages::queue, and the next line immediately runs drop(old_a).
  • On current main, late_release::drain_known waits on present::known_queues(), sparse::queue(), and title_textures::upload_queues(), but does not yet include vram::Pages::queue (already covered by open PR #1314). Because upload_queues() is already idle from step 2, old_a's final Release runs while UpdateTileMappings is still in flight on vram::Pages::queue, triggering D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE (921, CORRUPTION) → 0x87D.
  • Turning off the three forget_last_content calls avoided 0x87D only because step 1 panicked earlier at mapped_tiles_for(...).is_some() before reaching step 2/3 (lazy_b in step 1 had LEVEL_PAGES_FOR_TEST = true, so no UpdateTileMappings was queued on it before drop(lazy_b)).

Updated the test in e44c9ff (without touching late_release.rs, to stay out of #1314's scope) to drain vram::Pages::queue via vram::before_execute(&queue) + texture::wait(&dev, &queue) before dropping lazy_a and old_a, and refreshed the xcl-smoke run on e44c9ff.

AI use: Antigravity with Gemini 4 Carbon traced the 0x87D site in d3d12SDKLayers.dll and late_release.rs, updated the test, re-ran test.ps1 and smoke.ps1, and drafted this reply.

**@⁠AngeloMaiale** on GitHub · 2026-11-26 01:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7179345728) Thanks @⁠DavidM1911 and @⁠fromthemoonx for testing! Found where the `0x87D` exit under the D3D12 debug layer comes from: - `0x87D` (`_FACD3D12`) is the SEH exception raised by `d3d12SDKLayers.dll` on `D3D12_MESSAGE_SEVERITY_CORRUPTION`. - The last logged line (`CreatePlacedResourceX at … 512x512 … – aliases an earlier resource there (… 1024x1024 …)`) is the start of step 2 of the test, after step 1's lazy level remap + re-upload + 11 mip readbacks have already passed. Nothing else logs between step 2 and the end of the test. - At the very end of the test (step 3), `retire_overlapping(at, old_tex.size())` calls `vram::unmap_superseded(&old_a)`, which queues an asynchronous `UpdateTileMappings(&old_a, NULL)` on `vram::Pages::queue`, and the next line immediately runs `drop(old_a)`. - On current `main`, `late_release::drain_known` waits on `present::known_queues()`, `sparse::queue()`, and `title_textures::upload_queues()`, but does not yet include `vram::Pages::queue` (already covered by open PR #1314). Because `upload_queues()` is already idle from step 2, `old_a`'s final `Release` runs while `UpdateTileMappings` is still in flight on `vram::Pages::queue`, triggering `D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE` (921, `CORRUPTION`) → `0x87D`. - Turning off the three `forget_last_content` calls avoided `0x87D` only because step 1 panicked earlier at `mapped_tiles_for(...).is_some()` before reaching step 2/3 (`lazy_b` in step 1 had `LEVEL_PAGES_FOR_TEST = true`, so no `UpdateTileMappings` was queued on it before `drop(lazy_b)`). Updated the test in `e44c9ff` (without touching `late_release.rs`, to stay out of #1314's scope) to drain `vram::Pages::queue` via `vram::before_execute(&queue)` + `texture::wait(&dev, &queue)` before dropping `lazy_a` and `old_a`, and refreshed the `xcl-smoke` run on `e44c9ff`. **AI use:** Antigravity with Gemini 4 Carbon traced the `0x87D` site in `d3d12SDKLayers.dll` and `late_release.rs`, updated the test, re-ran `test.ps1` and `smoke.ps1`, and drafted this reply.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-26 00:20 UTC · original · edited 2026-11-26 01:09 UTC

Rerun on the new head e44c9ff: with the debug layer on, the new test now passes 5 of 5 with 0 info-queue messages. That fits the cause you found (the last Release of old_a while its UpdateTileMappings was still on vram::Pages::queue). My "fix off" row below was wrong as an explanation: that run panicked before it reached the release, as you say.

result
cargo test --workspace --no-fail-fast -- --test-threads=4, e44c9ff merged onto main b49be18 (clean) 1436 passed, 0 failed, 47 ignored; 25 SKIPPED lines
the new test with a scratch EnableDebugLayer() + info-queue dump, 5 runs 5 of 5 pass, 0 stored messages
the new test alone, 30 runs; title_textures:: (20 tests) at --test-threads=8, 30 runs 30 of 30; 30 of 30

On 168a32a: Passed on NVIDIA, but with the D3D12 debug layer on, the new test's process died: exit code 0x87D, 3 of 3, right after its aliasing CreatePlacedResourceX.

Tested: 168a32a merged onto main 08db802 (clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1430 passed, 0 failed, 47 ignored; 25 SKIPPED lines
shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes alone, 30 runs; title_textures:: (20 tests) at --test-threads=8, 30 runs 30 of 30; 30 of 30
the new test with a scratch D3D12GetDebugInterface + EnableDebugLayer() before its D3D12CreateDevice the process exits with 0x87D (2173), 3 of 3; the last output line is CreatePlacedResourceX at … (dimension 3 512x512 format 28 flags 0x0) – aliases an earlier resource there (dimension 3 1024x1024 …); no panic, no test result
the same, with the 3 forget_last_content(...) calls in register / retire_overlapping / forget turned into no-ops runs to the end and fails at title_textures.rs:2779 (the test's assert without the fix)

XCL_D3D12_DEBUG=1 does not reach this test: it makes its own device with D3D12CreateDevice, hence the scratch EnableDebugLayer().

Not tested: where the 0x87D comes from; a title; AMD; a release build.

AI use: Claude Code (Claude Opus 5.5) ran the suite, the repeats and the scratch debug-layer runs, and wrote this report.

**@⁠fromthemoonx** on GitHub · 2026-11-26 00:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7178655464) · edited 2026-11-26 01:09 UTC **Rerun on the new head `e44c9ff`: with the debug layer on, the new test now passes 5 of 5 with 0 info-queue messages.** That fits the cause you found (the last `Release` of `old_a` while its `UpdateTileMappings` was still on `vram::Pages::queue`). My "fix off" row below was wrong as an explanation: that run panicked before it reached the release, as you say. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4`, `e44c9ff` merged onto `main` `b49be18` (clean) | 1436 passed, 0 failed, 47 ignored; 25 `SKIPPED` lines | | the new test with a scratch `EnableDebugLayer()` + info-queue dump, 5 runs | 5 of 5 pass, 0 stored messages | | the new test alone, 30 runs; `title_textures::` (20 tests) at `--test-threads=8`, 30 runs | 30 of 30; 30 of 30 | --- *On `168a32a`:* Passed on NVIDIA, but with the D3D12 debug layer on, the new test's process died: exit code `0x87D`, 3 of 3, right after its aliasing `CreatePlacedResourceX`. **Tested:** `168a32a` merged onto `main` `08db802` (clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1430 passed, 0 failed, 47 ignored; 25 `SKIPPED` lines | | `shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes` alone, 30 runs; `title_textures::` (20 tests) at `--test-threads=8`, 30 runs | 30 of 30; 30 of 30 | | the new test with a scratch `D3D12GetDebugInterface` + `EnableDebugLayer()` before its `D3D12CreateDevice` | the process exits with `0x87D` (2173), 3 of 3; the last output line is `CreatePlacedResourceX at … (dimension 3 512x512 format 28 flags 0x0) – aliases an earlier resource there (dimension 3 1024x1024 …)`; no panic, no test result | | the same, with the 3 `forget_last_content(...)` calls in `register` / `retire_overlapping` / `forget` turned into no-ops | runs to the end and fails at `title_textures.rs:2779` (the test's assert without the fix) | `XCL_D3D12_DEBUG=1` does not reach this test: it makes its own device with `D3D12CreateDevice`, hence the scratch `EnableDebugLayer()`. **Not tested:** where the `0x87D` comes from; a title; AMD; a release build. **AI use:** Claude Code (Claude Opus 5.5) ran the suite, the repeats and the scratch debug-layer runs, and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 01:36 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 01:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7179941668) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 02:12 UTC · original

AMD RX 7800 XT (wave64) on e44c9ff: the new test passes 10 of 10, and 5 of 5 with the D3D12 debug layer on (0 info-queue messages). With the three forget_last_content calls turned off it fails at the lazy-level assert. The only suite failure is the known AMD fuzz failure #2115, which fails the same way on the parent.

Tested: e44c9ffd5adb500cf3267114dfed4acfb5401c93 (as is, not merged onto main) and its parent e1d84b7d9153f86a97d2ec5d209d196046fc0bea as the control, both clean checkouts. AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, 64 GB, Windows 11 Pro 26200, Rust 1.100.0 MSVC, debug, Graphics Tools (d3d12SDKLayers.dll) installed.

e44c9ff parent e1d84b7
cargo test --workspace --no-fail-fast -- --test-threads=4 1423 passed, 1 failed, 46 ignored 1422 passed, 1 failed, 46 ignored
the failure gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, seed 722 res[30] = 0x1, CPU 0x7fffffff (#2115) the same test, seed and values
SKIPPED lines 7: 6 #1426 per-lane f16/f32 refusals, 1 no heap windows the same 7
uploads_start_from_each_subresources_state, test_title_*_under_the_debug_layer* pass pass
shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes --exact, 10 runs 10 of 10 (not on the parent)

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 e44c9ff. The copy only adds printouts, an EnableDebugLayer() call before the test's D3D12CreateDevice, a dump of the info queue at the end, and an env switch that makes forget_last_content return early. None of it is committed. The test used the RX 7800 XT, and has_lazy_levels was true, so step 1 (lazy level pages) ran on this adapter:

result
debug layer on, fix on, 5 runs 5 of 5 pass, test end reached, 0 stored info-queue messages, exit 0
debug layer on, fix off, 3 runs 3 of 3 fail at uncovered lazy texture must remap all non-zero levels, the assert at title_textures.rs:2787 of the PR; no 0x87D
debug layer off, fix off, 2 runs 2 of 2 fail at the same assert

Not tested: a title or smoke run; a release build; e44c9ff merged onto current main; the without-fix control under the debug layer stops at step 1, so steps 2 and 3 were not run without the fix on this adapter; other AMD GPUs.

AI use: Claude Code (Claude Opus 5.5) ran the suites, the repeats and the scratch debug-layer runs, and wrote this report.

**@⁠oni-swr** on GitHub · 2026-11-26 02:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7180567934) **AMD RX 7800 XT (wave64) on `e44c9ff`: the new test passes 10 of 10, and 5 of 5 with the D3D12 debug layer on (0 info-queue messages). With the three `forget_last_content` calls turned off it fails at the lazy-level assert. The only suite failure is the known AMD fuzz failure #2115, which fails the same way on the parent.** **Tested:** `e44c9ffd5adb500cf3267114dfed4acfb5401c93` (as is, not merged onto `main`) and its parent `e1d84b7d9153f86a97d2ec5d209d196046fc0bea` as the control, both clean checkouts. AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, 64 GB, Windows 11 Pro 26200, Rust 1.100.0 MSVC, debug, Graphics Tools (`d3d12SDKLayers.dll`) installed. | | `e44c9ff` | parent `e1d84b7` | |---|---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1423 passed, 1 failed, 46 ignored | 1422 passed, 1 failed, 46 ignored | | the failure | `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, seed 722 `res[30] = 0x1, CPU 0x7fffffff` (#2115) | the same test, seed and values | | `SKIPPED` lines | 7: 6 `#1426` per-lane f16/f32 refusals, 1 `no heap windows` | the same 7 | | `uploads_start_from_each_subresources_state`, `test_title_*_under_the_debug_layer*` | pass | pass | | `shadowed_placed_texture_reuploads_and_remaps_levels_with_unchanged_cpu_bytes --exact`, 10 runs | 10 of 10 | (not on the parent) | 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 `e44c9ff`. The copy only adds printouts, an `EnableDebugLayer()` call before the test's `D3D12CreateDevice`, a dump of the info queue at the end, and an env switch that makes `forget_last_content` return early. None of it is committed. The test used the RX 7800 XT, and `has_lazy_levels` was true, so step 1 (lazy level pages) ran on this adapter: | | result | |---|---| | debug layer on, fix on, 5 runs | 5 of 5 pass, test end reached, 0 stored info-queue messages, exit 0 | | debug layer on, fix off, 3 runs | 3 of 3 fail at `uncovered lazy texture must remap all non-zero levels`, the assert at `title_textures.rs:2787` of the PR; no `0x87D` | | debug layer off, fix off, 2 runs | 2 of 2 fail at the same assert | **Not tested:** a title or smoke run; a release build; `e44c9ff` merged onto current `main`; the without-fix control under the debug layer stops at step 1, so steps 2 and 3 were not run without the fix on this adapter; other AMD GPUs. **AI use:** Claude Code (Claude Opus 5.5) ran the suites, the repeats and the scratch debug-layer runs, and wrote this report.
Author
Owner

@⁠GodlyBDS on GitHub · 2026-11-26 02:30 UTC · original · edited 2026-11-26 02:38 UTC

RTX 3090 Ti readback of the plain placed-texture remap case

Windows 10 19045, NVIDIA 621.40, release on a local 08294413-based build. I applied the runtime invalidation from #2578 and the test-side tile-queue drain from e44c9ffd. I adapted the fixture to the plain placed-texture path available on that base.

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 retire_overlapping removes A's cached hash. The older base lacks lazy per-mip page mapping, so this covers the plain path. No world-rendering result from this test.

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.

**@⁠GodlyBDS** on GitHub · 2026-11-26 02:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2578#issuecomment-7180866305) · edited 2026-11-26 02:38 UTC **RTX 3090 Ti readback of the plain placed-texture remap case** Windows 10 19045, NVIDIA 621.40, release on a local `08294413`-based build. I applied the runtime invalidation from #2578 and the test-side tile-queue drain from `e44c9ffd`. I adapted the fixture to the plain placed-texture path available on that base. 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 `retire_overlapping` removes A's cached hash. The older base lacks lazy per-mip page mapping, so this covers the plain path. No world-rendering result from this test. 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2578/head:github-bot/gh-2578'
git switch 'github-bot/gh-2578'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2578'
git switch 'github-bot/gh-2578'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2578'
git switch 'github-bot/gh-2578'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2578'
git switch 'main'
git merge --squash 'github-bot/gh-2578'
git switch 'main'
git merge --ff-only 'github-bot/gh-2578'
git switch 'main'
git merge 'github-bot/gh-2578'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.