Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175) #871

Closed
gustavsi wants to merge 3 commits from upstream-pr/877 into main
gustavsi commented 2026-11-24 07:12:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T07:12:42Z.


Lazily allocate 64 KiB sparse VRAM tiles for overflow PAGE_GRAPHICS_* heaps under Wine/vkd3d-proton so zero-filled or untouched pages do not exhaust local VRAM on 16 GiB GPUs. Part of #175, #1701, and #1773.

Stacked on #871 (cb3902a4); only the top commit (3b76b082) belongs here.

In #871, overflow PAGE_GRAPHICS_* heaps under Wine are routed into the sparse VRAM windows instead of the capped coherent userptr window. Eagerly committing 64 KiB VRAM tiles for the entire allocation up front consumes ~3.2 GiB of local VRAM for zero-filled or never-written pages before a retail title even leaves the menus (dropping local VRAM usage on a 16 GiB RX 9060 XT from ~11.6 GiB to ~8.1 GiB in menus, and independently verified on an 8 GiB RTX 4060 Laptop at 6.5 GiB peak VRAM over 300 s and on an RX 9070 at −2.36 GiB VRAM / −43% mapped tiles).

All lazy-allocation paths are gated behind util::under_wine() (with sparse::ensure_lazy_mapped short-circuiting when no lazy ranges exist); native Windows behavior is unchanged.

