D3D12.X: unmap a superseded texture only once the work before it is done #2260

Closed
joeypercia wants to merge 1 commit from upstream-pr/2270 into main
joeypercia commented 2026-11-25 11:55:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-25T11:55:29Z.


vram::unmap_superseded NULL-maps a placed texture's tiles on the tile-mapping queue the moment a newer placement covers it. Nothing orders that against work already submitted that copies to or samples the texture. Changing a reserved texture's mappings under a copy that's running removes the device on at least one NVIDIA Blackwell card. With the probe, which copies on one queue while the mapping flips to NULL on another:

  • RTX 5070 (driver 610.88): 0x887A0006 after 1.8 s (Dezmonius).
  • RTX 3070 (616.56): all 20 rounds finish (upipibi).
  • RTX 4070 Ti (621.40): all 20 rounds finish.

Title runs on #2057 on an RTX 5080 and an RTX 3080 Ti end in a DRED page fault on a live texture inside a run of CopyTextureRegions (kanade333, dhillonjagdeep650-boop). This race is a cause that fits; whether it's the cause of those runs is not shown yet.

Update: on an RTX 5080 (driver 621.40), @kanade333 ran #2057 with and without this PR, two runs each. One run with it was still removed by the same fault (0x887a0006, DRED page fault at VA 0x0 inside a run of CopyTextureRegions), and one without it reached the 420 s limit. So this race isn't, or isn't the only, cause of that in-world fault, and the probe passes on that card with that driver. What this PR fixes is the race the probe shows on the RTX 5070.

Now unmap_superseded puts a mark (a fence signal) on every queue the title submitted to and on XCL's upload queues. The unmap, with the return of the texture's tiles to the pool, waits in a list until the CPU sees every mark done. before_execute makes the ones that are. The mapping queue never waits for a title queue. That is the cycle found in #594: a title queue waiting for work submitted later on another queue, which waits behind the mapping queue. The design is @upipibi's from #594 and the variant @Ali-AbdulHadii ran there. #594 itself (@Abdellah-Khanani) waits on the GPU and conflicts with main now. This PR replaces that approach, and I'm happy to close it in favour of an update of #594 if its authors prefer.

Part of #1773. Related: #475, #594.

What is in it (crates/xcl/src/hle/d3d12x/vram.rs, one commit)

  • Pages::mark (a reusable fence per queue), HeldUnmap and Pages::release_held. unmap_superseded holds the unmap. If a mark can't be made, the texture stays mapped, as before any unmap.
  • before_execute makes the held unmaps whose marks are done. Their textures are let go of after PAGES is unlocked, because the last reference's release comes back to forget_pages.
  • remap_if_unmapped drops a held unmap: the texture never lost its tiles.
  • GPU test a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done. A title queue's submitted work is held behind a fence. The superseded texture keeps its tiles until that work is done and gets no NULL mapping before then, then the tiles go back. A texture mapped again before its unmap keeps its tiles, and its unmap is dropped. With the unmap made at once (as on main), the test fails at "no unmap yet".

Tested

  • NVIDIA GeForce RTX 4070 Ti (Ada), driver 621.40, and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with XCL_ADAPTER=Radeon; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.8.2502.11; debug for the tests, release for the runs.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on b7f6b76:
    • RTX 4070 Ti: 1251 passed, 0 failed, 46 ignored.
    • RDNA2: 1250 passed, 1 failed, 46 ignored. The failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way on main 1a0bbe3 on this iGPU (#2115).
    • Correction: the new test, like d32s8_targets_take_their_own_size_of_video_memory, creates its device on EnumAdapters1(0) and ignores XCL_ADAPTER, as @luckyteagirl and @GustavoEllwanger found. So in the "RDNA2" run it ran on the RTX 4070 Ti again. It has not run on AMD here. @oni-swr ran it on an RX 7800 XT (RDNA3) machine.
    • SKIPPED: RTX 4070 Ti: the wave64 cases of the lower / lower_dxil GPU tests, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64). RDNA2: the mesh-shader tests. Both: heap_window_out_of_memory_falls_back_to_the_switch_form, pso_measurement_compiles_an_exact_synthetic_record (no Developer Mode), test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state, and the lower_dxil f16 / f32 cases the direct backend refuses.

Regression run

RTX 4070 Ti (driver 621.40), release builds, 60 s each, scripts/smoke.ps1 -Game <folder> -Title retail-title on the newer retail title, one after the other from the same shell with the same settings. main 1a0bbe3 (this PR's base) and this PR's head (no uncommitted changes):

main:

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1537 (PresentX 1538)
presents per 2 s (last 3): 60 60 52
device removals: 0
crashes: 0
peak commit: 16109 MB

PR:

xcl-smoke v1
commit: b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1586 (PresentX 1587)
presents per 2 s (last 3): 60 60 51
device removals: 0
crashes: 0
peak commit: 16445 MB

Not tested

  • On a GPU where the race removes the device (the RTX 5070 / 5080 above). I don't have one. The fix is checked by the GPU test, not by a run that used to fail. A test of this branch on one of those cards, in the title or with the probe's r_null_during_copyq turned into XCL calls, would settle it.
  • Work submitted after the texture was superseded that still uses it. The marks only cover work submitted before. XCL's own uploads into a superseded texture stop at that point (title_textures shadows it).
  • AMD in the title. The new test on this machine's RDNA2 iGPU (see the correction above).

AI use

  • Claude Code with Claude Opus 5.5: wrote the probe, the fix, the test and this description, and ran the tests and the runs on the hardware above. The design follows the #594 thread, as credited above.
<!-- greyfinch-sync:ivall/xcl:issue:5490836470 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-25T11:55:29Z. --- `vram::unmap_superseded` NULL-maps a placed texture's tiles on the tile-mapping queue the moment a newer placement covers it. Nothing orders that against work already submitted that copies to or samples the texture. Changing a reserved texture's mappings under a copy that's running removes the device on at least one NVIDIA Blackwell card. With the [probe](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7160441802), which copies on one queue while the mapping flips to NULL on another: - RTX 5070 (driver 610.88): `0x887A0006` after 1.8 s ([Dezmonius](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7161253994)). - RTX 3070 (616.56): all 20 rounds finish ([upipibi](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7161501048)). - RTX 4070 Ti (621.40): all 20 rounds finish. Title runs on #2057 on an RTX 5080 and an RTX 3080 Ti end in a DRED page fault on a live texture inside a run of `CopyTextureRegion`s ([kanade333](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7160351986), [dhillonjagdeep650-boop](https://github.com/xcl-dev/xcl/issues/1773#issuecomment-7156349123)). This race is a cause that fits; whether it's the cause of those runs is not shown yet. **Update:** on an RTX 5080 (driver 621.40), [@kanade333](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163435608) ran #2057 with and without this PR, two runs each. One run with it was still removed by the same fault (`0x887a0006`, DRED page fault at VA `0x0` inside a run of `CopyTextureRegion`s), and one without it reached the 420 s limit. So this race isn't, or isn't the only, cause of that in-world fault, and the probe passes on that card with that driver. What this PR fixes is the race the probe shows on the RTX 5070. Now `unmap_superseded` puts a mark (a fence signal) on every queue the title submitted to and on XCL's upload queues. The unmap, with the return of the texture's tiles to the pool, waits in a list until the CPU sees every mark done. `before_execute` makes the ones that are. The mapping queue never waits for a title queue. That is the cycle found in #594: a title queue waiting for work submitted later on another queue, which waits behind the mapping queue. The design is @upipibi's from #594 and the variant @Ali-AbdulHadii ran there. #594 itself (@Abdellah-Khanani) waits on the GPU and conflicts with `main` now. This PR replaces that approach, and I'm happy to close it in favour of an update of #594 if its authors prefer. Part of #1773. Related: #475, #594. **What is in it** (`crates/xcl/src/hle/d3d12x/vram.rs`, one commit) - `Pages::mark` (a reusable fence per queue), `HeldUnmap` and `Pages::release_held`. `unmap_superseded` holds the unmap. If a mark can't be made, the texture stays mapped, as before any unmap. - `before_execute` makes the held unmaps whose marks are done. Their textures are let go of after `PAGES` is unlocked, because the last reference's release comes back to `forget_pages`. - `remap_if_unmapped` drops a held unmap: the texture never lost its tiles. - GPU test `a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done`. A title queue's submitted work is held behind a fence. The superseded texture keeps its tiles until that work is done and gets no NULL mapping before then, then the tiles go back. A texture mapped again before its unmap keeps its tiles, and its unmap is dropped. With the unmap made at once (as on `main`), the test fails at "no unmap yet". **Tested** - NVIDIA GeForce RTX 4070 Ti (Ada), driver 621.40, and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with `XCL_ADAPTER=Radeon`; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.8.2502.11; debug for the tests, release for the runs. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `b7f6b76`: - RTX 4070 Ti: **1251 passed, 0 failed, 46 ignored**. - RDNA2: **1250 passed, 1 failed, 46 ignored**. The failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, which fails the same way on `main` `1a0bbe3` on this iGPU (#2115). - **Correction:** the new test, like `d32s8_targets_take_their_own_size_of_video_memory`, creates its device on `EnumAdapters1(0)` and ignores `XCL_ADAPTER`, as @luckyteagirl and @GustavoEllwanger found. So in the "RDNA2" run it ran on the RTX 4070 Ti again. It has not run on AMD here. @oni-swr ran it on an RX 7800 XT (RDNA3) machine. - `SKIPPED`: RTX 4070 Ti: the wave64 cases of the `lower` / `lower_dxil` GPU tests, `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). RDNA2: the mesh-shader tests. Both: `heap_window_out_of_memory_falls_back_to_the_switch_form`, `pso_measurement_compiles_an_exact_synthetic_record` (no Developer Mode), `test_title_draws_with_a_root_signature_under_the_debug_layer`, `uploads_start_from_each_subresources_state`, and the `lower_dxil` f16 / f32 cases the direct backend refuses. **Regression run** RTX 4070 Ti (driver 621.40), release builds, 60 s each, `scripts/smoke.ps1 -Game <folder> -Title retail-title` on the newer retail title, one after the other from the same shell with the same settings. `main` `1a0bbe3` (this PR's base) and this PR's head (no uncommitted changes): main: ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1537 (PresentX 1538) presents per 2 s (last 3): 60 60 52 device removals: 0 crashes: 0 peak commit: 16109 MB ``` PR: ``` xcl-smoke v1 commit: b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0 gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1586 (PresentX 1587) presents per 2 s (last 3): 60 60 51 device removals: 0 crashes: 0 peak commit: 16445 MB ``` **Not tested** - On a GPU where the race removes the device (the RTX 5070 / 5080 above). I don't have one. The fix is checked by the GPU test, not by a run that used to fail. A test of this branch on one of those cards, in the title or with the probe's `r_null_during_copyq` turned into XCL calls, would settle it. - Work submitted after the texture was superseded that still uses it. The marks only cover work submitted before. XCL's own uploads into a superseded texture stop at that point (`title_textures` shadows it). - AMD in the title. The new test on this machine's RDNA2 iGPU (see the correction above). **AI use** - Claude Code with Claude Opus 5.5: wrote the probe, the fix, the test and this description, and ran the tests and the runs on the hardware above. The design follows the #594 thread, as credited above.
kanade333 commented 2026-11-25 14:09:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kanade333 on 2026-11-25T13:12:08Z.


RTX 5080 16 GB (Blackwell), driver 621.40: two runs with this PR and two without, on #2057's head. One of each was removed and one of each ran to the 420 s limit, so on this card these runs show no difference either way. The probe passes all 13 cases here.

@joeypercia, thanks for the probe and the fix. Numbers below.

Setup: NVIDIA GeForce RTX 5080 16 GB (driver 621.40), AMD Ryzen 9 9950X, 32 GB RAM, Windows 11 Pro 26200, release. Retail title of #505, 1.0.2.1, XCL_NETWORK=0, scripted A presses.

Trees

  • "without": #2057 at 4df1e6e, unchanged.
  • "with": 4df1e6e + this PR's commit b7f6b76. It applies with one conflict in vram::before_execute, where main has since added the heap reclaim of 5a515f0. I kept 4df1e6e's body and added only this PR's part: release_held(now) under PAGES, and the released textures dropped after the lock. cargo test --release -p xcl --lib -- d3d12x::vram --test-threads=4 on it: 12 passed, 0 failed, 1 ignored.

Probe (b39608e, release, one process per case, before the title runs): all 13 complete with no removal. The 10 fixed-mapping cases read every mapped word right and zeros from NULL tiles. The three concurrent cases finish their 20 rounds in 0.4 s (r_null_during_copyq, 1,258 remaps), 0.1 s (r_null_during_direct, 252) and 0.4 s (r_other_tiles_during_copyq, 820). The copies end so fast on this card that the remaps have little time to land in the middle of one, so this does not show the race is harmless here.

Title runs, all with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_COHERENT_MB=512 XCL_LOOK_SKIP=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_RUN_SECONDS=420, warm caches (all 2,689 compute pipelines built ahead with this driver), one after the other:

run tree presents after 62 s end
33 without 241 0x887a0006 at 379.3 s
34 with 1,295 ran to 420 s
35 with 0 (removed before the world) 0x887a0006 at 55.6 s
36 without 2,285 ran to 420 s
  • All three removals: DRED page fault at GPU VA 0x0; allocations there: []; recently freed: [], with the list in flight inside a run of CopyTextureRegion (breadcrumbs 8 8 8 >8 8 8; 6 of 19 and 15 of 39 operations done). On driver 610.88 this morning the same tree's two DRED runs faulted at an address inside a live resource instead (my comment on #2057), also in CopyTextureRegions.
  • 0 GPU-wait time-outs, 0 watchdog releases, 0 failed DirectStorage requests in all four.
  • Local video memory peaked at 17.2–20.3 GB.
  • Runs 34 and 36 both have long stretches with no present and no submit (from about 235 s on in 34; 240–330 s in 36, which then picked up again). In the thread dump at 250 s in 36, the title's worker threads sit in waits called from its own code (+0x221c3c2); I have not looked further.

I could not tell from the log whether an unmap was actually held in runs 34 and 35: nothing logs it.

Not tested: more than two runs per tree; this PR on main; another Blackwell card; whether an unmap was held.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran the probe and the title on this machine, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7163435608 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163435608). Originally posted by [kanade333](https://github.com/kanade333) on 2026-11-25T13:12:08Z. --- **RTX 5080 16 GB (Blackwell), driver 621.40: two runs with this PR and two without, on #2057's head. One of each was removed and one of each ran to the 420 s limit, so on this card these runs show no difference either way. The probe passes all 13 cases here.** @joeypercia, thanks for the probe and the fix. Numbers below. **Setup:** NVIDIA GeForce RTX 5080 16 GB (driver 621.40), AMD Ryzen 9 9950X, 32 GB RAM, Windows 11 Pro 26200, release. Retail title of #505, 1.0.2.1, `XCL_NETWORK=0`, scripted A presses. **Trees** - "without": #2057 at `4df1e6e`, unchanged. - "with": `4df1e6e` + this PR's commit `b7f6b76`. It applies with one conflict in `vram::before_execute`, where `main` has since added the heap reclaim of `5a515f0`. I kept `4df1e6e`'s body and added only this PR's part: `release_held(now)` under `PAGES`, and the released textures dropped after the lock. `cargo test --release -p xcl --lib -- d3d12x::vram --test-threads=4` on it: 12 passed, 0 failed, 1 ignored. **Probe** (`b39608e`, release, one process per case, before the title runs): all 13 complete with no removal. The 10 fixed-mapping cases read every mapped word right and zeros from NULL tiles. The three concurrent cases finish their 20 rounds in 0.4 s (`r_null_during_copyq`, 1,258 remaps), 0.1 s (`r_null_during_direct`, 252) and 0.4 s (`r_other_tiles_during_copyq`, 820). The copies end so fast on this card that the remaps have little time to land in the middle of one, so this does not show the race is harmless here. **Title runs**, all with `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_COHERENT_MB=512 XCL_LOOK_SKIP=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_RUN_SECONDS=420`, warm caches (all 2,689 compute pipelines built ahead with this driver), one after the other: | run | tree | presents after 62 s | end | |---|---|---|---| | 33 | without | 241 | `0x887a0006` at 379.3 s | | 34 | with | 1,295 | ran to 420 s | | 35 | with | 0 (removed before the world) | `0x887a0006` at 55.6 s | | 36 | without | 2,285 | ran to 420 s | - All three removals: `DRED page fault at GPU VA 0x0; allocations there: []; recently freed: []`, with the list in flight inside a run of `CopyTextureRegion` (breadcrumbs `8 8 8 >8 8 8`; 6 of 19 and 15 of 39 operations done). On driver 610.88 this morning the same tree's two DRED runs faulted at an address inside a live resource instead (my comment on #2057), also in `CopyTextureRegion`s. - 0 GPU-wait time-outs, 0 watchdog releases, 0 failed DirectStorage requests in all four. - Local video memory peaked at 17.2–20.3 GB. - Runs 34 and 36 both have long stretches with no present and no submit (from about 235 s on in 34; 240–330 s in 36, which then picked up again). In the thread dump at 250 s in 36, the title's worker threads sit in waits called from its own code (`+0x221c3c2`); I have not looked further. I could not tell from the log whether an unmap was actually held in runs 34 and 35: nothing logs it. **Not tested:** more than two runs per tree; this PR on `main`; another Blackwell card; whether an unmap was held. **AI use:** Claude Code (Claude Opus 5.5) built the trees, ran the probe and the title on this machine, and wrote this report.
luckyteagirl commented 2026-11-25 14:09:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T13:12:36Z.


Independent Windows verification of exact PR head b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0, with a paired owned-title smoke run against its base, main 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6.

Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver 30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Isolated Cargo targets; clean PR worktree. No game files were copied or attached.

GPU regression test: XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 2 a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored. The test emitted D3D12 device/queue/resource and sparse-VRAM setup logs, then completed the held-unmap assertions. This fixture calls EnumAdapters1(0) directly, so XCL_ADAPTER does not select its GPU; I did not verify the name of adapter 0. The result is a hardware-adapter test result, not a confirmed RX 6800M result.

Release and title regression run: cargo build --locked --workspace --release -j 2 passed on the clean PR head. I ran scripts/smoke.ps1 through a process and memory guard for 12 seconds per revision, with the same owned title and XCL_ADAPTER=6800M, default translation mode, and separate fresh data/cache directories. Neither run hit the guard.

Main:

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 12
exit: 0x0
frames shown: 111 (PresentX 111)
presents per 2 s (last 3): 1 50 60
device removals: 0
crashes: 0
peak commit: 8162 MB

PR head:

xcl-smoke v1
commit: b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 12
exit: 0x0
frames shown: 113 (PresentX 113)
presents per 2 s (last 3): 0 53 60
device removals: 0
crashes: 0
peak commit: 8230 MB

Limits: These brief startup runs do not establish whether the title exercised the superseded-texture unmap path, and frame counts are not a performance comparison. I did not run the full workspace suite on this PR head; the author reports it separately. The focused fixture's exact GPU identity remains unverified because it hard-codes DXGI adapter 0.

AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows test and release build, monitored the paired title runs, checked the clean exact head, and drafted this report. No game data was uploaded.

<!-- greyfinch-sync:ivall/xcl:comment:7163446721 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163446721). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T13:12:36Z. --- Independent Windows verification of exact PR head `b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0`, with a paired owned-title smoke run against its base, main `1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6`. **Environment:** Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver `30.0.13002.13003`; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Isolated Cargo targets; clean PR worktree. No game files were copied or attached. **GPU regression test:** `XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 2 a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done -- --test-threads=1 --show-output`: **1 passed, 0 failed, 0 ignored**. The test emitted D3D12 device/queue/resource and sparse-VRAM setup logs, then completed the held-unmap assertions. This fixture calls `EnumAdapters1(0)` directly, so `XCL_ADAPTER` does not select its GPU; I did not verify the name of adapter 0. The result is a hardware-adapter test result, not a confirmed RX 6800M result. **Release and title regression run:** `cargo build --locked --workspace --release -j 2` passed on the clean PR head. I ran `scripts/smoke.ps1` through a process and memory guard for 12 seconds per revision, with the same owned title and `XCL_ADAPTER=6800M`, default translation mode, and separate fresh data/cache directories. Neither run hit the guard. Main: ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 12 exit: 0x0 frames shown: 111 (PresentX 111) presents per 2 s (last 3): 1 50 60 device removals: 0 crashes: 0 peak commit: 8162 MB ``` PR head: ``` xcl-smoke v1 commit: b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0 gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 12 exit: 0x0 frames shown: 113 (PresentX 113) presents per 2 s (last 3): 0 53 60 device removals: 0 crashes: 0 peak commit: 8230 MB ``` **Limits:** These brief startup runs do not establish whether the title exercised the superseded-texture unmap path, and frame counts are not a performance comparison. I did not run the full workspace suite on this PR head; the author reports it separately. The focused fixture's exact GPU identity remains unverified because it hard-codes DXGI adapter 0. **AI use:** OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows test and release build, monitored the paired title runs, checked the clean exact head, and drafted this report. No game data was uploaded.
joeypercia commented 2026-11-25 14:09:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-25T13:12:52Z.


@kanade333 thanks, that's the result that was missing. Run 35 shows the in-world copy fault still happens with this PR, so this race isn't, or isn't the only, cause of it. I've added your runs to the description and narrowed what the PR claims to the race the probe shows on the RTX 5070.

A held unmap isn't logged, as you found. A count of held and released unmaps under XCL_ACTIVITY=1 would answer that. I'll add it as its own diagnostic PR rather than here, so this one's smoke runs stay valid.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7163453100 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163453100). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-25T13:12:52Z. --- @kanade333 thanks, that's the result that was missing. Run 35 shows the in-world copy fault still happens with this PR, so this race isn't, or isn't the only, cause of it. I've added your runs to the description and narrowed what the PR claims to the race the probe shows on the RTX 5070. A held unmap isn't logged, as you found. A count of held and released unmaps under `XCL_ACTIVITY=1` would answer that. I'll add it as its own diagnostic PR rather than here, so this one's smoke runs stay valid. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
GustavoEllwanger commented 2026-11-25 14:09:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GustavoEllwanger on 2026-11-25T13:13:10Z.


Independent dual-GPU Windows verification on exact PR head b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0 (parent 1a0bbe3), including NVIDIA Blackwell hardware.

Correction: As @luckyteagirl noted above, the GPU tests in hle::d3d12x::vram::tests (a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done and d32s8_targets_take_their_own_size_of_video_memory) call factory.EnumAdapters1(0) directly and ignore XCL_ADAPTER. On this machine adapter 0 is the NVIDIA GeForce RTX 5060, so the XCL_ADAPTER=Radeon vram:: run below actually executed those GPU fixtures on the RTX 5060 rather than the AMD RDNA2 iGPU (the hle::d3d12x::real tests in the broader hle::d3d12x:: run did select the Radeon adapter, hence the mesh-shader skip).

Tested

  • Host / toolchain: AMD Ryzen 7 7700, Windows 11, Rust 1.95.0 (59807616e 2026-04-14), DXC 1.8.2502.11, debug build.
  • NVIDIA GeForce RTX 5060 (Blackwell, adapter 0, driver 32.0.16.1088):
    • XCL_ADAPTER=5060 cargo test -p xcl --lib hle::d3d12x::vram:: -- --nocapture --test-threads=1: 16 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing), 0 skipped — a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done passed with no device removal.
    • XCL_ADAPTER=5060 cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: 212 passed, 0 failed, 2 ignored, 0 skipped.
    • XCL_ADAPTER=5060 cargo test --workspace -- --test-threads=4: 1251 passed, 0 failed, 46 ignored (27 runtime SKIPPED: 20 native-wave64 tests on wave32 NVIDIA, 3 per-lane #1426 refusals, 2 missing D3D12 debug layer, 1 Developer Mode cache-disable, 1 heap windows).
  • AMD Radeon(TM) Graphics (RDNA2 iGPU, adapter 1, driver 32.0.21042.62):
    • XCL_ADAPTER=Radeon cargo test -p xcl --lib hle::d3d12x::vram:: -- --nocapture --test-threads=1: 16 passed, 0 failed, 1 ignored, 0 skipped (note: the GPU fixtures in vram::tests ignored XCL_ADAPTER and ran on adapter 0 / RTX 5060; see correction above).
    • XCL_ADAPTER=Radeon cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: 212 passed, 0 failed, 2 ignored, 1 runtime SKIPPED (passthrough_mesh_stream_accepts_a_triangle_driver_blob: no mesh shaders).

Not tested

  • hle::d3d12x::vram::tests GPU fixtures on AMD RDNA2 (blocked by hard-coded EnumAdapters1(0) in the test fixtures), retail title run (scripts/smoke.ps1), the separate #2057 stress probe, full AMD workspace run, Intel GPUs, non-Windows hosts.

AI use

  • Antigravity (Google Gemini): checked out PR head b7f6b76, ran the focused vram/d3d12x suites plus the full RTX 5060 workspace suite, verified the EnumAdapters1(0) adapter selection in vram.rs, and wrote/corrected this report from the raw logs.
<!-- greyfinch-sync:ivall/xcl:comment:7163460093 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163460093). Originally posted by [GustavoEllwanger](https://github.com/GustavoEllwanger) on 2026-11-25T13:13:10Z. --- Independent dual-GPU Windows verification on exact PR head `b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0` (parent `1a0bbe3`), including NVIDIA Blackwell hardware. > **Correction:** As @luckyteagirl noted above, the GPU tests in `hle::d3d12x::vram::tests` (`a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done` and `d32s8_targets_take_their_own_size_of_video_memory`) call `factory.EnumAdapters1(0)` directly and ignore `XCL_ADAPTER`. On this machine adapter 0 is the NVIDIA GeForce RTX 5060, so the `XCL_ADAPTER=Radeon` `vram::` run below actually executed those GPU fixtures on the RTX 5060 rather than the AMD RDNA2 iGPU (the `hle::d3d12x::real` tests in the broader `hle::d3d12x::` run did select the Radeon adapter, hence the mesh-shader skip). **Tested** - Host / toolchain: AMD Ryzen 7 7700, Windows 11, Rust `1.95.0 (59807616e 2026-04-14)`, DXC `1.8.2502.11`, debug build. - **NVIDIA GeForce RTX 5060** (Blackwell, adapter 0, driver `32.0.16.1088`): - `XCL_ADAPTER=5060 cargo test -p xcl --lib hle::d3d12x::vram:: -- --nocapture --test-threads=1`: **16 passed, 0 failed, 1 ignored** (`churn_update_tile_mappings_timing`), 0 skipped — `a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done` passed with no device removal. - `XCL_ADAPTER=5060 cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4`: **212 passed, 0 failed, 2 ignored**, 0 skipped. - `XCL_ADAPTER=5060 cargo test --workspace -- --test-threads=4`: **1251 passed, 0 failed, 46 ignored** (27 runtime `SKIPPED`: 20 native-wave64 tests on wave32 NVIDIA, 3 per-lane `#1426` refusals, 2 missing D3D12 debug layer, 1 Developer Mode cache-disable, 1 heap windows). - **AMD Radeon(TM) Graphics** (RDNA2 iGPU, adapter 1, driver `32.0.21042.62`): - `XCL_ADAPTER=Radeon cargo test -p xcl --lib hle::d3d12x::vram:: -- --nocapture --test-threads=1`: **16 passed, 0 failed, 1 ignored**, 0 skipped *(note: the GPU fixtures in `vram::tests` ignored `XCL_ADAPTER` and ran on adapter 0 / RTX 5060; see correction above)*. - `XCL_ADAPTER=Radeon cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4`: **212 passed, 0 failed, 2 ignored**, 1 runtime `SKIPPED` (`passthrough_mesh_stream_accepts_a_triangle_driver_blob: no mesh shaders`). **Not tested** - `hle::d3d12x::vram::tests` GPU fixtures on AMD RDNA2 (blocked by hard-coded `EnumAdapters1(0)` in the test fixtures), retail title run (`scripts/smoke.ps1`), the separate `#2057` stress probe, full AMD workspace run, Intel GPUs, non-Windows hosts. **AI use** - Antigravity (Google Gemini): checked out PR head `b7f6b76`, ran the focused `vram`/`d3d12x` suites plus the full RTX 5060 workspace suite, verified the `EnumAdapters1(0)` adapter selection in `vram.rs`, and wrote/corrected this report from the raw logs.
oni-swr commented 2026-11-25 14:09:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T13:19:10Z.