What is in it

  • crates/xcl/src/hle/d3d12x/sparse.rs: add alloc_lazy (commits CPU pages up front so host accesses never fault, while deferring 64 KiB VRAM tile allocation until first non-zero CPU write during dirty-page upload or explicit GPU write-target mapping via ensure_lazy_mapped), clean up lazy ranges on free, integrate with upstream parked-tile decommit / retired pool reuse / quarantine (#532 / #923 / #2345), and add unit tests covering lazy-range overlap, hole masks, non-zero page detection, and coalesced lazy tile allocation.
  • crates/xcl/src/hle/kernelx.rs: use sparse::alloc_lazy under util::under_wine() for overflow PAGE_GRAPHICS_* sparse allocations.
  • crates/xcl/src/hle/d3d12x/real.rs & crates/xcl/src/hle/d3d12x/list_x.rs: call sparse::ensure_lazy_mapped when registering placed buffers, buffer UAVs, and command-list GPU memory writes so GPU-written ranges have tiles mapped before execution.

Tested

  • Hardware / OS: AMD Radeon RX 9060 XT (16 GiB VRAM, RADV Mesa 26.2.7), Linux, GE-Proton11-14-x86_64, vkd3d-proton (-Db_ndebug=true), DXC 1.9.2609.5, cross-compiled x86_64-pc-windows-msvc (clang-cl + lld-link).
  • Restacked onto updated #871 (cb3902a4, on main f9a0cb80 + #867 021b2c33) at 3b76b082 (no conflicts, commit diff unchanged) and verified under GE-Proton11-14 (--test-threads=1 unless noted, XCL_DXC_DIR set):
    • hle::d3d12x::sparse::: 18 passed, 0 failed, 1 ignored
    • hle::d3d12x::vram::: 19 passed, 0 failed, 1 ignored
    • gpu::uma::: 12 passed, 0 failed, 0 ignored
    • hle::d3d12x::title_textures::: 21 passed, 0 failed, 0 ignored
    • hle::d3d12x::alloc_pool:: --test-threads=4: 4 passed, 0 failed, 0 ignored
  • Retail title 60 s smoke run via unmodified pwsh ./scripts/smoke.ps1 (with GE-Proton11-14 wrapper, XCL_PREPARE=0): 855 frames shown (PresentX 855, 41 13 0/2 s), exit: 0x0, 0 crashes, 0 device removals.

Regression run
Produced under Wine (GE-Proton11-14, AMD Radeon RX 9060 XT, XCL_PREPARE=0 XCL_NETWORK=0 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1, VKD3D_CONFIG=""). The PR run used unmodified pwsh ./scripts/smoke.ps1 via a thin Wine wrapper; main (e0d93c84) crashed before writing report.json, so its block was extracted from the same xcl.log (peak commit: 0 MB is what Wine reports in xcl.log).

main (e0d93c84):

xcl-smoke v1
commit: e0d93c84ad8253f6e17738d14741c1bab7061127
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x3
frames shown: 0 (did not reach end)
presents per 2 s (last 3): 0 0
device removals: 0
crashes: 2
peak commit: 0 MB

This PR (3b76b082, stacked on #871):

xcl-smoke v1
commit: 3b76b0823b903cf67f5decfd243bfecbe6a30121
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 855 (PresentX 855)
presents per 2 s (last 3): 41 13 0
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Native Windows (all new paths are gated behind util::under_wine()).
  • NVIDIA Linux GPUs locally (independently tested by @pickles976 on RTX 4060 Laptop).

AI use

  • T3 Code, Antigravity (Gemini 4 Neon) restacked cleanly onto updated #871 (cb3902a4, on main f9a0cb80), ran the Proton tests and 60 s smoke run at 3b76b082, and updated this description.
  • Claude Code (Claude Opus 5.5) ran the earlier da893f3a verification.
<!-- greyfinch-sync:ivall/xcl:issue:5467780435 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T07:12:42Z. --- Lazily allocate 64 KiB sparse VRAM tiles for overflow `PAGE_GRAPHICS_*` heaps under Wine/vkd3d-proton so zero-filled or untouched pages do not exhaust local VRAM on 16 GiB GPUs. Part of #175, #1701, and #1773. Stacked on #871 (`cb3902a4`); only the top commit (`3b76b082`) belongs here. In #871, overflow `PAGE_GRAPHICS_*` heaps under Wine are routed into the sparse VRAM windows instead of the capped coherent `userptr` window. Eagerly committing 64 KiB VRAM tiles for the entire allocation up front consumes ~3.2 GiB of local VRAM for zero-filled or never-written pages before a retail title even leaves the menus (dropping local VRAM usage on a 16 GiB RX 9060 XT from ~11.6 GiB to ~8.1 GiB in menus, and independently verified on an 8 GiB RTX 4060 Laptop at 6.5 GiB peak VRAM over 300 s and on an RX 9070 at −2.36 GiB VRAM / −43% mapped tiles). All lazy-allocation paths are gated behind `util::under_wine()` (with `sparse::ensure_lazy_mapped` short-circuiting when no lazy ranges exist); native Windows behavior is unchanged. **What is in it** - `crates/xcl/src/hle/d3d12x/sparse.rs`: add `alloc_lazy` (commits CPU pages up front so host accesses never fault, while deferring 64 KiB VRAM tile allocation until first non-zero CPU write during dirty-page upload or explicit GPU write-target mapping via `ensure_lazy_mapped`), clean up lazy ranges on `free`, integrate with upstream parked-tile decommit / retired pool reuse / quarantine (`#532` / `#923` / `#2345`), and add unit tests covering lazy-range overlap, hole masks, non-zero page detection, and coalesced lazy tile allocation. - `crates/xcl/src/hle/kernelx.rs`: use `sparse::alloc_lazy` under `util::under_wine()` for overflow `PAGE_GRAPHICS_*` sparse allocations. - `crates/xcl/src/hle/d3d12x/real.rs` & `crates/xcl/src/hle/d3d12x/list_x.rs`: call `sparse::ensure_lazy_mapped` when registering placed buffers, buffer UAVs, and command-list GPU memory writes so GPU-written ranges have tiles mapped before execution. **Tested** - Hardware / OS: AMD Radeon RX 9060 XT (16 GiB VRAM, RADV Mesa 26.2.7), Linux, `GE-Proton11-14-x86_64`, `vkd3d-proton` (`-Db_ndebug=true`), DXC 1.9.2609.5, cross-compiled `x86_64-pc-windows-msvc` (`clang-cl` + `lld-link`). - Restacked onto updated #871 (`cb3902a4`, on `main` `f9a0cb80` + #867 `021b2c33`) at `3b76b082` (no conflicts, commit diff unchanged) and verified under `GE-Proton11-14` (`--test-threads=1` unless noted, `XCL_DXC_DIR` set): - `hle::d3d12x::sparse::`: **18 passed, 0 failed, 1 ignored** - `hle::d3d12x::vram::`: **19 passed, 0 failed, 1 ignored** - `gpu::uma::`: **12 passed, 0 failed, 0 ignored** - `hle::d3d12x::title_textures::`: **21 passed, 0 failed, 0 ignored** - `hle::d3d12x::alloc_pool:: --test-threads=4`: **4 passed, 0 failed, 0 ignored** - Retail title 60 s smoke run via unmodified `pwsh ./scripts/smoke.ps1` (with `GE-Proton11-14` wrapper, `XCL_PREPARE=0`): **`855` frames shown (`PresentX 855`, `41 13 0`/2 s)**, `exit: 0x0`, `0` crashes, `0` device removals. **Regression run** Produced under Wine (`GE-Proton11-14`, AMD Radeon RX 9060 XT, `XCL_PREPARE=0 XCL_NETWORK=0 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1`, `VKD3D_CONFIG=""`). The PR run used unmodified `pwsh ./scripts/smoke.ps1` via a thin Wine wrapper; `main` (`e0d93c84`) crashed before writing `report.json`, so its block was extracted from the same `xcl.log` (`peak commit: 0 MB` is what Wine reports in `xcl.log`). `main` (`e0d93c84`): ``` xcl-smoke v1 commit: e0d93c84ad8253f6e17738d14741c1bab7061127 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x3 frames shown: 0 (did not reach end) presents per 2 s (last 3): 0 0 device removals: 0 crashes: 2 peak commit: 0 MB ``` This PR (`3b76b082`, stacked on #871): ``` xcl-smoke v1 commit: 3b76b0823b903cf67f5decfd243bfecbe6a30121 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 855 (PresentX 855) presents per 2 s (last 3): 41 13 0 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** - Native Windows (all new paths are gated behind `util::under_wine()`). - NVIDIA Linux GPUs locally (independently tested by @pickles976 on RTX 4060 Laptop). **AI use** - T3 Code, Antigravity (`Gemini 4 Neon`) restacked cleanly onto updated #871 (`cb3902a4`, on `main` `f9a0cb80`), ran the Proton tests and 60 s smoke run at `3b76b082`, and updated this description. - Claude Code (Claude Opus 5.5) ran the earlier `da893f3a` verification.
oeirughrepuiohg commented 2026-11-24 08:03:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oeirughrepuiohg on 2026-11-24T07:56:41Z.


Linux + NVIDIA data point for this stack (#867 → #871 → #877): the retail title crashes about 20 s after start with it, and does not without it.

Setup: RTX 4070 Ti 12 GB (620.70.06), Fedora 45 kernel 7.3, GE-Proton11-14 Wine with its default_pfx, vkd3d-proton cae8353e + scripts/linux/vkd3d-proton-xcl.patch (-Db_ndebug=true), VKD3D_CONFIG=ignore_shared_fence. Base: main 1ec4c98 + #793 #820 #759 #640 #889 #891 #826.

  • With #877 (incl. #871, #867): both runs end about 20 s in, during boot, right after err:vkd3d-proton:vkd3d_realloc: Out of memory., with an access violation reading 0xffffffffffffffff from outside any module. Once with XCL_COHERENT_MB=1024, once with it unset.
  • Same base without the stack: gets past that point and runs into the world load at 29-30 fps (same settings, same machine, back to back).

Not root-caused. The common factor with the stack is the overflow PAGE_GRAPHICS_* heap routing into the sparse VRAM windows, so this may be NVIDIA-specific (the PR text mentions amdgpu). Our vkd3d-proton still carries the vtable patch; I have not yet tried #867's path on stock vkd3d-proton.

AI-assisted (Claude Code). No game data attached.

<!-- greyfinch-sync:ivall/xcl:comment:7125546469 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7125546469). Originally posted by [oeirughrepuiohg](https://github.com/oeirughrepuiohg) on 2026-11-24T07:56:41Z. --- Linux + NVIDIA data point for this stack (#867 → #871 → #877): the retail title crashes about 20 s after start with it, and does not without it. **Setup:** RTX 4070 Ti 12 GB (620.70.06), Fedora 45 kernel 7.3, GE-Proton11-14 Wine with its `default_pfx`, vkd3d-proton `cae8353e` + `scripts/linux/vkd3d-proton-xcl.patch` (`-Db_ndebug=true`), `VKD3D_CONFIG=ignore_shared_fence`. Base: `main` `1ec4c98` + #793 #820 #759 #640 #889 #891 #826. - **With #877 (incl. #871, #867):** both runs end about 20 s in, during boot, right after `err:vkd3d-proton:vkd3d_realloc: Out of memory.`, with an access violation reading `0xffffffffffffffff` from outside any module. Once with `XCL_COHERENT_MB=1024`, once with it unset. - **Same base without the stack:** gets past that point and runs into the world load at 29-30 fps (same settings, same machine, back to back). Not root-caused. The common factor with the stack is the overflow `PAGE_GRAPHICS_*` heap routing into the sparse VRAM windows, so this may be NVIDIA-specific (the PR text mentions amdgpu). Our vkd3d-proton still carries the vtable patch; I have not yet tried #867's path on stock vkd3d-proton. *AI-assisted (Claude Code). No game data attached.*
fromthemoonx commented 2026-11-24 08:29:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T08:29:24Z.


Rerun on the new head 3b76b08 (the stack rebased onto main f9a0cb8; #871's commit has the conflict resolution in title_textures.rs, the other two are unchanged): still passes on native Windows / NVIDIA. cargo test --workspace --no-fail-fast -- --test-threads=4 (head = merged): 1470 passed, 0 failed, 47 ignored, 25 SKIPPED lines. hle::d3d12x::title_textures:: (21 tests) at --test-threads=8: 3 of 3. The e2e debug-layer messages match current main's: 3× error id 93, 1× error id 1046, 1× warning id 820, 2× warning id 926 (on main since #2977), 8× id 0. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads.


Rerun on the new head 2935240 (this commit and #871's unchanged, now on #867's d9e6ad5): still passes on native Windows / NVIDIA. cargo test --workspace --no-fail-fast -- --test-threads=4, merged onto main 8b957be (clean): 1452 passed, 0 failed, 47 ignored, 25 SKIPPED lines. The merged tree's e2e debug-layer messages are the same as main 8b957be's: 3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 at exit. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads.


Rerun on the new head b112fe7 (the whole stack rebased): still passes on native Windows / NVIDIA. cargo test --workspace --no-fail-fast -- --test-threads=4, now with no --skip: 978 passed, 0 failed, 45 ignored. Merged onto main 5796cc4 (no conflicts): 1060 passed, 0 failed, 45 ignored. lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages: 10 of 10. The e2e debug-layer messages on the merged tree are the same as main 5796cc4's (3× id 93, 1× id 1046, 1× warning id 820). Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / vkd3d-proton. The report below is for 2f81d51.


Native Windows / NVIDIA run, since Not tested lists native Windows.

Tested

  • Exact head 2f81d51f555e42d845b69746570470f6cd4cb7e8 (the whole stack: 593b2e2 #867, de6d71c #871, 2f81d51 this PR), clean worktree, not merged onto main
  • NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 715 passed, 0 failed, 41 ignored, 1 filtered out (lib 674 / 0 / 21). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with E_OUTOFMEMORY.
  • The new test passed: hle::d3d12x::sparse::tests::lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages
  • SKIPPED (no wave64 on this adapter): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • XCL_SAMPLE_* not set

Not tested

  • A retail title (no smoke.ps1 run here), and anything under Wine. Since the changes are behind under_wine(), this only shows the native Windows path is unchanged in the test suite.
  • Release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
<!-- greyfinch-sync:ivall/xcl:comment:7126196635 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7126196635). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-24T08:29:24Z. --- **Rerun on the new head `3b76b08` (the stack rebased onto `main` `f9a0cb8`; #871's commit has the conflict resolution in `title_textures.rs`, the other two are unchanged): still passes on native Windows / NVIDIA.** `cargo test --workspace --no-fail-fast -- --test-threads=4` (head = merged): 1470 passed, 0 failed, 47 ignored, 25 `SKIPPED` lines. `hle::d3d12x::title_textures::` (21 tests) at `--test-threads=8`: 3 of 3. The e2e debug-layer messages match current `main`'s: 3× error id 93, 1× error id 1046, 1× warning id 820, 2× warning id 926 (on `main` since #2977), 8× id 0. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads. --- **Rerun on the new head `2935240` (this commit and #871's unchanged, now on #867's `d9e6ad5`): still passes on native Windows / NVIDIA.** `cargo test --workspace --no-fail-fast -- --test-threads=4`, merged onto `main` `8b957be` (clean): 1452 passed, 0 failed, 47 ignored, 25 `SKIPPED` lines. The merged tree's e2e debug-layer messages are the same as `main` `8b957be`'s: 3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 at exit. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads. --- **Rerun on the new head `b112fe7` (the whole stack rebased): still passes on native Windows / NVIDIA.** `cargo test --workspace --no-fail-fast -- --test-threads=4`, now with no `--skip`: 978 passed, 0 failed, 45 ignored. Merged onto main `5796cc4` (no conflicts): 1060 passed, 0 failed, 45 ignored. `lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages`: 10 of 10. The e2e debug-layer messages on the merged tree are the same as main `5796cc4`'s (3× id 93, 1× id 1046, 1× warning id 820). Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / vkd3d-proton. The report below is for `2f81d51`. --- Native Windows / NVIDIA run, since **Not tested** lists native Windows. **Tested** - Exact head `2f81d51f555e42d845b69746570470f6cd4cb7e8` (the whole stack: `593b2e2` #867, `de6d71c` #871, `2f81d51` this PR), clean worktree, not merged onto `main` - NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused`: **715 passed, 0 failed, 41 ignored, 1 filtered out** (lib 674 / 0 / 21). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with `E_OUTOFMEMORY`. - The new test passed: `hle::d3d12x::sparse::tests::lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages` - SKIPPED (no wave64 on this adapter): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - `XCL_SAMPLE_*` not set **Not tested** - A retail title (no `smoke.ps1` run here), and anything under Wine. Since the changes are behind `under_wine()`, this only shows the native Windows path is unchanged in the test suite. - Release build. **AI use** - Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
SlopTart commented 2026-11-24 09:07:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:09:52Z.


Linux / AMD RDNA3 lane report, head 2f81d51 merged onto main 1ec4c98 (lane merge shas: 877 d905182, 871 8e45b96, 867 ad333d2 - see my note that all three of the #175-cluster PRs show the identical signature, whichever lands).

This PR hard-crashes the test harness on my Wine/RDNA3 lane. Not a test failure: the lib test binary dies with exit status 5, no panic message, no failure list. Everything after it (e2e, gpu_compute_e2e, pls_quota, predication_e2e targets) then fails to run, which is why the lane totals look collapsed (36 passed / 2 suites).

Crash point, pinned with sequential runs (--test-threads=1): it dies at or immediately after gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, the sparse-VRAM test. That test passes clean on plain main 1ec4c98 on this exact rig (3 separate lanes this batch, ... ok), and passed on this rig before. So the crash is attributable to this PR's change to the sparse/VRAM path, not the environment.

Reproduced 3/3: full-suite lane run, isolated lib rerun, and a --test-threads=1 run.

Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7125801475 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7125801475). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:09:52Z. --- Linux / AMD RDNA3 lane report, head `2f81d51` merged onto main `1ec4c98` (lane merge shas: 877 `d905182`, 871 `8e45b96`, 867 `ad333d2` - see my note that all three of the #175-cluster PRs show the identical signature, whichever lands). **This PR hard-crashes the test harness on my Wine/RDNA3 lane.** Not a test failure: the lib test binary dies with **exit status 5**, no panic message, no failure list. Everything after it (e2e, gpu_compute_e2e, pls_quota, predication_e2e targets) then fails to run, which is why the lane totals look collapsed (36 passed / 2 suites). Crash point, pinned with sequential runs (`--test-threads=1`): it dies at or immediately after `gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem`, the sparse-VRAM test. That test **passes clean on plain main `1ec4c98` on this exact rig** (3 separate lanes this batch, `... ok`), and passed on this rig before. So the crash is attributable to this PR's change to the sparse/VRAM path, not the environment. Reproduced 3/3: full-suite lane run, isolated lib rerun, and a `--test-threads=1` run. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Filip722 commented 2026-11-24 12:05:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T11:37:57Z.


I tested 2f81d51 together with #871 on an RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Bazzite 44 and Proton Experimental 11.0-20261112. The test stack was XCL 47efa2e plus #640, #793 and #820, vkd3d-proton v3.1 with the #257 compatibility changes and dxil-spirv 1dc543f. Offline Series X, XCL_COHERENT_MB=512, XCL_PAGE_BUDGET_MB=2048 and XCL_TRACE_MEM=5000.

The trace recorded four lazy fallback reservations totaling 4,532 MiB of virtual address space. XCL sampled 1,846 presents and 45,240 DirectStorage executions with zero storage failures before the loading run hit the same vkAllocateMemory access violation as the preceding run without #871/#877. The last sample showed 3,075 MB mapped in 3,136 MB of sparse pools, and 6,658 MB local plus 4,117 MB non-local video memory. This confirms the lazy path ran on NVIDIA. I did not make a separate eager-#871 run to measure the savings from #877 alone.

OpenAI Codex with GPT-6.2-Sol high assisted with the test and report.

<!-- greyfinch-sync:ivall/xcl:comment:7130347265 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7130347265). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-24T11:37:57Z. --- I tested `2f81d51` together with #871 on an RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Bazzite 44 and Proton Experimental `11.0-20261112`. The test stack was XCL `47efa2e` plus #640, #793 and #820, vkd3d-proton v3.1 with the #257 compatibility changes and dxil-spirv `1dc543f`. Offline Series X, `XCL_COHERENT_MB=512`, `XCL_PAGE_BUDGET_MB=2048` and `XCL_TRACE_MEM=5000`. The trace recorded four lazy fallback reservations totaling 4,532 MiB of virtual address space. XCL sampled 1,846 presents and 45,240 DirectStorage executions with zero storage failures before the loading run hit the same `vkAllocateMemory` access violation as the preceding run without #871/#877. The last sample showed 3,075 MB mapped in 3,136 MB of sparse pools, and 6,658 MB local plus 4,117 MB non-local video memory. This confirms the lazy path ran on NVIDIA. I did not make a separate eager-#871 run to measure the savings from #877 alone. OpenAI Codex with GPT-6.2-Sol high assisted with the test and report.
TobiasFornell commented 2026-11-24 13:03:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T12:26:59Z.


Adding an AMD data point to @oeirughrepuiohg's report: the vkd3d_realloc: Out of memory crash after rebasing is not NVIDIA-specific.

Tested: RX 9070 XT (RDNA4), Mesa RADV 26.3.1, CachyOS (kernel 7.3), Proton Experimental 11.0-20261112 Wine, vkd3d-proton v3.1 from scripts/linux/build-vkd3d-proton.sh (ndebug, dxil-spirv 53aac418), retail title 1.0.2.1, XCL_NETWORK=0.

  • This stack on its own base beaa245: 8 min at a steady 30 fps on the first screen, no crash. Sparse write-watch 57 ms for the first report, vs. ~105 s (78M dirty pages) on an older main without the stack – the big win.
  • Stack merged onto main 47efa2e: frames up to 28 fps, then 10–20 s later during loading err:vkd3d-proton:vkd3d_realloc: Out of memory. and 0xc0000005 reading 0xffffffffffffffff – same signature as above. Merge resolved with the UnadoptGuards moved into the alloc_pool::reset_list closures (on pc_alloc), plus upstream's decommit_range with this PR's lazy_changed bump.
    • Same with only this stack on main (no other PRs), 2/2 runs.
    • Same with XCL_ALLOC_SWAP=0 → not alloc_pool.
    • main alone does not crash within 120 s on the same setup.
  • Suspect: the interaction with upstream's own lazy pages (#556/#849, 9aec53d) and the parked-tile decommit (7f94c6f), both newer than this PR's base. A rebase by the author would settle it; happy to test it on RDNA4.

Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.

<!-- greyfinch-sync:ivall/xcl:comment:7131454755 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7131454755). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T12:26:59Z. --- Adding an **AMD** data point to @oeirughrepuiohg's report: the `vkd3d_realloc: Out of memory` crash after rebasing is **not NVIDIA-specific**. **Tested:** RX 9070 XT (RDNA4), Mesa RADV 26.3.1, CachyOS (kernel 7.3), Proton Experimental `11.0-20261112` Wine, vkd3d-proton v3.1 from `scripts/linux/build-vkd3d-proton.sh` (ndebug, dxil-spirv `53aac418`), retail title 1.0.2.1, `XCL_NETWORK=0`. - **This stack on its own base `beaa245`:** 8 min at a steady 30 fps on the first screen, no crash. Sparse write-watch 57 ms for the first report, vs. ~105 s (78M dirty pages) on an older `main` without the stack – the big win. - **Stack merged onto `main` `47efa2e`:** frames up to 28 fps, then 10–20 s later during loading `err:vkd3d-proton:vkd3d_realloc: Out of memory.` and `0xc0000005` reading `0xffffffffffffffff` – same signature as above. Merge resolved with the `UnadoptGuard`s moved into the `alloc_pool::reset_list` closures (on `pc_alloc`), plus upstream's `decommit_range` with this PR's `lazy_changed` bump. - Same with only this stack on `main` (no other PRs), 2/2 runs. - Same with `XCL_ALLOC_SWAP=0` → not `alloc_pool`. - `main` alone does not crash within 120 s on the same setup. - Suspect: the interaction with upstream's own lazy pages (#556/#849, `9aec53d`) and the parked-tile decommit (`7f94c6f`), both newer than this PR's base. A rebase by the author would settle it; happy to test it on RDNA4. *Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.*
TobiasFornell commented 2026-11-24 14:06:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T13:25:34Z.


Follow-up on the same RDNA4 setup, this time on the stack's own base (2f81d51 on beaa245, no rebase) with a real controller, to get past the first screens:

  • Menus and legal screens at 30 fps, the loading artwork renders correctly, ~5 GB of DirectStorage reads, then world loading at 1–10 fps (58k pipelines queued).
  • About 2.5 min in, during world loading: unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) – a memcpy from xcl.exe+0x17ecdd. That address is inside the 512 MB coherent window (UMA: … 512 MB coherent window at 0x400000000, 83/512 MB in use).
  • Just before it: video memory 15110 MB local, 528 MB non-local; sparse pools 3264 MB (3209 MB mapped) – VRAM nearly full on a 16 GB card – and DirectStorage … 16 failed in the last activity sample.
  • No vkd3d_realloc: Out of memory here; that only appears on the rebased stack.

So on its own base the stack gets much further on AMD than before, but a page of the coherent window is unreadable when the title copies from it under VRAM pressure. Happy to run a build with extra logging if useful.

Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.

<!-- greyfinch-sync:ivall/xcl:comment:7132811383 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7132811383). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T13:25:34Z. --- Follow-up on the same RDNA4 setup, this time **on the stack's own base** (`2f81d51` on `beaa245`, no rebase) with a real controller, to get past the first screens: - Menus and legal screens at 30 fps, the loading artwork renders correctly, ~5 GB of DirectStorage reads, then world loading at 1–10 fps (58k pipelines queued). - About 2.5 min in, during world loading: `unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000)` – a memcpy from `xcl.exe+0x17ecdd`. That address is inside the 512 MB coherent window (`UMA: … 512 MB coherent window at 0x400000000`, 83/512 MB in use). - Just before it: `video memory 15110 MB local, 528 MB non-local; sparse pools 3264 MB (3209 MB mapped)` – VRAM nearly full on a 16 GB card – and `DirectStorage … 16 failed` in the last activity sample. - No `vkd3d_realloc: Out of memory` here; that only appears on the rebased stack. So on its own base the stack gets much further on AMD than before, but a page of the coherent window is unreadable when the title copies from it under VRAM pressure. Happy to run a build with extra logging if useful. *Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.*
crastinator commented 2026-11-24 15:44:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T15:44:11Z.

Review: COMMENTED


Tested on RDNA2 under Proton with a patched vkd3d-proton: no new failures, and that includes the commits from #867 and #871 under it.

Tested (head 2dc68c2, merged onto main 930e8b4: no conflicts)

  • AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS)
  • Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (-Db_ndebug=true, dxil-spirv 53aac418 from #775), DXVK v3.1.1-209 dxgi, DXC 1.9.2609.5, libopus 1.5.2, XCL_REQUIRE_GPU=wave64,mesh (0 SKIPPED)
  • cross-built for x86_64-pc-windows-msvc (clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug
  • cargo test -p xcl --lib -- --test-threads=1 plus every integration test (--test '*' -- --test-threads=1), compared per test with the same runs on main 930e8b4. main here: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e, pls_quota #810, predication_e2e #1272). Separately, title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted} and vram::d32s8_targets… fail together in 2 of 5 main runs (the #718 family), so I do not count a pass of those as a fix either way.
  • PR: 746 passed, 8 failed, 41 ignored (main: 740 / 11 / 41, with the #718 flakes failing in that run). No test fails here that passes on main. hle::d3d12x::sparse::tests 14 passed and 1 ignored.

Not tested

  • Anything that needs game files: no XCL_SAMPLE_* was set, so the tests that read them (about 66) pass without running.
  • VRAM use with a retail title (no game here yet). NVIDIA.

AI use

  • Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
<!-- greyfinch-sync:ivall/xcl:review:6042506608 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#pullrequestreview-6042506608). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T15:44:11Z. **Review:** COMMENTED --- Tested on RDNA2 under Proton with a patched vkd3d-proton: no new failures, and that includes the commits from #867 and #871 under it. **Tested** (head `2dc68c2`, merged onto `main` `930e8b4`: no conflicts) - AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS) - Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (`-Db_ndebug=true`, dxil-spirv `53aac418` from #775), DXVK v3.1.1-209 `dxgi`, DXC 1.9.2609.5, libopus 1.5.2, `XCL_REQUIRE_GPU=wave64,mesh` (0 SKIPPED) - cross-built for `x86_64-pc-windows-msvc` (clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug - `cargo test -p xcl --lib -- --test-threads=1` plus every integration test (`--test '*' -- --test-threads=1`), compared per test with the same runs on `main` `930e8b4`. `main` here: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e, `pls_quota` #810, `predication_e2e` #1272). Separately, `title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted}` and `vram::d32s8_targets…` fail together in 2 of 5 `main` runs (the #718 family), so I do not count a pass of those as a fix either way. - PR: 746 passed, 8 failed, 41 ignored (`main`: 740 / 11 / 41, with the #718 flakes failing in that run). No test fails here that passes on `main`. `hle::d3d12x::sparse::tests` 14 passed and 1 ignored. **Not tested** - Anything that needs game files: no `XCL_SAMPLE_*` was set, so the tests that read them (about 66) pass without running. - VRAM use with a retail title (no game here yet). NVIDIA. **AI use** - Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
gustavsi commented 2026-11-24 16:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T15:14:14Z.


Rebased onto main (930e8b4) + updated #867 (46944c2) + #871 (45b805c) at 2dc68c2:

  • vkd3d_realloc: Out of memory / 0xffffffffffffffff / exit-5 crashes (@TobiasFornell, @oeirughrepuiohg, @SlopTart): root-caused and fixed in #867 (late_release was signalling un-adopted sparse::queue() with a FenceProxy from dev_create_fence, now using real::create_raw_fence), and rebased cleanly onto upstream's parked-tile decommit (#532) and retired-pool reuse (#923).
  • Coherent-window read fault under VRAM pressure (@TobiasFornell): added a crate::gpu::shader::readable guard before hashing coherent-window textures in #871.
  • Verified on RX 9060 XT / GE-Proton11-14 with late_release and alloc_pool enabled: sparse::tests 14/0/1, real:: 24/0, list_x:: 26/0, late_release:: 2/0, alloc_pool:: 3/0, gpu_sparse_vram_descriptors_buffers_and_xmem 1/0 (with DXC, 0 skipped), and a clean 60 s smoke run (exit 0x0, 1084 frames shown, 0 crashes, 0 device removals). Thanks @Filip722, @TobiasFornell, and @fromthemoonx for testing!
<!-- greyfinch-sync:ivall/xcl:comment:7135683597 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7135683597). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T15:14:14Z. --- Rebased onto `main` (`930e8b4`) + updated #867 (`46944c2`) + #871 (`45b805c`) at `2dc68c2`: - **`vkd3d_realloc: Out of memory` / `0xffffffffffffffff` / exit-5 crashes (@TobiasFornell, @oeirughrepuiohg, @SlopTart):** root-caused and fixed in #867 (`late_release` was signalling un-adopted `sparse::queue()` with a `FenceProxy` from `dev_create_fence`, now using `real::create_raw_fence`), and rebased cleanly onto upstream's parked-tile decommit (#532) and retired-pool reuse (#923). - **Coherent-window read fault under VRAM pressure (@TobiasFornell):** added a `crate::gpu::shader::readable` guard before hashing coherent-window textures in #871. - **Verified on RX 9060 XT / GE-Proton11-14** with `late_release` and `alloc_pool` enabled: `sparse::tests` 14/0/1, `real::` 24/0, `list_x::` 26/0, `late_release::` 2/0, `alloc_pool::` 3/0, `gpu_sparse_vram_descriptors_buffers_and_xmem` 1/0 (with DXC, 0 skipped), and a clean 60 s smoke run (`exit 0x0`, `1084` frames shown, `0` crashes, `0` device removals). Thanks @Filip722, @TobiasFornell, and @fromthemoonx for testing!
TobiasFornell commented 2026-11-24 16:07:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T15:39:55Z.


Retested 2dc68c2 (#877 rebased on 930e8b4, with #867 46944c2 + #871 45b805c) on RX 9070 XT (RDNA4) / RADV 26.3.1 / Proton Experimental's Wine + vkd3d-proton v3.1 from scripts/linux (ndebug), title 1.0.2.1:

  • ✅ The rebase OOM (vkd3d_realloc: Out of memory → 0xffffffffffffffff) is gone: boots, first game frame 3840x2160, account picker at 30 fps, no device removal.
  • ❌ The coherent-window read fault is still there, at the same point as in my earlier report: right after the account picker, on the first loading screen (~2 min in):
    unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000)
    on the stack: xcl.exe+0x5e9038, xcl.exe+0x33080, ucrtbase.dll+0x1720b (x3), xcl.exe+0x4e33c3
    
    Same address as before. The new gpu::shader::readable check in title_textures.rs only guards content_hash; this fault is a memcpy reading from the coherent window, so it looks like a second path (the copy after the hash, or another reader). I could only symbolize +0x33080 (eh::cpp_exception_logger), the real caller is not in the printed frames.

Happy to rerun with extra logging around coherent-window copies.

Testing and write-up assisted by Claude (AI); runs on my own hardware.

<!-- greyfinch-sync:ivall/xcl:comment:7136406384 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7136406384). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T15:39:55Z. --- Retested `2dc68c2` (#877 rebased on `930e8b4`, with #867 `46944c2` + #871 `45b805c`) on RX 9070 XT (RDNA4) / RADV 26.3.1 / Proton Experimental's Wine + vkd3d-proton v3.1 from `scripts/linux` (ndebug), title 1.0.2.1: - ✅ The rebase OOM (`vkd3d_realloc: Out of memory` → `0xffffffffffffffff`) is gone: boots, first game frame 3840x2160, account picker at 30 fps, no device removal. - ❌ The coherent-window read fault is still there, at the same point as in my earlier report: right after the account picker, on the first loading screen (~2 min in): ``` unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) on the stack: xcl.exe+0x5e9038, xcl.exe+0x33080, ucrtbase.dll+0x1720b (x3), xcl.exe+0x4e33c3 ``` Same address as before. The new `gpu::shader::readable` check in `title_textures.rs` only guards `content_hash`; this fault is a `memcpy` reading from the coherent window, so it looks like a second path (the copy after the hash, or another reader). I could only symbolize `+0x33080` (`eh::cpp_exception_logger`), the real caller is not in the printed frames. Happy to rerun with extra logging around coherent-window copies. _Testing and write-up assisted by Claude (AI); runs on my own hardware._
gustavsi commented 2026-11-24 17:06:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T16:45:16Z.


Rebased onto main (b7aa9f3) + updated #867 (6e94390) + #871 (b66a150) at fbf1440:

  • Coherent-window 0xc0000005 read fault at 0x400016000 (@TobiasFornell): found the exact ucrtbase.dll memcpy path in title_textures.rs (read_committed had a coherent-window fast path calling std::ptr::copy_nonoverlapping directly, and title_bytes borrowed a raw slice across subresources). Fixed in #871 (b66a150) by routing coherent-window reads in read_committed, title_bytes, and refresh through copy_committed_region (ReadProcessMemory) under Wine so an unreadable coherent page zeroes cleanly instead of faulting.
  • Verified on RX 9060 XT / GE-Proton11-14 / vkd3d-proton ec20719452e916b (-Db_ndebug=true): sparse::tests 15/0/1, real:: 29/0, list_x:: 26/0, late_release:: 2/0, alloc_pool:: 3/0, gpu::uma::tests 7/0, title_textures::tests 13/0, dstorage::tests 17/0, --exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int 2/0, and a clean 60 s smoke run (exit 0x0, 1166 frames shown / 1166 PresentX, 52 47 31 presents/2 s, 0 crashes, 0 removals). Thanks @TobiasFornell and @crastinator for testing!
<!-- greyfinch-sync:ivall/xcl:comment:7138154820 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/877#issuecomment-7138154820). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T16:45:16Z. --- Rebased onto `main` (`b7aa9f3`) + updated #867 (`6e94390`) + #871 (`b66a150`) at `fbf1440`: - **Coherent-window `0xc0000005` read fault at `0x400016000` (@TobiasFornell):** found the exact `ucrtbase.dll` `memcpy` path in `title_textures.rs` (`read_committed` had a coherent-window fast path calling `std::ptr::copy_nonoverlapping` directly, and `title_bytes` borrowed a raw slice across `subresources`). Fixed in #871 (`b66a150`) by routing coherent-window reads in `read_committed`, `title_bytes`, and `refresh` through `copy_committed_region` (`ReadProcessMemory`) under Wine so an unreadable coherent page zeroes cleanly instead of faulting. - **Verified on RX 9060 XT / `GE-Proton11-14` / `vkd3d-proton ec20719452e916b` (`-Db_ndebug=true`):** `sparse::tests` 15/0/1, `real::` 29/0, `list_x::` 26/0, `late_release::` 2/0, `alloc_pool::` 3/0, `gpu::uma::tests` 7/0, `title_textures::tests` 13/0, `dstorage::tests` 17/0, `--exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int` 2/0, and a clean 60 s smoke run (`exit 0x0`, `1166` frames shown / `1166` `PresentX`, `52 47 31` presents/2 s, `0` crashes, `0` removals). Thanks @TobiasFornell and @crastinator for testing!
TobiasFornell commented 2026-11-24 18:09:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T18:07:58Z.


Correction to my two earlier reports here (13:25 and 15:39 UTC): the read at address 0x400016000 crash is not a coherent-window fault. The stack points to the CopyFromSubresource argument mismatch from #662 (fix: #684). With #684 on top, the title now calls CopyFromSubresource without faulting (see below).

What the crash report shows (run on 20df0cf = 2dc68c2 + #1395 + cmt8's UnadoptGuard hint, Proton Experimental's own vkd3d-proton, RX 9070 XT; xcl's report.json, symbolized with llvm-symbolizer and the build's xcl.pdb):

0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000)  rsi=rdx=0x400016000 rbx=0x1000
xcl.exe+0xb11fd  -> core::slice::copy_from_slice in gpu::tiling::Chain::detile_level (tiling.rs:438)
xcl.exe+0xbf8a0  -> hle::xg::copy_from (xg.rs:711), XGTextureAddressComputer slot 9 = CopyFromSubresource
game+0x4daa2c8, game+0x50bb3f0 (title callers)
  • 0x400000000 is the UMA base, i.e. the start of sparse window 0 (MEM_RESERVE | MEM_WRITE_WATCH, not committed). The 512 MB coherent window starts at base + 3 × 4 GiB = 0x700000000 (uma.rs, for_runtime_with). I misread the startup line UMA: 3 sparse VRAM window(s) (12 GiB VA) + 512 MB coherent window at 0x400000000: the address there is the base of all four windows.
  • That build still had the 6-argument copy_from, so src gets what #662 calls a5. The faulting address fits src = UMA base + subresource offset. I did not log the raw arguments.
  • So the ReadProcessMemory routing added to #871 (b66a150) for my report is not needed for this crash. Sorry for the noise, @gustavsi.

Retest with #684: fbf1440 (this PR, with #867 6e94390 + #871 b66a150) + #1395 fd97d91 + #684 e56dbc3 + cmt8's UnadoptGuard hint, same setup, real controller:

  • Without counter: no 0x400016000 fault; the run ends at similar load progress (last DirectStorage milestone request #65536, #131072 not reached) with null write at game+0x23cf683 (stack game+0x4e4ba89, game+0x2215c35) at ~128 s, with fps dropping from 30 to 11 (~85 s). #662 already describes game+0x23cf683 as the title's stall-watchdog exit.
  • With a power-of-two call counter in copy_from: CopyFromSubresource was called at ~112 s (calls #1 and #2 logged, #4 not reached) with sane arguments in #684's 7-argument layout (row_pitch=0x800, slice_pitch=0x40000, then 0x100 / 0x2000, src in the title's memory, e.g. 0xb659a9000) and no fault. The run again ended in the game+0x23cf683 watchdog.
  • So #684 fixes this crash at the point where it previously hit on Linux/RDNA4; what stops the run now is the stall that #662 describes.

Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.

<!-- greyfinch-sync:ivall/xcl:comment:7140203650 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7140203650). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T18:07:58Z. --- Correction to my two earlier reports here (13:25 and 15:39 UTC): the `read at address 0x400016000` crash is **not** a coherent-window fault. The stack points to the `CopyFromSubresource` argument mismatch from #662 (fix: #684). With #684 on top, the title now calls `CopyFromSubresource` without faulting (see below). **What the crash report shows** (run on `20df0cf` = `2dc68c2` + #1395 + cmt8's `UnadoptGuard` hint, Proton Experimental's own vkd3d-proton, RX 9070 XT; xcl's `report.json`, symbolized with `llvm-symbolizer` and the build's `xcl.pdb`): ``` 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) rsi=rdx=0x400016000 rbx=0x1000 xcl.exe+0xb11fd -> core::slice::copy_from_slice in gpu::tiling::Chain::detile_level (tiling.rs:438) xcl.exe+0xbf8a0 -> hle::xg::copy_from (xg.rs:711), XGTextureAddressComputer slot 9 = CopyFromSubresource game+0x4daa2c8, game+0x50bb3f0 (title callers) ``` - `0x400000000` is the UMA base, i.e. the start of **sparse window 0** (`MEM_RESERVE | MEM_WRITE_WATCH`, not committed). The 512 MB coherent window starts at base + 3 × 4 GiB = `0x700000000` (`uma.rs`, `for_runtime_with`). I misread the startup line `UMA: 3 sparse VRAM window(s) (12 GiB VA) + 512 MB coherent window at 0x400000000`: the address there is the base of all four windows. - That build still had the 6-argument `copy_from`, so `src` gets what #662 calls `a5`. The faulting address fits `src` = UMA base + subresource offset. I did not log the raw arguments. - So the `ReadProcessMemory` routing added to #871 (`b66a150`) for my report is not needed for this crash. Sorry for the noise, @gustavsi. **Retest with #684:** `fbf1440` (this PR, with #867 `6e94390` + #871 `b66a150`) + #1395 `fd97d91` + #684 `e56dbc3` + cmt8's `UnadoptGuard` hint, same setup, real controller: - Without counter: no `0x400016000` fault; the run ends at similar load progress (last DirectStorage milestone request #65536, #131072 not reached) with `null write at game+0x23cf683` (stack `game+0x4e4ba89`, `game+0x2215c35`) at ~128 s, with fps dropping from 30 to 11 (~85 s). #662 already describes `game+0x23cf683` as the title's stall-watchdog exit. - With a power-of-two call counter in `copy_from`: `CopyFromSubresource` was called at ~112 s (calls #1 and #2 logged, #4 not reached) with sane arguments in #684's 7-argument layout (`row_pitch=0x800`, `slice_pitch=0x40000`, then `0x100` / `0x2000`, `src` in the title's memory, e.g. `0xb659a9000`) and no fault. The run again ended in the `game+0x23cf683` watchdog. - So #684 fixes this crash at the point where it previously hit on Linux/RDNA4; what stops the run now is the stall that #662 describes. *Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.*
Filip722 commented 2026-11-25 02:08:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-25T01:44:17Z.


On an 8 GiB RTX 5060 Laptop GPU under Proton, deferring tiles saved about 3.3 GiB of early sparse backing. I ported the lazy allocation from this PR (b112fe7) into the opt-in heap branch of #2009, on main bf9eebd + #1993. The comparison used the same integration with eager backing, matching Series X settings and separate copies of the same caches/prefix. This measures that port, not the complete #871/#877 stack.

With XCL_COHERENT_HEAPS=sparse:1024, the 1,172 and 2,199 MiB requests went to sparse windows in both runs. At the first sample with zero target pages, XCL reported 3,527 MiB mapped with eager backing and 128 MiB with lazy backing. At the next sample, with the first 64 MiB target pool, it reported 3,641 and 269 MiB mapped respectively.

Six focused tests executed and passed. A synthetic RTX test checked that a zero write left a tile unmapped, a nonzero CPU write survived GPU readback, an explicit destination received a tile and releasing the allocation removed its mappings. In the title, the eager run stopped at the free-VRAM guard at 30.1 s. The lazy run stopped on host memory pressure at 34.4 s, with 2,350 MiB of VRAM free at the last sample. Both windows were still black, before account input. No new gameplay milestone.

On the same lazy build I also tried a smaller coherent window. Two fresh copies of one Series X profile started with 2,048 or 1,536 MiB, the same 1,024 MiB sparse-routing threshold and a 6,144 MiB host available-memory cutoff. Both kept the 563 and 596 MiB allocations coherent and routed the 1,172 and 2,200 MiB allocations to sparse VRAM. At 512 draws both used 1,242 MiB of coherent memory. The larger window reached the host cutoff at 33.1 s, the smaller at 46.6 s. Both displayed black throughout the captures. This confirms the smaller window preserved placement in this part of startup. The runs reached different stages, so the duration does not measure a loading-speed improvement.

A separate Series S (Lockhart) startup with a 4,096 MiB guest budget helped distinguish another source of VRAM use. In the lazy integration above, shrinking the coherent window from 1,536 to 768 MiB saved 768 MiB of resident host memory. Both retained the 194 and 258 MiB coherent allocations and still mapped over 4 GiB of sparse GPU tiles before the first submit. With temporary mapper counters and the 768 MiB window, 66,592 new 64 KiB tile bindings (4,162 MiB) came from mapping physical pages to their destination. The explicit commit path added 20 MiB and the ordinary eager allocation path added 84.25 MiB. Private-home I/O and the lazy CPU and GPU paths had added zero at that sample. Three focused regressions passed on the instrumented build. The startup remained black and stopped at the 2 GiB VRAM reserve. This identifies the separate allocation path without changing its mapping semantics.

Bazzite 44, driver 615.78.08, Proton Experimental 11.0-20261112, local vkd3d-proton 3.1.0 based on 4522cc1a8b1347f. OpenAI Codex (GPT-6.2-Sol) prepared the local port, ran the tests and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7149897087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7149897087). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-25T01:44:17Z. --- On an 8 GiB RTX 5060 Laptop GPU under Proton, deferring tiles saved about **3.3 GiB of early sparse backing**. I ported the lazy allocation from this PR (`b112fe7`) into the opt-in heap branch of #2009, on main `bf9eebd` + #1993. The comparison used the same integration with eager backing, matching Series X settings and separate copies of the same caches/prefix. This measures that port, not the complete #871/#877 stack. With `XCL_COHERENT_HEAPS=sparse:1024`, the 1,172 and 2,199 MiB requests went to sparse windows in both runs. At the first sample with zero target pages, XCL reported 3,527 MiB mapped with eager backing and 128 MiB with lazy backing. At the next sample, with the first 64 MiB target pool, it reported 3,641 and 269 MiB mapped respectively. Six focused tests executed and passed. A synthetic RTX test checked that a zero write left a tile unmapped, a nonzero CPU write survived GPU readback, an explicit destination received a tile and releasing the allocation removed its mappings. In the title, the eager run stopped at the free-VRAM guard at 30.1 s. The lazy run stopped on host memory pressure at 34.4 s, with 2,350 MiB of VRAM free at the last sample. Both windows were still black, before account input. No new gameplay milestone. On the same lazy build I also tried a smaller coherent window. Two fresh copies of one Series X profile started with 2,048 or 1,536 MiB, the same 1,024 MiB sparse-routing threshold and a 6,144 MiB host available-memory cutoff. Both kept the 563 and 596 MiB allocations coherent and routed the 1,172 and 2,200 MiB allocations to sparse VRAM. At 512 draws both used 1,242 MiB of coherent memory. The larger window reached the host cutoff at 33.1 s, the smaller at 46.6 s. Both displayed black throughout the captures. This confirms the smaller window preserved placement in this part of startup. The runs reached different stages, so the duration does not measure a loading-speed improvement. A separate Series S (Lockhart) startup with a 4,096 MiB guest budget helped distinguish another source of VRAM use. In the lazy integration above, shrinking the coherent window from 1,536 to 768 MiB saved 768 MiB of resident host memory. Both retained the 194 and 258 MiB coherent allocations and still mapped over 4 GiB of sparse GPU tiles before the first submit. With temporary mapper counters and the 768 MiB window, 66,592 new 64 KiB tile bindings (4,162 MiB) came from mapping physical pages to their destination. The explicit commit path added 20 MiB and the ordinary eager allocation path added 84.25 MiB. Private-home I/O and the lazy CPU and GPU paths had added zero at that sample. Three focused regressions passed on the instrumented build. The startup remained black and stopped at the 2 GiB VRAM reserve. This identifies the separate allocation path without changing its mapping semantics. Bazzite 44, driver 615.78.08, Proton Experimental 11.0-20261112, local vkd3d-proton 3.1.0 based on `4522cc1a8b1347f`. OpenAI Codex (GPT-6.2-Sol) prepared the local port, ran the tests and wrote this report.
DavidM1911 commented 2026-11-25 10:10:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:52:34Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7158918756 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7158918756). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T09:52:34Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
gustavsi commented 2026-11-25 16:12:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T15:20:55Z.


Thanks @DavidM1911 and @Filip722 (great to see the ~3.3 GiB early sparse savings confirmed on 8 GiB NVIDIA too)!

Rebased onto main (06c9f55) + updated #871 (34cd677) at aec41e2 (preserving #1981's lock_state() in sparse::decommitted), verified sparse:: 17/0/1, vram:: 15/0/1, and a fresh 60 s smoke run (exit: 0x0, 958 frames, 0 crashes, 0 removals).

<!-- greyfinch-sync:ivall/xcl:comment:7166700284 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7166700284). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T15:20:55Z. --- Thanks @DavidM1911 and @Filip722 (great to see the ~3.3 GiB early sparse savings confirmed on 8 GiB NVIDIA too)! Rebased onto `main` (`06c9f55`) + updated #871 (`34cd677`) at `aec41e2` (preserving #1981's `lock_state()` in `sparse::decommitted`), verified `sparse::` 17/0/1, `vram::` 15/0/1, and a fresh 60 s smoke run (`exit: 0x0`, `958` frames, `0` crashes, `0` removals).
ClosetPie107 commented 2026-11-25 17:07:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T16:44:24Z.


Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head aec41e2cd15e0dd81ec4c28d82ff4a26929e892a merged locally onto main 55d64c2 (clean merge).

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv 694cc674 + two-hunk relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu (debug for tests, release for retail)

Unit / GPU tests (XCL_REQUIRE_GPU=wave64, VKD3D_CONFIG=ignore_shared_fence, --test-threads=1)

  • hle::d3d12x::sparse::tests: 16 passed, 0 failed, 1 ignored (peak VRAM 1,032 MiB)
  • gpu::uma::tests: 12 passed, 0 failed, 0 ignored (peak VRAM 1,018 MiB)
  • hle::d3d12x::title_textures::tests: 19 passed, 0 failed, 0 ignored (peak VRAM 1,258 MiB)
  • hle::d3d12x::vram::tests: 16 passed, 0 failed, 1 ignored (peak VRAM 1,624 MiB)

Retail title (1.0.2.1) A/B vs clean main 55d64c2
Same flags (XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0, MemoryMax=18G):

  • Clean main 55d64c2: no crash through 116 s (sparse 7447 MB, VRAM 10,434 MiB at 75 s / 11,879 MiB at 115 s, 1,800+ frames presented, 31,193 translated + 4,988 PC draws, 65,536 dispatches; stopped at 117 s by our 18 GiB cgroup cap with 7.5 GiB system RAM still free).
  • 55d64c2 + #877 (aec41e2):
    • sparse reported 11,413 MB (51,453 tiles mapped; 6,672 MB uploaded over 4,096 submits) and VRAM at 75 s was 11,499 MiB (+1.0 GiB vs clean 55d64c2).
    • Crashed at 76.844 s (after 1,500+ frames) with an access violation reading from an unmapped sparse window page (0x400016000):
      [   76.844][  468][ERROR] unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) rax=0xeab02810 rbx=0x1000 rcx=0xeab02810 rdx=0x400016000 rsi=0x400016000 rdi=0xeab02810 ...
      on the stack: xcl.exe+0x6919f0, d3d12core.dll+0xc45e0, xcl.exe+0x8f8528, game_scarlett_master.exe+0x1f6549, xcl.exe+0x69f1e5, game_scarlett_master.exe+0x4daa2c8
      
    • Note: 55d64c2 includes #495 (XMemMapPhysicalPagesScatter null-array unmap), which may be interacting with #877's lazy sparse pages.

Not tested

  • Native Windows, full workspace test suite, stock unpatched vkd3d-proton, or default HLSL route.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged the PR locally, ran the unit tests and retail A/B runs on this machine, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7168457597 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7168457597). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T16:44:24Z. --- Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head `aec41e2cd15e0dd81ec4c28d82ff4a26929e892a` merged locally onto `main` `55d64c2` (clean merge). **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `694cc674` + two-hunk relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` (debug for tests, release for retail) **Unit / GPU tests** (`XCL_REQUIRE_GPU=wave64`, `VKD3D_CONFIG=ignore_shared_fence`, `--test-threads=1`) - `hle::d3d12x::sparse::tests`: **16 passed, 0 failed, 1 ignored** (peak VRAM 1,032 MiB) - `gpu::uma::tests`: **12 passed, 0 failed, 0 ignored** (peak VRAM 1,018 MiB) - `hle::d3d12x::title_textures::tests`: **19 passed, 0 failed, 0 ignored** (peak VRAM 1,258 MiB) - `hle::d3d12x::vram::tests`: **16 passed, 0 failed, 1 ignored** (peak VRAM 1,624 MiB) **Retail title (1.0.2.1) A/B vs clean `main` `55d64c2`** Same flags (`XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`, `MemoryMax=18G`): - **Clean `main` `55d64c2`:** no crash through 116 s (`sparse 7447 MB`, VRAM `10,434 MiB` at 75 s / `11,879 MiB` at 115 s, `1,800+` frames presented, `31,193` translated + `4,988` PC draws, `65,536` dispatches; stopped at 117 s by our 18 GiB cgroup cap with 7.5 GiB system RAM still free). - **`55d64c2` + `#877` (`aec41e2`):** - `sparse` reported `11,413 MB` (`51,453` tiles mapped; `6,672 MB` uploaded over 4,096 submits) and VRAM at 75 s was `11,499 MiB` (+1.0 GiB vs clean `55d64c2`). - Crashed at **76.844 s** (after 1,500+ frames) with an access violation reading from an unmapped sparse window page (`0x400016000`): ```text [ 76.844][ 468][ERROR] unhandled exception 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) rax=0xeab02810 rbx=0x1000 rcx=0xeab02810 rdx=0x400016000 rsi=0x400016000 rdi=0xeab02810 ... on the stack: xcl.exe+0x6919f0, d3d12core.dll+0xc45e0, xcl.exe+0x8f8528, game_scarlett_master.exe+0x1f6549, xcl.exe+0x69f1e5, game_scarlett_master.exe+0x4daa2c8 ``` - Note: `55d64c2` includes `#495` (`XMemMapPhysicalPagesScatter` null-array unmap), which may be interacting with `#877`'s lazy sparse pages. **Not tested** - Native Windows, full workspace test suite, stock unpatched `vkd3d-proton`, or default HLSL route. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged the PR locally, ran the unit tests and retail A/B runs on this machine, and drafted this report.
pickles976 commented 2026-11-25 19:08:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T18:08:49Z.


Independent exact-head Wine/NVIDIA check for aec41e2cd15e0dd81ec4c28d82ff4a26929e892a:

  • RTX 4060 Laptop GPU (8 GiB), NVIDIA 590.48.1, 16 GiB RAM
  • XCL's current vkd3d-proton 3.2 build (2576c0b4adfae4a), with its release assertions intact
  • cargo test --target x86_64-pc-windows-msvc sparse::: 16 passed, 0 failed, 1 ignored
  • release build succeeded

The retail-title run cannot reach the lazy-allocation path on this exact stack. It exits with status 3 after 4.13 s at the first internally-created sparse heap:

xcl: D3D12.X: ID3D12Heap1 – 10 PC methods under the real vtable guard + 64 console stubs (Heap, PC vtable d3d12core.dll+0x4beb20)
Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 1077

This is the known adopted-object incompatibility addressed by #1395: sparse::take_tile() creates the heap through the adopted device, then UpdateTileMappings passes that adopted heap directly to vkd3d-proton. #867's temporary guards do not cover that queue call, and a guard around the heap's own methods cannot cover every vkd3d assertion site. An integration containing #1395 gets past this heap on the same machine, but that tree contains other PRs, so I am not presenting it as a controlled #877 performance result.

Conclusion: the sparse tests pass, but exact #877 still needs #1395 (or an equivalent native-vtable solution) before its lazy mapping can be exercised with assertion-enabled release vkd3d-proton on Linux/NVIDIA.

AI-assisted investigation and report; exact output and hardware results verified locally.

<!-- greyfinch-sync:ivall/xcl:comment:7170504083 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7170504083). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T18:08:49Z. --- Independent **exact-head Wine/NVIDIA check** for `aec41e2cd15e0dd81ec4c28d82ff4a26929e892a`: - RTX 4060 Laptop GPU (8 GiB), NVIDIA 590.48.1, 16 GiB RAM - XCL's current vkd3d-proton 3.2 build (`2576c0b4adfae4a`), with its release assertions intact - `cargo test --target x86_64-pc-windows-msvc sparse::`: **16 passed, 0 failed, 1 ignored** - release build succeeded The retail-title run cannot reach the lazy-allocation path on this exact stack. It exits with status 3 after 4.13 s at the first internally-created sparse heap: ```text xcl: D3D12.X: ID3D12Heap1 – 10 PC methods under the real vtable guard + 64 console stubs (Heap, PC vtable d3d12core.dll+0x4beb20) Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 1077 ``` This is the known adopted-object incompatibility addressed by #1395: `sparse::take_tile()` creates the heap through the adopted device, then `UpdateTileMappings` passes that adopted heap directly to vkd3d-proton. #867's temporary guards do not cover that queue call, and a guard around the heap's own methods cannot cover every vkd3d assertion site. An integration containing #1395 gets past this heap on the same machine, but that tree contains other PRs, so I am not presenting it as a controlled #877 performance result. Conclusion: the sparse tests pass, but exact #877 still needs #1395 (or an equivalent native-vtable solution) before its lazy mapping can be exercised with assertion-enabled release vkd3d-proton on Linux/NVIDIA. AI-assisted investigation and report; exact output and hardware results verified locally.
pickles976 commented 2026-11-25 19:08:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T18:14:55Z.