AMD RDNA3 (native wave64) test report for exact head b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0, as pushed (not merged onto current main).

Tested

  • AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003; Windows 11 Pro 10.0.26200; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.0.5512 (dxcompiler.dll)
  • cargo build --workspace: ok
  • Targeted: a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done: 1 passed; vram filter: 18 passed, 0 failed, 1 ignored
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1250 passed, 1 failed, 46 ignored (summed over all test binaries)
  • SKIPPED: 7 lines in the full run (6 `lower_dxil` f16/f32 per-lane-form cases "refused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 ... #1426 semantics)", plus `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`). The one failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722: res[30] = 0x1, CPU 0x7fffffff). It is not in code this PR touches, and I reproduced the same failure and seed on `main` at `1a0bbe3` with `cargo test -p xcl --lib fuzz_validate_and_gpu_1`, so it is pre-existing on RDNA3, not caused by this PR.

Not tested

  • No game title, no scripts/smoke.ps1 regression run (synthetic GPU/unit tests only)
  • Not merged onto current main; other GPUs (NVIDIA / Intel / RDNA2 / RDNA4)
  • Whether the new test fails without the fix (I did not revert it)

AI use: Claude Code (Claude Sonnet 5.5) ran the build and tests and wrote this report; the numbers are from the runs above.