Update to my NVIDIA report above: #1395 was closed unmerged after I tested this exact head; its author explicitly permitted reuse of the code. Therefore exact #877 currently has no open upstream dependency that fixes this release-vkd3d heap assertion. It needs the equivalent native-vtable implementation to land elsewhere (or to be folded into this stack) before stock assertion-enabled vkd3d-proton can exercise the lazy path.

<!-- greyfinch-sync:ivall/xcl:comment:7170647268 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7170647268). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T18:14:55Z. --- Update to my NVIDIA report above: #1395 was closed unmerged after I tested this exact head; its author explicitly permitted reuse of the code. Therefore exact #877 currently has **no open upstream dependency that fixes this release-vkd3d heap assertion**. It needs the equivalent native-vtable implementation to land elsewhere (or to be folded into this stack) before stock assertion-enabled vkd3d-proton can exercise the lazy path.
pickles976 commented 2026-11-25 19:09:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T18:21:56Z.


Follow-up integration result on the RTX 4060 Laptop (not an exact-head comparison): I ported aec41e2 onto the existing local Wine integration, which includes closed #1395's permitted native-vtable implementation plus the other compatibility PRs needed by this title.

  • sparse tests: 17 passed, 0 failed, 1 ignored; GPU sparse test: 1 passed
  • release build succeeded
  • title run: 300 s, exit 0, 8,034 presents
  • after loading settled, every 300-frame report was 30.0 fps through frame 7,800
  • telemetry envelope: 6,565 MiB peak NVIDIA-reported VRAM, 7,276 MiB minimum host RAM available (16 GiB machine)
  • XCL's final report: 6,090 MiB local + 674 MiB non-local video memory; 884 MiB target pages; 4,096 MiB sparse pools / 3,974 MiB mapped
  • 4,207 MiB of CPU writes uploaded; 58,027 tiles mapped; 0 DirectStorage failures; no crash, OOM, or device removal

Settings: XCL_COHERENT_MB=512, XCL_PAGE_BUDGET_MB=2048, XCL_PSO_PRELOAD=0, XCL_NETWORK=0, XCL_DEFER_PRIVATE_HOME_TILES=1; stock assertion-enabled vkd3d-proton 3.2 (2576c0b4adfae4a), NVIDIA 590.48.1.

The input automation missed the window, so the title remained on its front-end/setup path; this is not a gameplay stability claim. It does establish that the lazy port plus the native-vtable prerequisite survives five minutes on 8 GiB NVIDIA at the 30 fps cap with substantial memory headroom. The prior exact-head assertion remains reproducible without the #1395-equivalent code.

AI-assisted port and report; tests, telemetry, and title output verified locally.

<!-- greyfinch-sync:ivall/xcl:comment:7170807481 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7170807481). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T18:21:56Z. --- Follow-up **integration** result on the RTX 4060 Laptop (not an exact-head comparison): I ported `aec41e2` onto the existing local Wine integration, which includes closed #1395's permitted native-vtable implementation plus the other compatibility PRs needed by this title. - sparse tests: **17 passed, 0 failed, 1 ignored**; GPU sparse test: **1 passed** - release build succeeded - title run: **300 s, exit 0, 8,034 presents** - after loading settled, every 300-frame report was **30.0 fps** through frame 7,800 - telemetry envelope: **6,565 MiB peak NVIDIA-reported VRAM**, **7,276 MiB minimum host RAM available** (16 GiB machine) - XCL's final report: 6,090 MiB local + 674 MiB non-local video memory; 884 MiB target pages; 4,096 MiB sparse pools / 3,974 MiB mapped - 4,207 MiB of CPU writes uploaded; 58,027 tiles mapped; 0 DirectStorage failures; no crash, OOM, or device removal Settings: `XCL_COHERENT_MB=512`, `XCL_PAGE_BUDGET_MB=2048`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`, `XCL_DEFER_PRIVATE_HOME_TILES=1`; stock assertion-enabled vkd3d-proton 3.2 (`2576c0b4adfae4a`), NVIDIA 590.48.1. The input automation missed the window, so the title remained on its front-end/setup path; this is **not a gameplay stability claim**. It does establish that the lazy port plus the native-vtable prerequisite survives five minutes on 8 GiB NVIDIA at the 30 fps cap with substantial memory headroom. The prior exact-head assertion remains reproducible without the #1395-equivalent code. AI-assisted port and report; tests, telemetry, and title output verified locally.
gustavsi commented 2026-11-25 20:08:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T19:43:40Z.