<!-- greyfinch-sync:ivall/xcl:comment:7163604121 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7163604121). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T13:19:10Z. --- AMD RDNA3 (native wave64) test report for exact head `b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0`, as pushed (not merged onto current `main`). **Tested** - AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003; Windows 11 Pro 10.0.26200; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.0.5512 (dxcompiler.dll) - `cargo build --workspace`: ok - Targeted: `a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done`: 1 passed; `vram` filter: 18 passed, 0 failed, 1 ignored - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1250 passed, 1 failed, 46 ignored (summed over all test binaries) - SKIPPED: 7 lines in the full run (6 \`lower_dxil\` f16/f32 per-lane-form cases "refused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 ... #1426 semantics)", plus \`heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows\`). The one failure is \`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1\` (seed 722: res[30] = 0x1, CPU 0x7fffffff). It is not in code this PR touches, and I reproduced the same failure and seed on \`main\` at \`1a0bbe3\` with \`cargo test -p xcl --lib fuzz_validate_and_gpu_1\`, so it is pre-existing on RDNA3, not caused by this PR. **Not tested** - No game title, no `scripts/smoke.ps1` regression run (synthetic GPU/unit tests only) - Not merged onto current `main`; other GPUs (NVIDIA / Intel / RDNA2 / RDNA4) - Whether the new test fails without the fix (I did not revert it) **AI use**: Claude Code (Claude Sonnet 5.5) ran the build and tests and wrote this report; the numbers are from the runs above.
DavidM1911 commented 2026-11-25 17:07:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T17:05:05Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7168978625 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7168978625). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:05:05Z. --- 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!
bstillbstill commented 2026-11-25 18:04:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bstillbstill on 2026-11-25T17:15:12Z.


Test report on an RTX 3090 Ti (Ampere): no difference from this PR on this card, either on #2057 or on its own
head.
On #2057 the retail title's silent 0x887a0005 in the world comes at the same time with and without it; on
this PR's own head the title stops presenting within about 2 s of the world load with and without it. Your probe passes here, so the
race doesn't seem to happen on this card.

Setup

  • RTX 3090 Ti 24 GB (driver 621.01), i9-13900K, 31.7 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, release for the
    runs, debug for the tests.
  • Retail title of #505 (1.0.2.1), all 2,689 compute pipelines built ahead for each translator, 300 s runs, scripted A
    presses, XCL_NETWORK=0 XCL_ACTIVITY=1; runs alternated with and without this PR on the same day.

1. On #2057 (4df1e6e + treybertram06's one-line upload wait from #1452, with and without b7f6b76
cherry-picked; it conflicts in vram::before_execute, because #2057 doesn't have main's newer reclaim code there,
so I kept #2057's body and added this PR's two lines, release_held under the lock and the drop after it).
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_LOOK_SKIP=1 XCL_HUGE_PSO_CONCURRENCY=6.

run this PR world load (first 2 s with ≥ 1,000 dispatches) removed (0x887a0005) frames shown after 64 s
h1 yes 68 s 132.9 s 490
h2 yes 64 s 128.9 s 484
h3 yes 64 s 105.3 s 335
b1 no 64 s 130.3 s 468
b2 no 64 s 96.8 s 243
  • All five end the same way: no queue wait timed out, no watchdog release, then the silent removal and the title's
    0x80000003. The scene stays grey in all of them.
  • The same "without" build was removed after 11–18 s in the world the night before (g4–g6 on #2057:
    73.6 s and 83.3 s, one freeze at 82 s); here it lasts 33–66 s. Something besides this PR moves that time between
    days, so only same-day runs are compared.

2. On this PR's own head (b7f6b76) against its parent main (1a0bbe3), both as they are. That main has
no XCL_UMA_SHADOW, so the coherent window is used in place (as in the 5070 Ti run on #2057).
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HUGE_PSO_CONCURRENCY=6.

run build world load last frames queue waits not done within 5,000 ms end
m1 main 72 s ~72 s 6, from 76.9 s no removal; no frame to the 300 s limit, then 0x887a0007 in XCL's queue drain at exit
p1 this PR 70 s ~70 s 7, from 74.8 s 0x887a0006 at 162.0 s
m2 main – – – title crash in the menus at 31.7 s (access violation in VCRUNTIME140.dll, read at 0xc491de410)
p2 this PR 74 s ~76 s 42, from 77.6 s 0x887a0006 at 106.7 s
m3 main 70 s ~72 s 51, from 73.8 s 0x887a0006 at 106.4 s

So on this card the title doesn't get past the world load's first seconds on this base, with or without the PR, and
never reaches the in-world stretch where the copy-fault removal would show.

Tests

  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on b7f6b76:
    1251 passed, 0 failed, 46 ignored, including
    a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done. 25 SKIPPED lines: 20 "no wave64", 3
    per-lane f16 forms refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), pso_measurement_compiles_an_exact_synthetic_record
    (driver cache can't be disabled without Developer Mode), heap_window_out_of_memory_falls_back_to_the_switch_form
    (no heap windows).
  • On the #2057 merge (debug): cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=4: 12 passed, 0 failed,
    1 ignored.
  • Your probe (probe/reserved-copy-faults at b39608e, debug, one process per case as in your loop): all 13
    cases pass, no removal.
    Mapped tiles read back right and NULL tiles read 0; r_null_during_copyq,
    r_null_during_direct and r_other_tiles_during_copyq ran all 20 rounds with 20,900 / 24,628 / 15,808 remaps.
    So the race doesn't remove the device on this card (as on the 3070 and 4070 Ti), which fits this PR changing
    nothing in the runs above.

Not tested: this PR merged with the latest main (it conflicts with 68a284a) or in the
RTX 5070 Ti stack on #2057; AMD.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran everything above and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7169231363 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7169231363). Originally posted by [bstillbstill](https://github.com/bstillbstill) on 2026-11-25T17:15:12Z. --- Test report on an RTX 3090 Ti (Ampere): **no difference from this PR on this card, either on #2057 or on its own head.** On #2057 the retail title's silent `0x887a0005` in the world comes at the same time with and without it; on this PR's own head the title stops presenting within about 2 s of the world load with and without it. Your probe passes here, so the race doesn't seem to happen on this card. **Setup** - RTX 3090 Ti 24 GB (driver 621.01), i9-13900K, 31.7 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, release for the runs, debug for the tests. - Retail title of #505 (1.0.2.1), all 2,689 compute pipelines built ahead for each translator, 300 s runs, scripted A presses, `XCL_NETWORK=0 XCL_ACTIVITY=1`; runs alternated with and without this PR on the same day. **1. On #2057** (`4df1e6e` + treybertram06's one-line upload wait from #1452, with and without `b7f6b76` cherry-picked; it conflicts in `vram::before_execute`, because #2057 doesn't have `main`'s newer reclaim code there, so I kept #2057's body and added this PR's two lines, `release_held` under the lock and the drop after it). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_LOOK_SKIP=1 XCL_HUGE_PSO_CONCURRENCY=6`. | run | this PR | world load (first 2 s with ≥ 1,000 dispatches) | removed (`0x887a0005`) | frames shown after 64 s | |---|---|---|---|---| | h1 | yes | 68 s | 132.9 s | 490 | | h2 | yes | 64 s | 128.9 s | 484 | | h3 | yes | 64 s | 105.3 s | 335 | | b1 | no | 64 s | 130.3 s | 468 | | b2 | no | 64 s | 96.8 s | 243 | - All five end the same way: no queue wait timed out, no watchdog release, then the silent removal and the title's `0x80000003`. The scene stays grey in all of them. - The same "without" build was removed after 11–18 s in the world the night before ([g4–g6 on #2057](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7168399267): 73.6 s and 83.3 s, one freeze at 82 s); here it lasts 33–66 s. Something besides this PR moves that time between days, so only same-day runs are compared. **2. On this PR's own head** (`b7f6b76`) against its parent `main` (`1a0bbe3`), both as they are. That `main` has no `XCL_UMA_SHADOW`, so the coherent window is used in place (as in the 5070 Ti run on #2057). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HUGE_PSO_CONCURRENCY=6`. | run | build | world load | last frames | queue waits not done within 5,000 ms | end | |---|---|---|---|---|---| | m1 | `main` | 72 s | ~72 s | 6, from 76.9 s | no removal; no frame to the 300 s limit, then `0x887a0007` in XCL's queue drain at exit | | p1 | this PR | 70 s | ~70 s | 7, from 74.8 s | `0x887a0006` at 162.0 s | | m2 | `main` | – | – | – | title crash in the menus at 31.7 s (access violation in `VCRUNTIME140.dll`, read at `0xc491de410`) | | p2 | this PR | 74 s | ~76 s | 42, from 77.6 s | `0x887a0006` at 106.7 s | | m3 | `main` | 70 s | ~72 s | 51, from 73.8 s | `0x887a0006` at 106.4 s | So on this card the title doesn't get past the world load's first seconds on this base, with or without the PR, and never reaches the in-world stretch where the copy-fault removal would show. **Tests** - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `b7f6b76`: **1251 passed, 0 failed, 46 ignored**, including `a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done`. 25 `SKIPPED` lines: 20 "no wave64", 3 per-lane f16 forms refused (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`), `pso_measurement_compiles_an_exact_synthetic_record` (driver cache can't be disabled without Developer Mode), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - On the #2057 merge (debug): `cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=4`: 12 passed, 0 failed, 1 ignored. - Your probe (`probe/reserved-copy-faults` at `b39608e`, debug, one process per case as in your loop): **all 13 cases pass, no removal.** Mapped tiles read back right and NULL tiles read 0; `r_null_during_copyq`, `r_null_during_direct` and `r_other_tiles_during_copyq` ran all 20 rounds with 20,900 / 24,628 / 15,808 remaps. So the race doesn't remove the device on this card (as on the 3070 and 4070 Ti), which fits this PR changing nothing in the runs above. **Not tested:** this PR merged with the latest `main` (it conflicts with `68a284a`) or in the [RTX 5070 Ti stack on #2057](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7166343260); AMD. AI use: Claude Code (Claude Opus 5.5) built the trees, ran everything above and wrote this report.
Dezmonius commented 2026-11-25 19:08:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Dezmonius on 2026-11-25T18:10:22Z.


RTX 5070 verification of #2270

The PR's added D3D12.X VRAM test passed on this RTX 5070. Both builds stopped presenting during a paired title run before the prologue was visible. The logs recorded DirectStorage request failures and no D3D12 device removal or DRED page fault.

Tested

  • Base 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 and PR b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0, built in separate target directories from the commit snapshots without local source changes.
  • RTX 5070 12 GiB, NVIDIA 610.88 (32.0.16.1088), Core i7-7700K, 32 GiB RAM, Windows 10 Home build 19045, Rust 1.100.0 MSVC, release.
  • Archived local VRAM runs used cargo test --locked --offline --release -j 4 -p xcl --lib hle::d3d12x::vram::tests:: -- --show-output --test-threads=1. Base: 15 passed, 0 failed, 1 ignored. PR: 16 passed, 0 failed, 1 ignored. The added a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done also passed in isolation. Both runs ignored churn_update_tile_mappings_timing. Neither log reports a GPU skip.
  • Retail title 1.0.2.1 on 2026-11-25. One full run per build in PR → base order, each with the 600 s internal timer, copies of the same local profile and warm DXIL cache, Direct DXIL, DRED enabled, two DXC threads, PSO preload disabled, heap windows enabled, sparse coherent heaps (sparse:16), and networking disabled. The completed pair ran without scripted controller input.
Build Exit (wall time) PresentX calls Last Present window DirectStorage failures Min. available RAM
Base 0x0, internal timer (605.1 s) 1507 ~272 s 398 4.74 GiB
PR 0x0, internal timer (605.5 s) 1006 ~204 s 817 3.52 GiB

The last saved frames showed a loading illustration on base and a nearly black frame on the PR. The first logged DirectStorage request failure on each was 0x89240009, before its last Present. An earlier attempt per build overlapped a separate Cargo job and was stopped by the harness at its available-RAM floor (base 421.9 s, PR 90.4 s).

Not tested

  • Full workspace suite, current main, and the earlier device-removal scenario under conditions where the base reliably reproduces it. With one completed run per build and a shared system driver cache, frame and request counts alone do not establish a PR regression.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable in this session) ran the paired comparison, checked the saved VRAM test logs and title-run evidence, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7170539788 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7170539788). Originally posted by [Dezmonius](https://github.com/Dezmonius) on 2026-11-25T18:10:22Z. --- **RTX 5070 verification of #2270** The PR's added D3D12.X VRAM test passed on this RTX 5070. Both builds stopped presenting during a paired title run before the prologue was visible. The logs recorded DirectStorage request failures and no D3D12 device removal or DRED page fault. **Tested** - Base `1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6` and PR `b7f6b760e2ce94f68a05ed7c5aeac0360abac1b0`, built in separate target directories from the commit snapshots without local source changes. - RTX 5070 12 GiB, NVIDIA 610.88 (32.0.16.1088), Core i7-7700K, 32 GiB RAM, Windows 10 Home build 19045, Rust 1.100.0 MSVC, release. - Archived local VRAM runs used `cargo test --locked --offline --release -j 4 -p xcl --lib hle::d3d12x::vram::tests:: -- --show-output --test-threads=1`. Base: 15 passed, 0 failed, 1 ignored. PR: 16 passed, 0 failed, 1 ignored. The added `a_superseded_texture_keeps_its_tiles_until_the_work_before_it_is_done` also passed in isolation. Both runs ignored `churn_update_tile_mappings_timing`. Neither log reports a GPU skip. - Retail title 1.0.2.1 on 2026-11-25. One full run per build in PR → base order, each with the 600 s internal timer, copies of the same local profile and warm DXIL cache, Direct DXIL, DRED enabled, two DXC threads, PSO preload disabled, heap windows enabled, sparse coherent heaps (`sparse:16`), and networking disabled. The completed pair ran without scripted controller input. | Build | Exit (wall time) | PresentX calls | Last Present window | DirectStorage failures | Min. available RAM | | --- | --- | ---: | ---: | ---: | ---: | | Base | `0x0`, internal timer (605.1 s) | 1507 | ~272 s | 398 | 4.74 GiB | | PR | `0x0`, internal timer (605.5 s) | 1006 | ~204 s | 817 | 3.52 GiB | The last saved frames showed a loading illustration on base and a nearly black frame on the PR. The first logged DirectStorage request failure on each was `0x89240009`, before its last Present. An earlier attempt per build overlapped a separate Cargo job and was stopped by the harness at its available-RAM floor (base 421.9 s, PR 90.4 s). **Not tested** - Full workspace suite, current main, and the earlier device-removal scenario under conditions where the base reliably reproduces it. With one completed run per build and a shared system driver cache, frame and request counts alone do not establish a PR regression. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable in this session) ran the paired comparison, checked the saved VRAM test logs and title-run evidence, and drafted this report.
upstream-sync closed this pull request 2026-11-25 23:08:10 +00:00
CalvyPZ commented 2026-11-25 23:09:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:46:11Z.


This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

<!-- greyfinch-sync:ivall/xcl:comment:7176765993 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7176765993). Originally posted by [CalvyPZ](https://github.com/CalvyPZ) on 2026-11-25T22:46:11Z. --- This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
upstream-sync reopened this pull request 2026-11-26 00:04:55 +00:00
safesearch77 commented 2026-11-26 16:40:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T16:40:16Z.


Reviewed b7f6b760 (D116 settled winner) and compile-verified a rebase onto main (8b957bec,
which merged #2268 and #2306). One subtle semantic interaction with #2306 (t.levels /
LEVEL_STATS) to watch when resolving the conflict in crates/xcl/src/hle/d3d12x/vram.rs:

  • In remap_if_unmapped, #2270's pages.held check must run before #2306's
    t.levels.is_some() early return, and HeldUnmap must save/restore l.groups[..].3 and
    LEVEL_STATS[2].
    • If if let Some(t) = pages.targets.get_mut(&key).filter(|t| t.levels.is_some()) { t.mapped = true; return true; } runs before pages.held, reviving a superseded lazy-level texture while
      its HeldUnmap is still pending sets t.mapped = true without removing its entry from
      pages.held — so once the earlier marks complete, before_execute -> release_held
      NULL-unmaps the revived texture and frees its tiles out from under it.
    • Likewise, unmap_superseded needs #2306's LEVEL_STATS[2].fetch_sub(l.mapped_tiles(), ...)
      and l.groups[..].3 = false reset, saving (flags, mapped) on HeldUnmap so cancelling a
      held unmap restores both l.groups and LEVEL_STATS[2].
  • In unmap_superseded and before_execute: main now has collect_device_queues(dev_key, None) (which deduplicates queues and includes sparse::queue()) and retire_heaps_and_sweep,
    replacing the old unmap_val / retire_signal / ready_to_drop locals in before_execute;
    keeping main's tile_mappings_for alongside held_unmaps resolves the test-helper conflict.
// Compile-verified conflict resolution in crates/xcl/src/hle/d3d12x/vram.rs on 8b957bec:
struct HeldUnmap {
    res: ID3D12Resource,
    total: u32,
    used: Vec<usize>,
    used_extra: Vec<(usize, usize)>,
    level_groups: Option<(Vec<bool>, u64)>,
    marks: Vec<(ID3D12Fence, u64)>,
}

pub(super) unsafe fn unmap_superseded(res: &ID3D12Resource) {
    let mut dev: Option<ID3D12Device> = None;
    if res.GetDevice(&mut dev).is_err() {
        return;
    }
    let Some(dev) = dev else { return };
    let dev_key = dev.as_raw() as usize;
    let queues: Vec<ID3D12CommandQueue> = collect_device_queues(dev_key, None).into_iter().map(|(_, q)| q).collect();
    let key = res.as_raw() as usize;
    let done = {
        let mut g = PAGES.lock().unwrap();
        let Some(Some(pages)) = g.get_mut(&dev_key) else { return };
        if !pages.targets.get(&key).is_some_and(|t| t.mapped) {
            return;
        }
        let Some(marks) = pages.mark(&dev, &queues) else { return };
        let Some(t) = pages.targets.get_mut(&key) else { return };
        let (total, used, used_extra) = (t.total, std::mem::take(&mut t.used), std::mem::take(&mut t.used_extra));
        t.mapped = false;
        let level_groups = t.levels.as_mut().map(|l| {
            let mapped = l.mapped_tiles();
            LEVEL_STATS[2].fetch_sub(mapped, std::sync::atomic::Ordering::Relaxed);
            let flags = l.groups.iter().map(|g| g.3).collect();
            l.groups.iter_mut().for_each(|g| g.3 = false);
            (flags, mapped)
        });
        pages.held.push(HeldUnmap { res: res.clone(), total, used, used_extra, level_groups, marks });
        pages.release_held(std::time::Instant::now())
    };
    drop(done);
}

// Inside remap_if_unmapped (right after `if mapped { return true; }`):
    if let Some(i) = pages.held.iter().position(|h| h.res.as_raw() as usize == key) {
        let h = pages.held.swap_remove(i);
        if let Some(t) = pages.targets.get_mut(&key) {
            (t.used, t.used_extra, t.mapped) = (h.used, h.used_extra, true);
            if let (Some(l), Some((flags, mapped))) = (t.levels.as_mut(), h.level_groups) {
                for (g, flag) in l.groups.iter_mut().zip(flags) {
                    g.3 = flag;
                }
                LEVEL_STATS[2].fetch_add(mapped, std::sync::atomic::Ordering::Relaxed);
            }
        }
        drop(g);
        drop(h.res);
        return true;
    }
    if let Some(t) = pages.targets.get_mut(&key).filter(|t| t.levels.is_some()) {
        t.mapped = true;
        return true;
    }

Checked by merging b7f6b760 onto main (8b957bec) and running cargo check --workspace --tests
(x86_64-pc-windows-gnu, 0 errors, 0 new warnings); no GPU, Wine or Windows run.

AI use: Antigravity (Gemini 4 Carbon High) resolved the vram.rs conflicts against #2268/#2306
and compile-checked the tree; independently verified by Gemini 4 Hydrogen XHigh.

<!-- greyfinch-sync:ivall/xcl:comment:7197946780 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7197946780). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-26T16:40:16Z. --- Reviewed `b7f6b760` (`D116` settled winner) and compile-verified a rebase onto `main` (`8b957bec`, which merged `#2268` and `#2306`). One subtle semantic interaction with `#2306` (`t.levels` / `LEVEL_STATS`) to watch when resolving the conflict in `crates/xcl/src/hle/d3d12x/vram.rs`: - **In `remap_if_unmapped`, `#2270`'s `pages.held` check must run *before* `#2306`'s `t.levels.is_some()` early return, and `HeldUnmap` must save/restore `l.groups[..].3` and `LEVEL_STATS[2]`.** - If `if let Some(t) = pages.targets.get_mut(&key).filter(|t| t.levels.is_some()) { t.mapped = true; return true; }` runs before `pages.held`, reviving a superseded lazy-level texture while its `HeldUnmap` is still pending sets `t.mapped = true` **without** removing its entry from `pages.held` — so once the earlier marks complete, `before_execute` -> `release_held` NULL-unmaps the revived texture and frees its tiles out from under it. - Likewise, `unmap_superseded` needs `#2306`'s `LEVEL_STATS[2].fetch_sub(l.mapped_tiles(), ...)` and `l.groups[..].3 = false` reset, saving `(flags, mapped)` on `HeldUnmap` so cancelling a held unmap restores both `l.groups` and `LEVEL_STATS[2]`. - **In `unmap_superseded` and `before_execute`:** `main` now has `collect_device_queues(dev_key, None)` (which deduplicates queues and includes `sparse::queue()`) and `retire_heaps_and_sweep`, replacing the old `unmap_val` / `retire_signal` / `ready_to_drop` locals in `before_execute`; keeping `main`'s `tile_mappings_for` alongside `held_unmaps` resolves the test-helper conflict. ```rust // Compile-verified conflict resolution in crates/xcl/src/hle/d3d12x/vram.rs on 8b957bec: struct HeldUnmap { res: ID3D12Resource, total: u32, used: Vec<usize>, used_extra: Vec<(usize, usize)>, level_groups: Option<(Vec<bool>, u64)>, marks: Vec<(ID3D12Fence, u64)>, } pub(super) unsafe fn unmap_superseded(res: &ID3D12Resource) { let mut dev: Option<ID3D12Device> = None; if res.GetDevice(&mut dev).is_err() { return; } let Some(dev) = dev else { return }; let dev_key = dev.as_raw() as usize; let queues: Vec<ID3D12CommandQueue> = collect_device_queues(dev_key, None).into_iter().map(|(_, q)| q).collect(); let key = res.as_raw() as usize; let done = { let mut g = PAGES.lock().unwrap(); let Some(Some(pages)) = g.get_mut(&dev_key) else { return }; if !pages.targets.get(&key).is_some_and(|t| t.mapped) { return; } let Some(marks) = pages.mark(&dev, &queues) else { return }; let Some(t) = pages.targets.get_mut(&key) else { return }; let (total, used, used_extra) = (t.total, std::mem::take(&mut t.used), std::mem::take(&mut t.used_extra)); t.mapped = false; let level_groups = t.levels.as_mut().map(|l| { let mapped = l.mapped_tiles(); LEVEL_STATS[2].fetch_sub(mapped, std::sync::atomic::Ordering::Relaxed); let flags = l.groups.iter().map(|g| g.3).collect(); l.groups.iter_mut().for_each(|g| g.3 = false); (flags, mapped) }); pages.held.push(HeldUnmap { res: res.clone(), total, used, used_extra, level_groups, marks }); pages.release_held(std::time::Instant::now()) }; drop(done); } // Inside remap_if_unmapped (right after `if mapped { return true; }`): if let Some(i) = pages.held.iter().position(|h| h.res.as_raw() as usize == key) { let h = pages.held.swap_remove(i); if let Some(t) = pages.targets.get_mut(&key) { (t.used, t.used_extra, t.mapped) = (h.used, h.used_extra, true); if let (Some(l), Some((flags, mapped))) = (t.levels.as_mut(), h.level_groups) { for (g, flag) in l.groups.iter_mut().zip(flags) { g.3 = flag; } LEVEL_STATS[2].fetch_add(mapped, std::sync::atomic::Ordering::Relaxed); } } drop(g); drop(h.res); return true; } if let Some(t) = pages.targets.get_mut(&key).filter(|t| t.levels.is_some()) { t.mapped = true; return true; } ``` Checked by merging `b7f6b760` onto `main` (`8b957bec`) and running `cargo check --workspace --tests` (`x86_64-pc-windows-gnu`, 0 errors, 0 new warnings); no GPU, Wine or Windows run. AI use: Antigravity (Gemini 4 Carbon High) resolved the `vram.rs` conflicts against `#2268`/`#2306` and compile-checked the tree; independently verified by Gemini 4 Hydrogen XHigh.
Foniass commented 2026-12-01 07:42:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:42:58Z.