Thanks @pickles976 for the detailed 8 GiB RTX 4060 Laptop verification (300 s, 30.0 fps, 6,565 MiB peak VRAM)!

Rebased onto main (2898511, including #2345) + updated #871 (cfcdca7) at 2da0233. I also opened #2477 stacked on #867 carrying closed #1395's permitted in-place vtable patching so stock assertion-enabled vkd3d-proton has an active upstream path. Verified Proton tests (sparse:: 20/0/1, vram:: 19/0/1) and a fresh 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 1021 frames, 0 crashes, 0 removals).

<!-- greyfinch-sync:ivall/xcl:comment:7172687051 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7172687051). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T19:43:40Z. --- Thanks @pickles976 for the detailed 8 GiB RTX 4060 Laptop verification (300 s, 30.0 fps, 6,565 MiB peak VRAM)! Rebased onto `main` (`2898511`, including #2345) + updated #871 (`cfcdca7`) at `2da0233`. I also opened #2477 stacked on #867 carrying closed #1395's permitted in-place vtable patching so stock assertion-enabled vkd3d-proton has an active upstream path. Verified Proton tests (`sparse::` 20/0/1, `vram::` 19/0/1) and a fresh 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `1021` frames, `0` crashes, `0` removals).
gustavsi commented 2026-11-25 21:05:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T20:32:38Z.


Rebased onto main (e0d93c84) + updated #867 (f98da36d, including the UnadoptGuard/orig_fn race fix) + #871 (153730d7) at 08abaa07, verified Proton tests (sparse:: 20/0/1, vram:: 19/0/1, list_x:: 40/0) and a fresh 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 1154 frames, 50 50 24/2 s, 0 crashes, 0 removals).

<!-- greyfinch-sync:ivall/xcl:comment:7173828623 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7173828623). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T20:32:38Z. --- Rebased onto `main` (`e0d93c84`) + updated #867 (`f98da36d`, including the `UnadoptGuard`/`orig_fn` race fix) + #871 (`153730d7`) at `08abaa07`, verified Proton tests (`sparse::` 20/0/1, `vram::` 19/0/1, `list_x::` 40/0) and a fresh 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `1154` frames, `50 50 24`/2 s, `0` crashes, `0` removals).
ClosetPie107 commented 2026-11-25 22:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T21:14:33Z.


Follow-up AMD RDNA4 / Linux (RADV, native wave64) test report for updated head 08abaa0715179a33ed3b40c3a75909550e614365 (merged cleanly onto main 6d12f58), plus bisect against #871 (153730d7).

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu (debug for tests, release for retail)

Unit / GPU tests (XCL_REQUIRE_GPU=wave64, XCL_DXC_DIR, VKD3D_CONFIG=ignore_shared_fence, --test-threads=1 --nocapture)

  • hle::d3d12x::sparse::: 18 passed, 0 failed, 1 ignored (0 skipped)
  • gpu::uma::: 12 passed, 0 failed, 0 ignored (0 skipped)
  • hle::d3d12x::title_textures::: 19 passed, 0 failed, 0 ignored (0 skipped)
  • hle::d3d12x::vram::: 19 passed, 0 failed, 1 ignored (0 skipped)

Retail title bisect (#871 alone vs #871 + #877, pressing A past menus)
Same flags (XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0):

Build (on main 6d12f58) VRAM at 75 s Tiles mapped (4,096 submits) 0x400016000 crash
#871 alone (153730d7) 13,935 MiB 91,136 (9,152 MB uploaded) 76.600 s
#871 + #877 (08abaa07) 11,575 MiB (−2.36 GiB) 51,871 (6,704 MB uploaded) 77.356 s
  • Clarification on our earlier report: bisecting #871 alone shows that the deterministic 0xc0000005 at ~77 s reading 0x400016000 (core::ptr::copy_nonoverlapping ← tiling::Chain::detile_level (tiling.rs:464) ← xg::copy_from (xg.rs:712)) is in #871, not #877 (reported on #871).
  • On top of #871, #877 cuts VRAM at 75 s by −2.36 GiB and mapped tiles by −43% (91,136 → 51,871).

Not tested

  • Full workspace test suite, native Windows, or #877 past 77 s once #871's 0x400016000 crash is fixed.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged the PRs onto main, ran the tests and retail bisect under Proton on this machine, symbolized the crash stack, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7174805192 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7174805192). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T21:14:33Z. --- Follow-up AMD RDNA4 / Linux (RADV, native wave64) test report for updated head `08abaa0715179a33ed3b40c3a75909550e614365` (merged cleanly onto `main` `6d12f58`), plus bisect against `#871` (`153730d7`). **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` (debug for tests, release for retail) **Unit / GPU tests** (`XCL_REQUIRE_GPU=wave64`, `XCL_DXC_DIR`, `VKD3D_CONFIG=ignore_shared_fence`, `--test-threads=1 --nocapture`) - `hle::d3d12x::sparse::`: **18 passed, 0 failed, 1 ignored** (0 skipped) - `gpu::uma::`: **12 passed, 0 failed, 0 ignored** (0 skipped) - `hle::d3d12x::title_textures::`: **19 passed, 0 failed, 0 ignored** (0 skipped) - `hle::d3d12x::vram::`: **19 passed, 0 failed, 1 ignored** (0 skipped) **Retail title bisect (`#871` alone vs `#871` + `#877`, pressing `A` past menus)** Same flags (`XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`): | Build (on `main` `6d12f58`) | VRAM at 75 s | Tiles mapped (4,096 submits) | `0x400016000` crash | |---|---:|---:|---| | `#871` alone (`153730d7`) | `13,935 MiB` | `91,136` (`9,152 MB` uploaded) | `76.600 s` | | `#871` + `#877` (`08abaa07`) | **`11,575 MiB` (−2.36 GiB)** | **`51,871`** (`6,704 MB` uploaded) | `77.356 s` | - **Clarification on our earlier report:** bisecting `#871` alone shows that the deterministic `0xc0000005` at `~77 s` reading `0x400016000` (`core::ptr::copy_nonoverlapping` ← `tiling::Chain::detile_level (tiling.rs:464)` ← `xg::copy_from (xg.rs:712)`) is in **`#871`**, not `#877` (reported on `#871`). - On top of `#871`, `#877` cuts VRAM at 75 s by **−2.36 GiB** and mapped tiles by **−43%** (`91,136` → `51,871`). **Not tested** - Full workspace test suite, native Windows, or `#877` past 77 s once `#871`'s `0x400016000` crash is fixed. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged the PRs onto `main`, ran the tests and retail bisect under Proton on this machine, symbolized the crash stack, and drafted this report.
gustavsi commented 2026-11-26 03:06:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T02:12:52Z.


Thanks @ClosetPie107 for the RX 9070 bisect confirming −2.36 GiB VRAM at 75 s and −43% mapped tiles (91,136 → 51,871) on top of #871!

Rebased onto main (08db8020) + updated #867 (e57cb659) + updated #871 (8f08d7cd) at a553a224:

  • Verified under GE-Proton11-14 (RX 9060 XT): sparse:: 18/0/1, vram:: 19/0/1, title_textures:: 19/0, real:: 62/0, plus a fresh 60 s pwsh ./scripts/smoke.ps1 run (959 frames / 42 42 42 per 2 s, exit: 0x0, 0 crashes, 0 device removals; block updated in PR description).

AI use: Antigravity (Gemini 4 Neon) rebased onto main + updated #871, ran the Proton tests and smoke run, and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7180574507 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7180574507). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T02:12:52Z. --- Thanks @ClosetPie107 for the RX 9070 bisect confirming −2.36 GiB VRAM at 75 s and −43% mapped tiles (`91,136` → `51,871`) on top of #871! Rebased onto `main` (`08db8020`) + updated #867 (`e57cb659`) + updated #871 (`8f08d7cd`) at `a553a224`: - Verified under `GE-Proton11-14` (RX 9060 XT): `sparse::` **18/0/1**, `vram::` **19/0/1**, `title_textures::` **19/0**, `real::` **62/0**, plus a fresh 60 s `pwsh ./scripts/smoke.ps1` run (**959** frames / `42 42 42` per 2 s, `exit: 0x0`, `0` crashes, `0` device removals; block updated in PR description). **AI use:** Antigravity (Gemini 4 Neon) rebased onto `main` + updated #871, ran the Proton tests and smoke run, and drafted this comment.
DavidM1911 commented 2026-11-26 04:07:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:11:19Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7181474779 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7181474779). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:11:19Z. --- 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
ClosetPie107 commented 2026-11-26 06:16:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T06:16:12Z.