Triage (#1607) – head b7f6b76

Main commit c22c0ac ("D3D12.X: defer superseded texture unmaps") says it was adapted from this PR, with the queue-cycle finding from #594. Main's vram.rs now has HeldUnmap, completion marks on title and upload queues, CPU-polled release_held_unmaps, and handling for a held unmap in remap_if_unmapped. Main's version adds a retirement snapshot and the target / level-tile variants.
Recommendation: close (superseded by main commit c22c0ac).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304393721 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7304393721). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:42:58Z. --- **Triage (#1607)** – head b7f6b76 Main commit c22c0ac ("D3D12.X: defer superseded texture unmaps") says it was adapted from this PR, with the queue-cycle finding from #594. Main's `vram.rs` now has `HeldUnmap`, completion marks on title and upload queues, CPU-polled `release_held_unmaps`, and handling for a held unmap in `remap_if_unmapped`. Main's version adds a retirement snapshot and the target / level-tile variants. Recommendation: close (superseded by main commit c22c0ac). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:51:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:51:33Z.


Closing as superseded: this change is already on main (c22c0ac). main c22c0ac 'D3D12.X: defer superseded texture unmaps' is adapted from this PR: HeldUnmap, per-queue marks, CPU-polled release in vram.rs; PR 594 finding added

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, 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.

<!-- greyfinch-sync:ivall/xcl:comment:7311749828 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2270#issuecomment-7311749828). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:51:33Z. --- Closing as superseded: this change is already on `main` (c22c0ac). main c22c0ac 'D3D12.X: defer superseded texture unmaps' is adapted from this PR: HeldUnmap, per-queue marks, CPU-polled release in vram.rs; PR 594 finding added Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2260
No description provided.