Update for head 3b76b082 (rebased onto main f9a0cb80; earlier results for 29352403 below). git range-diff: this PR's commit and the #867 commit are unchanged; the #871 commit changed only in title_textures.rs (see #871).

Same machine and setup as below (RX 9070 16 GB / Mesa 26.3.1 RADV / Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 without the allocator / command-list lpVtbl checks, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu debug build). The head itself, with main f9a0cb80 the same session as the baseline.

Tests (XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::sparse::: 18 passed, 0 failed, 1 ignored (main: 17 passed, 0 failed, 1 ignored)
  • hle::d3d12x::real::: 67 passed, 0 failed (main: 63); gpu::uma:: 12 passed, 0 failed; adapter 5 passed, 0 failed (main: 4); hle::d3d12x::title_textures:: 21 passed, 0 failed
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (the first loses the RADV device here, the other two run out of memory under Wine): lib 1330 passed, 8 failed, 27 ignored; main lib the same session: 1323 passed, 9 failed, 27 ignored (--test-threads=1 and two --test-threads=4 runs). All failures are among main's. The other binaries fail the same 3 tests as on main (e2e, pls_quota, predication_e2e). d3d12_resource_and_sync ended the process, as it does on main here.

Not tested on this head: a retail run (the runs below are for 29352403, with #684 and #1993 added); native Windows, NVIDIA / Intel.

AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update.


Update for head 29352403 (earlier results for a553a224 below)

Same RX 9070 / RADV / Proton Experimental machine, patched vkd3d-proton (master ec207194 without the allocator / command-list lpVtbl checks), Rust 1.96.0, x86_64-pc-windows-gnu. Head merged onto main 8b957bec with #2849 (4e931734), test commit 22716591. #871 conflicts with #2849 in title_bytes; the resolution is on #871.

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::sparse::: 18 passed, 0 failed, 1 ignored (main: 17 passed, 0 failed, 1 ignored)
  • gpu::uma:: 12 passed, 0 failed; gpu::adapter:: 4 passed, 0 failed; hle::d3d12x::title_textures:: 19 passed, 0 failed
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1438 passed, 11 failed, 47 ignored, 12 SKIPPED. main the same run: 1434 passed, 12 failed, 47 ignored, 12 SKIPPED. The 11 failures are all among main's 12 (main also failed sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight). tests/d3d12_resource_and_sync.rs aborted here as well; it crashed on main too (3 of 3 focused reruns).

Retail title, 300 s (release; every run starts from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_SPLIT_MIDLIST_WAIT=0 XCL_COHERENT_MB=1024 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • Without #684: 2 of 2 runs crash at ~105 s on #477 in xg::copy_from, as with #871 alone (details there).
  • With #684 (e56dbc3f) and #1993 (0a755f0c) added to each tree:
runs exit crashes / device removed presents VRAM at ~90 s card full (16.2 GiB) at tiles at 4,096 submits
base 7b8df0d8 2 0, 0 0 / 0 2152, 2083 9897, 9895 MiB 220 s, 255 s 28,174, 27,782
+ #871 93678b46 2 0, 0 0 / 0 1765, 1799 13377, 13357 MiB 156 s, 310 s 91,382, 89,063
+ #871 + this PR cd5508fe 2 0, 0 0 / 0 1832, 1881 10976, 10934 MiB 250 s, 230 s 52,620, 52,221
  • On top of #871 this PR takes back about 2.4 GiB at 90 s and about 40 % of the mapped tiles, and the card fills at about the same time as on the base. It stays about 1 GiB above the base early on. Presents are 10–15 % below the base (all before the stall after world start that every tree has, ~100 s). No sparse fence warnings in either run.

Not tested

  • Native Windows, NVIDIA/Intel, GPUs with less than 16 GiB
  • This PR without #2849

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this update.

Re-tested rebased head a553a224 on latest main (b49be183) together with #684 (e56dbc3f, fixing the #477 xg::copy_from crash) and #1993 (0a755f0c, fixing the sparse copy-back fence cycle) on AMD RDNA4 / Linux (Proton Experimental):

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu

Targeted unit tests (debug, --test-threads=1):

  • xcl.exe hle::d3d12x::sparse:: -- --test-threads=1: 26 passed, 0 failed, 1 ignored (early_commit_timing), including lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages (8 of #1993's WARP-backed copy-back tests skipped with no WARP device under Wine).

300 s retail title run (1.0.2.1, pressing A past menus, release)
Flags: XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0.

  • Completed the full 300 s (exit=0), 0 crashes, 0 device removals, 0 sparse: the queue has not reached fence value warnings, cleanly composing with #1993.
  • VRAM at 75 s: 11,302 MiB vs 13,677 MiB on the matching #871 + #684 + #1993 run (−2.32 GiB).
  • Mapped sparse tiles: 50,177 at 4,096 submits (vs 91,136 on #871), and only 75,566 tiles even after 8,192 submits deep into the world load.
  • World-load progression: 105,215 translated draws (344 skipped), 556,261 dispatches (119 skipped), 24,707 chained split-compute dispatches (246 split programs / 2,587 pieces, 406 MiB scratch), 1,825 PresentX frames (1.4 fps sustained past 1,500 frames), 66,073 Opus packets (0 errors).
  • Peak memory at 300 s: 16,297 MiB VRAM (late in the world load as render targets and split scratch grew; #2357 was not included), 15,808 MiB RSS (min_avail=8,483 MiB, xcl_swap=0).

Not tested

  • Native Windows or full workspace test suite on a553a224.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged the stack onto main, ran the Proton unit tests and 300 s retail run on this machine, and drafted this follow-up.
<!-- greyfinch-sync:ivall/xcl:comment:7184261817 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7184261817). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T06:16:12Z. --- **Update for head `3b76b082`** (rebased onto `main` `f9a0cb80`; earlier results for `29352403` below). `git range-diff`: this PR's commit and the #867 commit are unchanged; the #871 commit changed only in `title_textures.rs` (see #871). Same machine and setup as below (RX 9070 16 GB / Mesa 26.3.1 RADV / Proton Experimental `experimental-11.0-20261112`, vkd3d-proton master `ec207194` without the allocator / command-list `lpVtbl` checks, DXC 1.9.2609.5, Rust 1.96.0, `x86_64-pc-windows-gnu` debug build). The head itself, with `main` `f9a0cb80` the same session as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::sparse::`: **18 passed, 0 failed**, 1 ignored (`main`: 17 passed, 0 failed, 1 ignored) - `hle::d3d12x::real::`: **67 passed, 0 failed** (`main`: 63); `gpu::uma::` 12 passed, 0 failed; `adapter` 5 passed, 0 failed (`main`: 4); `hle::d3d12x::title_textures::` 21 passed, 0 failed - `cargo test --workspace --no-fail-fast -- --test-threads=4` with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (the first loses the RADV device here, the other two run out of memory under Wine): lib 1330 passed, 8 failed, 27 ignored; `main` lib the same session: 1323 passed, 9 failed, 27 ignored (`--test-threads=1` and two `--test-threads=4` runs). All failures are among `main`'s. The other binaries fail the same 3 tests as on `main` (`e2e`, `pls_quota`, `predication_e2e`). `d3d12_resource_and_sync` ended the process, as it does on `main` here. **Not tested** on this head: a retail run (the runs below are for `29352403`, with #684 and #1993 added); native Windows, NVIDIA / Intel. AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update. --- **Update for head `29352403`** (earlier results for `a553a224` below) Same RX 9070 / RADV / Proton Experimental machine, patched `vkd3d-proton` (master `ec207194` without the allocator / command-list `lpVtbl` checks), Rust 1.96.0, `x86_64-pc-windows-gnu`. Head merged onto `main` `8b957bec` with #2849 (`4e931734`), test commit `22716591`. #871 conflicts with #2849 in `title_bytes`; the resolution is on #871. **Tests** (debug, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::sparse::`: 18 passed, 0 failed, 1 ignored (`main`: 17 passed, 0 failed, 1 ignored) - `gpu::uma::` 12 passed, 0 failed; `gpu::adapter::` 4 passed, 0 failed; `hle::d3d12x::title_textures::` 19 passed, 0 failed - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1438 passed, 11 failed, 47 ignored, 12 SKIPPED. `main` the same run: 1434 passed, 12 failed, 47 ignored, 12 SKIPPED. The 11 failures are all among `main`'s 12 (`main` also failed `sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight`). `tests/d3d12_resource_and_sync.rs` aborted here as well; it crashed on `main` too (3 of 3 focused reruns). **Retail title, 300 s** (release; every run starts from a copy of the same warm-cache snapshot; `XCL_DIRECT_DXIL=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_SPLIT_MIDLIST_WAIT=0 XCL_COHERENT_MB=1024 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 VKD3D_CONFIG=ignore_shared_fence`, `A` pressed every 10 s) - Without #684: 2 of 2 runs crash at ~105 s on #477 in `xg::copy_from`, as with #871 alone (details there). - With #684 (`e56dbc3f`) and #1993 (`0a755f0c`) added to each tree: | | runs | exit | crashes / device removed | presents | VRAM at ~90 s | card full (16.2 GiB) at | tiles at 4,096 submits | |---|---|---|---|---|---|---|---| | base `7b8df0d8` | 2 | 0, 0 | 0 / 0 | 2152, 2083 | 9897, 9895 MiB | 220 s, 255 s | 28,174, 27,782 | | + #871 `93678b46` | 2 | 0, 0 | 0 / 0 | 1765, 1799 | 13377, 13357 MiB | 156 s, 310 s | 91,382, 89,063 | | + #871 + this PR `cd5508fe` | 2 | 0, 0 | 0 / 0 | 1832, 1881 | 10976, 10934 MiB | 250 s, 230 s | 52,620, 52,221 | - On top of #871 this PR **takes back about 2.4 GiB at 90 s and about 40 % of the mapped tiles**, and the card fills at about the same time as on the base. It stays about 1 GiB above the base early on. Presents are 10–15 % below the base (all before the stall after world start that every tree has, ~100 s). No sparse fence warnings in either run. **Not tested** - Native Windows, NVIDIA/Intel, GPUs with less than 16 GiB - This PR without #2849 **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this update. --- Re-tested rebased head `a553a224` on latest `main` (`b49be183`) together with #684 (`e56dbc3f`, fixing the #477 `xg::copy_from` crash) and #1993 (`0a755f0c`, fixing the sparse copy-back fence cycle) on AMD RDNA4 / Linux (Proton Experimental): **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` **Targeted unit tests** (debug, `--test-threads=1`): - `xcl.exe hle::d3d12x::sparse:: -- --test-threads=1`: **26 passed, 0 failed, 1 ignored** (`early_commit_timing`), including `lazy_range_helpers_track_tile_overlap_holes_and_nonzero_pages` (8 of #1993's WARP-backed copy-back tests skipped with `no WARP device` under Wine). **300 s retail title run (1.0.2.1, pressing `A` past menus, release)** Flags: `XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`. - Completed the full **300 s (`exit=0`)**, **0 crashes**, **0 device removals**, **0 `sparse: the queue has not reached fence value` warnings**, cleanly composing with #1993. - **VRAM at `75 s`:** `11,302 MiB` vs `13,677 MiB` on the matching #871 + #684 + #1993 run (**−2.32 GiB**). - **Mapped sparse tiles:** `50,177` at 4,096 submits (vs `91,136` on #871), and only `75,566` tiles even after 8,192 submits deep into the world load. - **World-load progression:** `105,215` translated draws (`344` skipped), `556,261` dispatches (`119` skipped), `24,707` chained split-compute dispatches (`246` split programs / `2,587` pieces, `406 MiB` scratch), `1,825` `PresentX` frames (`1.4 fps` sustained past 1,500 frames), `66,073` Opus packets (0 errors). - **Peak memory at 300 s:** `16,297 MiB` VRAM (late in the world load as render targets and split scratch grew; #2357 was not included), `15,808 MiB` RSS (`min_avail=8,483 MiB`, `xcl_swap=0`). **Not tested** - Native Windows or full workspace test suite on `a553a224`. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged the stack onto `main`, ran the Proton unit tests and 300 s retail run on this machine, and drafted this follow-up.
gustavsi commented 2026-11-26 16:06:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T15:15:29Z.


Thanks @ClosetPie107 and @pickles976 for the runs.

  • 0xc0000005 reading 0x400016000 in Chain::detile_level under xg::copy_from (@ClosetPie107): as @St5sz2Jk worked out on #871, that is #477: XCL read CopyFromSubresource's arguments with the wrong ABI and copied from the wrong address. #684 fixes it; @TobiasFornell's retest above shows the title calling CopyFromSubresource with #684's layout and no fault. It shows up with this stack because the title gets far enough to call it, not because of the lazy mapping.
  • Assertion-enabled vkd3d-proton (@pickles976): right, this stack alone still trips iface->lpVtbl == &d3d12_heap_vtbl on the first adopted heap. #2477 (stacked on #867) writes XCL's slots into vkd3d-proton's own tables for the assert-checked classes, heaps included; #1395 is the other approach. Neither is part of this PR, so on a release vkd3d-proton with assertions on, #877 needs one of them. I have not run #877 together with #2477 on an assertion-enabled build myself.

AI use: Claude Code (Claude Opus 5.5) drafted this reply; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7196009882 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7196009882). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T15:15:29Z. --- Thanks @ClosetPie107 and @pickles976 for the runs. - **`0xc0000005` reading `0x400016000` in `Chain::detile_level` under `xg::copy_from` (@ClosetPie107):** as @St5sz2Jk worked out on #871, that is #477: XCL read `CopyFromSubresource`'s arguments with the wrong ABI and copied from the wrong address. #684 fixes it; @TobiasFornell's retest above shows the title calling `CopyFromSubresource` with #684's layout and no fault. It shows up with this stack because the title gets far enough to call it, not because of the lazy mapping. - **Assertion-enabled vkd3d-proton (@pickles976):** right, this stack alone still trips `iface->lpVtbl == &d3d12_heap_vtbl` on the first adopted heap. #2477 (stacked on #867) writes XCL's slots into vkd3d-proton's own tables for the assert-checked classes, heaps included; #1395 is the other approach. Neither is part of this PR, so on a release vkd3d-proton with assertions on, #877 needs one of them. I have not run #877 together with #2477 on an assertion-enabled build myself. AI use: Claude Code (Claude Opus 5.5) drafted this reply; I checked it.
upipibi commented 2026-11-26 23:33:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T23:33:53Z.


A note on overlap, since nothing in this thread links them: #2897 (XCL_SPARSE_LAZY=1, merged into nvidia-dev at fb35a759, on top of #2895's never-written-tiles line) defers the video memory of committed sparse-window tiles until their first use. That is the same goal this PR has.

What is the same (by reading 29352403 against nvidia-dev eff3bcab):

  • A committed tile gets no pool tile until the CPU sends it bytes or a recorded memory write targets it. Here that is ensure_lazy_mapped from list_x.rs:677; there it is will_write from list_x.rs:772,793.
  • Lazy spans stay in mapped_ranges, so they stay write-watched. Here that is sparse.rs:1621; there, LAZY entries are keys of s.mapped (sparse.rs:3998).
  • A recycled pool tile is zeroed before the first bytes are uploaded.

What differs:

  • Scope: here, Wine overflow heaps through alloc_lazy (kernelx.rs:347, always on under Wine). There, every commit_range (sparse.rs:2868), so every sparse::alloc heap, opt-in and refused below tiled resources tier 2.
  • Bookkeeping: a side LAZY_RANGES map here. A LAZY sentinel pool in s.mapped there (sparse.rs:137).
  • Trigger: a non-zero page here. Any uploaded bytes there (upload_dirty, sparse.rs:2190), plus a starved retry when no memory is found.
  • GPU writes: mapped at record time here. At the next submit there.
  • UAVs: CreateUnorderedAccessView maps buffer UAV ranges here (real.rs:2565). #2897 has no such hook.

alloc_lazy does not call committed(). With both present, a run under Wine with XCL_SPARSE_LAZY=1 would have two separate lazy schemes over the same State. git merge-tree of this head with nvidia-dev eff3bcab also conflicts in sparse.rs, list_x.rs, real.rs, uma.rs and kernelx.rs, so this needs a rebase once nvidia-dev reaches main. It may be worth deciding then whether the Wine case should go through XCL_SPARSE_LAZY, keeping the UAV hook, or stay separate.

AI-assisted (Claude Code, Claude Opus 5.5): read both branches and wrote this; nothing was run.

<!-- greyfinch-sync:ivall/xcl:comment:7205648025 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7205648025). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T23:33:53Z. --- A note on overlap, since nothing in this thread links them: #2897 (`XCL_SPARSE_LAZY=1`, merged into `nvidia-dev` at `fb35a759`, on top of #2895's never-written-tiles line) defers the video memory of committed sparse-window tiles until their first use. That is the same goal this PR has. What is the same (by reading `29352403` against `nvidia-dev` `eff3bcab`): - A committed tile gets no pool tile until the CPU sends it bytes or a recorded memory write targets it. Here that is `ensure_lazy_mapped` from `list_x.rs:677`; there it is `will_write` from `list_x.rs:772,793`. - Lazy spans stay in `mapped_ranges`, so they stay write-watched. Here that is `sparse.rs:1621`; there, LAZY entries are keys of `s.mapped` (`sparse.rs:3998`). - A recycled pool tile is zeroed before the first bytes are uploaded. What differs: - Scope: here, Wine overflow heaps through `alloc_lazy` (`kernelx.rs:347`, always on under Wine). There, every `commit_range` (`sparse.rs:2868`), so every `sparse::alloc` heap, opt-in and refused below tiled resources tier 2. - Bookkeeping: a side `LAZY_RANGES` map here. A `LAZY` sentinel pool in `s.mapped` there (`sparse.rs:137`). - Trigger: a non-zero page here. Any uploaded bytes there (`upload_dirty`, `sparse.rs:2190`), plus a `starved` retry when no memory is found. - GPU writes: mapped at record time here. At the next submit there. - UAVs: `CreateUnorderedAccessView` maps buffer UAV ranges here (`real.rs:2565`). #2897 has no such hook. `alloc_lazy` does not call `committed()`. With both present, a run under Wine with `XCL_SPARSE_LAZY=1` would have two separate lazy schemes over the same `State`. `git merge-tree` of this head with `nvidia-dev` `eff3bcab` also conflicts in `sparse.rs`, `list_x.rs`, `real.rs`, `uma.rs` and `kernelx.rs`, so this needs a rebase once `nvidia-dev` reaches `main`. It may be worth deciding then whether the Wine case should go through `XCL_SPARSE_LAZY`, keeping the UAV hook, or stay separate. AI-assisted (Claude Code, Claude Opus 5.5): read both branches and wrote this; nothing was run.
gustavsi commented 2026-11-29 03:53:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-29T03:53:07Z.


Closing as I'm stepping away from the project, but anyone is welcome to rebase and reuse these commits.

<!-- greyfinch-sync:ivall/xcl:comment:7250318210 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/877#issuecomment-7250318210). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-29T03:53:07Z. --- Closing as I'm stepping away from the project, but anyone is welcome to rebase and reuse these commits.

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!871
No description provided.