D3D12.X: track SRV min-LOD clamp and evictable VRAM heap class #2731

Open
github-bot wants to merge 3 commits from github-bot/gh-2731 into main AGit
Owner

@⁠O5-7 on GitHub · 2026-11-26 09:08 UTC · original
O5-7:vram/ws5-srv-clamp-and-heap-class → main · +932 −33 · 3 files · 3 commits · open

What is in it

  • Workstream 5 of #2688 (independent preparation PR: SRV ResourceMinLODClamp tracking, subresource tile unmap helper, per-group tile ownership, and TilePool evictable vs pinned heap isolation). No default behaviour changes (XCL_TEXTURE_BUDGET_EVICT defaults off, and automatic budget eviction is left for the follow-up PR).
  • Track live and copied SRV slots (TRACKED_SRVS in crates/xcl/src/hle/d3d12x/vram.rs, wired from dev_create_srv_x and copy_console_slots in crates/xcl/src/hle/d3d12x/real.rs and descriptor heap unregister in crates/xcl/src/hle/d3d12x/console_heap.rs), clearing stale slot bindings whenever an SRV slot is overwritten with null, buffer, RTAS, or non-placed resources, and raising ResourceMinLODClamp on new SRVs to resident_min_mip when XCL_TEXTURE_BUDGET_EVICT=1.
  • Partition TilePool (heap_evictable: Vec<bool>) so evictable top-mip tiles (map_levels with XCL_TEXTURE_BUDGET_EVICT=1) allocate into separate 64 MiB pool heaps from pinned packed-tail / flat allocations, enabling whole-heap reclamation once top mips are evicted; add Pages::unmap_range and per-group tile tracking (Levels::group_tiles).

Tested

  • hardware (GPU + driver, CPU), Rust version, release: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100, rustc 1.100.0 (0ef1bc386 2026-11-09), release build (cargo build --release -p xcl).
  • cargo test -p xcl --lib vram::tests -- --nocapture on head 2f2bb070: 23 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing), including GPU test gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip and 3 unit tests (clamp_srv_min_lod_raises_clamp_without_lowering_existing, evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim, tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy). (cargo test --workspace -- --test-threads=4: 1438 passed, 0 failed, 47 ignored on base PR commit 81e34358.)

Regression run

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1683 (PresentX 1683)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14252 MB
xcl-smoke v1
commit: 104265ea443e5cf653098d6f5a81c2c21f8b4204
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13628 MB

Not tested

  • No other titles besides title hash 9cc6a39e were run, and #[ignore] hardware/oracle tests were skipped.
  • Automatic budget-driven eviction (evict_under_budget) is intentionally omitted here to keep this PR focused and reviewable; XCL_TEXTURE_BUDGET_EVICT=1 only enables SRV tracking and evictable heap-class separation until the follow-up PR lands.

AI use

  • Antigravity coding agent helped implement the SRV tracking, slot overwrite clearing, TilePool heap-class isolation, GPU/unit tests, and regression runs, reviewed and verified locally.
**@⁠O5-7** on GitHub · 2026-11-26 09:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731) `O5-7:vram/ws5-srv-clamp-and-heap-class` → `main` · +932 −33 · 3 files · 3 commits · open **What is in it** - Workstream 5 of #2688 (independent preparation PR: SRV `ResourceMinLODClamp` tracking, subresource tile unmap helper, per-group tile ownership, and `TilePool` evictable vs pinned heap isolation). No default behaviour changes (`XCL_TEXTURE_BUDGET_EVICT` defaults off, and automatic budget eviction is left for the follow-up PR). - Track live and copied SRV slots (`TRACKED_SRVS` in `crates/xcl/src/hle/d3d12x/vram.rs`, wired from `dev_create_srv_x` and `copy_console_slots` in `crates/xcl/src/hle/d3d12x/real.rs` and descriptor heap unregister in `crates/xcl/src/hle/d3d12x/console_heap.rs`), clearing stale slot bindings whenever an SRV slot is overwritten with null, buffer, RTAS, or non-placed resources, and raising `ResourceMinLODClamp` on new SRVs to `resident_min_mip` when `XCL_TEXTURE_BUDGET_EVICT=1`. - Partition `TilePool` (`heap_evictable: Vec<bool>`) so evictable top-mip tiles (`map_levels` with `XCL_TEXTURE_BUDGET_EVICT=1`) allocate into separate 64 MiB pool heaps from pinned packed-tail / flat allocations, enabling whole-heap reclamation once top mips are evicted; add `Pages::unmap_range` and per-group tile tracking (`Levels::group_tiles`). **Tested** - hardware (GPU + driver, CPU), Rust version, release: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release build (`cargo build --release -p xcl`). - `cargo test -p xcl --lib vram::tests -- --nocapture` on head `2f2bb070`: 23 passed, 0 failed, 1 ignored (`churn_update_tile_mappings_timing`), including GPU test `gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip` and 3 unit tests (`clamp_srv_min_lod_raises_clamp_without_lowering_existing`, `evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim`, `tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy`). (`cargo test --workspace -- --test-threads=4`: 1438 passed, 0 failed, 47 ignored on base PR commit `81e34358`.) **Regression run** ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1683 (PresentX 1683) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14252 MB ``` ``` xcl-smoke v1 commit: 104265ea443e5cf653098d6f5a81c2c21f8b4204 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13628 MB ``` **Not tested** - No other titles besides title hash `9cc6a39e` were run, and `#[ignore]` hardware/oracle tests were skipped. - Automatic budget-driven eviction (`evict_under_budget`) is intentionally omitted here to keep this PR focused and reviewable; `XCL_TEXTURE_BUDGET_EVICT=1` only enables SRV tracking and evictable heap-class separation until the follow-up PR lands. **AI use** - Antigravity coding agent helped implement the SRV tracking, slot overwrite clearing, `TilePool` heap-class isolation, GPU/unit tests, and regression runs, reviewed and verified locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:14:13 +00:00
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 09:37 UTC · original · reviewed

On 81e3435, the tracked slot is not cleared when an existing placed-texture SRV is overwritten with a null, buffer, or non-placed SRV. For example, write tracked A to slot S, replace S with a null SRV, then CopyDescriptorsSimple(S, D). The native descriptors now contain the replacement, but by_slot still associates S with A and copy_srv_slot propagates A to D. The non-placed case returns before removing the old entry too. This affects the XCL_TEXTURE_BUDGET_EVICT=1 bookkeeping introduced here; the current PR does not yet implement the eviction rewrite, so I have not demonstrated a rendering failure.

Could every actual SRV overwrite clear the previous slot record under the tracking lock before optionally recording the new placed texture? Tests for placed→null and placed→non-placed, followed by a descriptor copy, should verify neither slot retains A. This is exact-head source review only.

**@⁠luckyteagirl** on GitHub · 2026-11-26 09:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#pullrequestreview-6071671156) · **reviewed** On `81e3435`, the tracked slot is not cleared when an existing placed-texture SRV is overwritten with a null, buffer, or non-placed SRV. For example, write tracked A to slot S, replace S with a null SRV, then `CopyDescriptorsSimple(S, D)`. The native descriptors now contain the replacement, but `by_slot` still associates S with A and `copy_srv_slot` propagates A to D. The non-placed case returns before removing the old entry too. This affects the `XCL_TEXTURE_BUDGET_EVICT=1` bookkeeping introduced here; the current PR does not yet implement the eviction rewrite, so I have not demonstrated a rendering failure. Could every actual SRV overwrite clear the previous slot record under the tracking lock before optionally recording the new placed texture? Tests for placed→null and placed→non-placed, followed by a descriptor copy, should verify neither slot retains A. This is exact-head source review only.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 10:35 UTC · original

Independent Windows check of #2731 head 81e3435, based on main b49be18.

Windows 11 build 26300, RTX 3080 Ti (12 GB, driver 621.35) as the active display adapter, rustc 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. The focused test calls D3D12CreateDevice(None) and does not log the selected adapter LUID, so I cannot assert the device identity from that test alone. XCL_TEXTURE_BUDGET_EVICT was unset. The checkout was clean at the exact PR head.

  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked -p xcl --lib gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored; no GPU skip. The test ran both red-before and green-after GPU readback assertions around the SRV clamp and top-mip unmap.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,438 passed, 0 failed, 47 ignored across 37 test executables, with 25 printed GPU SKIPPED notices. Those skipped paths are not GPU coverage.

This covers the focused clamp/unmap fixture and the workspace suite on this Windows host. It does not exercise the reported stale descriptor-slot overwrite path, automatic budget eviction (not in this PR), or a retail title run. I did not test AMD or Intel hardware.

AI use: Codex (GPT-6.2 Sol) inspected the test, ran the commands, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-26 10:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7189571758) Independent Windows check of [#2731 head `81e3435`](https://github.com/xcl-dev/xcl/commit/81e34358f79dc043458a62890535b8b8e5d33675), based on [`main` `b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Windows 11 build 26300, RTX 3080 Ti (12 GB, driver 621.35) as the active display adapter, rustc 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. The focused test calls `D3D12CreateDevice(None)` and does not log the selected adapter LUID, so I cannot assert the device identity from that test alone. `XCL_TEXTURE_BUDGET_EVICT` was unset. The checkout was clean at the exact PR head. - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked -p xcl --lib gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip -- --nocapture --test-threads=1`: 1 passed, 0 failed, 0 ignored; **no GPU skip**. The test ran both red-before and green-after GPU readback assertions around the SRV clamp and top-mip unmap. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet`: 1,438 passed, 0 failed, 47 ignored across 37 test executables, with 25 printed GPU `SKIPPED` notices. Those skipped paths are not GPU coverage. This covers the focused clamp/unmap fixture and the workspace suite on this Windows host. It does not exercise the [reported stale descriptor-slot overwrite path](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2731), automatic budget eviction (not in this PR), or a retail title run. I did not test AMD or Intel hardware. AI use: Codex (GPT-6.2 Sol) inspected the test, ran the commands, and drafted this report.
Author
Owner

@⁠O5-7 on GitHub · 2026-11-26 12:04 UTC · original

@⁠luckyteagirl Fixed in 2f2bb070:

  • TrackedSrvs::track now always clears any existing binding for pc_srv before checking resource == 0 || !is_placed.
  • In dev_create_srv_x, every overwrite path (null resource, buffer / buf_delta_null view, RTAS early-return, or non-placed texture) now clears stale tracking on slot.pc_srv via track_srv / untrack_srv.
  • Added unit test tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy verifying placed->null + copy and placed->non-placed + copy retain no references to the previous texture.

Re-verified cargo test -p xcl --lib vram::tests (23 passed, 0 failed, 1 ignored) and 60 s smoke.ps1 on 2f2bb070.

**@⁠O5-7** on GitHub · 2026-11-26 12:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7191541226) @⁠luckyteagirl Fixed in `2f2bb070`: - `TrackedSrvs::track` now always clears any existing binding for `pc_srv` before checking `resource == 0 || !is_placed`. - In `dev_create_srv_x`, every overwrite path (null resource, buffer / `buf_delta_null` view, RTAS early-return, or non-placed texture) now clears stale tracking on `slot.pc_srv` via `track_srv` / `untrack_srv`. - Added unit test `tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy` verifying placed->null + copy and placed->non-placed + copy retain no references to the previous texture. Re-verified `cargo test -p xcl --lib vram::tests` (`23 passed, 0 failed, 1 ignored`) and 60 s `smoke.ps1` on `2f2bb070`.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 12:59 UTC · original

Independent Windows recheck of #2731 head 2f2bb070 against main b49be18, following my older-head report. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti 12 GB (driver 621.35, active display adapter), rustc 1.99.1 MSVC, DXC 1.8.2502.11. XCL_D3D12_DIR pointed to signed D3D12 Agility 1.620.2 DLLs; XCL_TEXTURE_BUDGET_EVICT was unset. The native test uses D3D12CreateDevice(None) without logging the adapter LUID, so I cannot independently identify its selected adapter.

  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked -p xcl --lib vram::tests -- --nocapture --test-threads=1: 23 passed, 0 failed, 1 ignored, no SKIPPED lines. This includes tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy, evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim, and the native gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip readback. The overwrite test exercises the tracking structure; it does not call the public CreateShaderResourceView hook.
  • After building the test-title binaries, cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=1: 1,438 passed, 1 failed, 47 ignored across 37 targets, with 25 SKIPPED diagnostic lines included in Cargo's pass counts. The sole failure is console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (cached_only console_mesh hit: "DXIL not compiled yet"). The same test fails with the same error on untouched main b49be18 using the exact filtered command and environment. The 4 e2e tests passed after the required workspace build. This is a test report, not a clean-suite or merge-readiness claim.

One small diagnostic correction: budget_evict_enabled logs “evicting oldest top texture mips under local video memory budget” when the switch is on. The PR description says automatic budget eviction is deferred, so that line currently promises behavior this revision does not provide.

Suggested log wording
- D3D12.X: XCL_TEXTURE_BUDGET_EVICT=1 - evicting oldest top texture mips under local video memory budget
+ D3D12.X: XCL_TEXTURE_BUDGET_EVICT=1 - tracking SRV mip clamps and isolating top-mip tile heaps

Not tested: a live retail title with XCL_TEXTURE_BUDGET_EVICT=1, actual budget-driven eviction, AMD or Intel GPUs. AI use: Codex (GPT-6.2 Sol) reviewed the current source, ran the commands, and drafted this report; I checked the counts and log wording before posting.

**@⁠thehollowedone** on GitHub · 2026-11-26 12:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7192731915) Independent Windows recheck of [#2731 head `2f2bb070`](https://github.com/xcl-dev/xcl/commit/2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4) against [`main` `b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7), following my [older-head report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2731). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti 12 GB (driver 621.35, active display adapter), rustc 1.99.1 MSVC, DXC 1.8.2502.11. `XCL_D3D12_DIR` pointed to signed D3D12 Agility 1.620.2 DLLs; `XCL_TEXTURE_BUDGET_EVICT` was unset. The native test uses `D3D12CreateDevice(None)` without logging the adapter LUID, so I cannot independently identify its selected adapter. - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked -p xcl --lib vram::tests -- --nocapture --test-threads=1`: **23 passed, 0 failed, 1 ignored**, no `SKIPPED` lines. This includes `tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy`, `evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim`, and the native `gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip` readback. The overwrite test exercises the tracking structure; it does not call the public `CreateShaderResourceView` hook. - After building the test-title binaries, `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=1`: **1,438 passed, 1 failed, 47 ignored** across 37 targets, with 25 `SKIPPED` diagnostic lines included in Cargo's pass counts. The sole failure is `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`cached_only console_mesh hit: "DXIL not compiled yet"`). The same test fails with the same error on untouched `main` `b49be18` using the exact filtered command and environment. The 4 `e2e` tests passed after the required workspace build. This is a test report, not a clean-suite or merge-readiness claim. One small diagnostic correction: [`budget_evict_enabled`](https://github.com/xcl-dev/xcl/blob/2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4/crates/xcl/src/hle/d3d12x/vram.rs#L333-L342) logs “evicting oldest top texture mips under local video memory budget” when the switch is on. The PR description says automatic budget eviction is deferred, so that line currently promises behavior this revision does not provide. <details><summary>Suggested log wording</summary> ```diff - D3D12.X: XCL_TEXTURE_BUDGET_EVICT=1 - evicting oldest top texture mips under local video memory budget + D3D12.X: XCL_TEXTURE_BUDGET_EVICT=1 - tracking SRV mip clamps and isolating top-mip tile heaps ``` </details> Not tested: a live retail title with `XCL_TEXTURE_BUDGET_EVICT=1`, actual budget-driven eviction, AMD or Intel GPUs. AI use: Codex (GPT-6.2 Sol) reviewed the current source, ran the commands, and drafted this report; I checked the counts and log wording before posting.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 13:06 UTC · original · reviewed

Good within the reviewed scope; retain for integration. The SRV minimum-LOD clamp and heap-class bookkeeping are worth keeping as preparation.

Clean PR head 2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4, based directly on current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Targeted result: 4 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:

  • hle::d3d12x::vram::tests::the_tiles_of_a_texture_are_grouped_by_its_levels
  • hle::d3d12x::vram::tests::clamp_srv_min_lod_raises_clamp_without_lowering_existing
  • hle::d3d12x::vram::tests::evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim
  • hle::d3d12x::vram::tests::tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy

Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run: <test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.

Not tested: Four CPU tests passed. The change records metadata; it does not enable eviction or prove a reduction in VRAM use. No whole suite or retail smoke was run for this batch; this is not merge certification.

AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 13:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#pullrequestreview-6074636934) · **reviewed** **Good within the reviewed scope; retain for integration.** The SRV minimum-LOD clamp and heap-class bookkeeping are worth keeping as preparation. Clean PR head `2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4`, based directly on current main `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. **Targeted result: 4 passed, 0 failed, 0 ignored, 0 skipped.** Each exact filter ran in a fresh process: - `hle::d3d12x::vram::tests::the_tiles_of_a_texture_are_grouped_by_its_levels` - `hle::d3d12x::vram::tests::clamp_srv_min_lod_raises_clamp_without_lowering_existing` - `hle::d3d12x::vram::tests::evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim` - `hle::d3d12x::vram::tests::tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy` Build: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>`. Run: `<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture`. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work. **Not tested:** Four CPU tests passed. The change records metadata; it does not enable eviction or prove a reduction in VRAM use. No whole suite or retail smoke was run for this batch; this is not merge certification. AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Author
Owner

@⁠Decodere on GitHub · 2026-11-26 13:10 UTC · original

Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2731 at 2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4 (parent 81e34358f79dc043458a62890535b8b8e5d33675; merge-base origin/main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)

Targeted RTX 4060 release unit tests (2f2bb070)

  • cargo test --release -p xcl --lib clamp_srv_min_lod_raises_clamp_without_lowering_existing -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip -- --nocapture: 1 passed, 0 failed, 0 ignored (0.36 s, ran live on RTX 4060, 0 skipped, exit 0).
  • cargo test --release -p xcl --lib evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4: 23 passed, 0 failed, 1 ignored (2.55 s, churn_update_tile_mappings_timing ignored, 0 skipped, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::console_heap:: -- --test-threads=4: 12 passed, 0 failed, 0 ignored (0.20 s, 0 skipped, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4: 60 passed, 0 failed, 0 ignored (0.65 s, 0 skipped, exit 0).

Observations

  • All 4 new SRV min-LOD clamp, tracked-slot overwrite, and evictable heap-class tests (including live RTX 4060 GPU sampling in gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip) plus all 95 targeted tests across vram::, console_heap::, and real:: passed cleanly in --release on exact head 2f2bb070 with 0 skips.
  • Quiet 60 s retail smoke ran cleanly (exit: 0x0, 1596 frames shown, 60 60 60 steady-state presents per 2 s, 0 device removals, 0 crashes, 14020 MB peak commit vs origin/main b49be183's 14018 MB / 1518 frames; steady-state VRAM 6116 MB local / 4683 MB non-local at 58.0 s).

Paired 60 s RTX 4060 smoke (b49be183 vs 2f2bb070)

Merge-base origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2731 head (2f2bb070):

xcl-smoke v1
commit: 2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1596 (PresentX 1596)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14020 MB

Limits of coverage

  • Full workspace test suite was not re-run on 2f2bb070 (only targeted vram::, console_heap::, and real:: release tests plus paired quiet 60 s smoke).
  • The 60 s default-flags retail smoke verifies zero regression in steady-state SRV/heap tracking; active top-mip eviction under VRAM pressure is deferred to follow-up work and exercised here via the unit + GPU test gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip.
  • Single discrete NVIDIA 8 GB GPU (RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from cargo test and scripts/smoke.ps1 outputs.

**@⁠Decodere** on GitHub · 2026-11-26 13:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7192978974) **Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2731 at `2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4`** (parent `81e34358f79dc043458a62890535b8b8e5d33675`; merge-base `origin/main` `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`). Measurements and targeted test results only; not a full source review. ### Setup - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` - **Toolchain / caches:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5`, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs) - **Workload:** Retail workload `title: 29640639` via `scripts/smoke.ps1 -Seconds 60` (`XCL_NETWORK=0 XCL_ACTIVITY=1`, default flags, no input) ### Targeted RTX 4060 release unit tests (`2f2bb070`) - `cargo test --release -p xcl --lib clamp_srv_min_lod_raises_clamp_without_lowering_existing -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.00 s`, exit `0`). - `cargo test --release -p xcl --lib gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.36 s`, ran live on RTX 4060, `0` skipped, exit `0`). - `cargo test --release -p xcl --lib evictable_heap_class_isolates_top_mips_so_empty_heaps_reclaim -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.00 s`, exit `0`). - `cargo test --release -p xcl --lib tracked_srv_overwrite_with_null_or_non_placed_clears_slot_before_copy -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.00 s`, exit `0`). - `cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4`: **23 passed, 0 failed, 1 ignored** (`2.55 s`, `churn_update_tile_mappings_timing` ignored, `0` skipped, exit `0`). - `cargo test --release -p xcl --lib hle::d3d12x::console_heap:: -- --test-threads=4`: **12 passed, 0 failed, 0 ignored** (`0.20 s`, `0` skipped, exit `0`). - `cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4`: **60 passed, 0 failed, 0 ignored** (`0.65 s`, `0` skipped, exit `0`). ### Observations - All 4 new SRV min-LOD clamp, tracked-slot overwrite, and evictable heap-class tests (including live RTX 4060 GPU sampling in `gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip`) plus all 95 targeted tests across `vram::`, `console_heap::`, and `real::` passed cleanly in `--release` on exact head `2f2bb070` with `0` skips. - Quiet 60 s retail smoke ran cleanly (`exit: 0x0`, `1596` frames shown, `60 60 60` steady-state presents per 2 s, `0` device removals, `0` crashes, `14020 MB` peak commit vs `origin/main` `b49be183`'s `14018 MB` / `1518` frames; steady-state VRAM `6116 MB` local / `4683 MB` non-local at `58.0 s`). ### Paired 60 s RTX 4060 smoke (`b49be183` vs `2f2bb070`) Merge-base `origin/main` (`b49be183`): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14018 MB ``` PR #2731 head (`2f2bb070`): ``` xcl-smoke v1 commit: 2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1596 (PresentX 1596) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14020 MB ``` ### Limits of coverage - Full workspace test suite was not re-run on `2f2bb070` (only targeted `vram::`, `console_heap::`, and `real::` release tests plus paired quiet 60 s smoke). - The 60 s default-flags retail smoke verifies zero regression in steady-state SRV/heap tracking; active top-mip eviction under VRAM pressure is deferred to follow-up work and exercised here via the unit + GPU test `gpu_unmap_top_mip_with_srv_min_lod_clamp_samples_resident_mip`. - Single discrete NVIDIA 8 GB GPU (`RTX 4060`) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host. ### AI use Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from `cargo test` and `scripts/smoke.ps1` outputs.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 13:45 UTC · original · reviewed

Needs changes: stale SRV ownership survives a console UAV overwrite. At head 2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4, a test-only probe through the actual dev_create_uav_x and copy_console_slots paths reproduced the missing cleanup. A null texture UAV writes a null companion SRV, but tracking still associates both the source and copied slot with the old placed texture.

The earlier four passing CPU tests remain valid; they did not cover this entry point. The new probe on unchanged runtime code produced 0 passed, 1 expected failure, 0 ignored, 0 skipped: both tracked slots retained Some(0x2731) after actual fake-device descriptor writes and copy had completed, instead of becoming None.

I prepared an uncommitted local repair that clears old ownership immediately after actual companion SRV writes and on buffer/empty-view conversion. It preserves tracking when an unsupported image form leaves the companion descriptor unchanged. The same regression, an unchanged-descriptor ownership control and the original four tests then produced 6 passed, 0 failed, 0 ignored, 0 skipped. Complete local patch SHA256: 8eed2fa056b859db9df663015027af9654cc16db4a2ca8226101b5620b7aa947. These are results for the locally repaired tree, not a passing claim for unchanged upstream runtime code.

The two production-path probes use owned fake device/descriptor storage; no driver receives the unsupported descriptor. XCL_TEXTURE_BUDGET_EVICT=1, XCL_TRACE_FRAME unset, one exact test per fresh process. Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>; run: <test-exe> <exact-name> --exact --test-threads=1 --nocapture.

New exact filters: hle::d3d12x::real::uav_tracking_probe::null_texture_uav_overwrite_clears_tracked_srv_before_console_copy and hle::d3d12x::real::uav_tracking_probe::unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy. The four retained filters are in my earlier report.

This fixes stale old ownership, not complete new-companion registration, evictable-heap alias identity or an eviction policy. No visual corruption, VRAM saving, GPU behavior, full-suite or title result is claimed. Local changes remain separate from the installed build.

AI use: Codex (GPT-6) traced the entry/copy paths, prepared and cross-reviewed the local repair and inspected raw regression results. Optional temporary Discord for coordinating contributor work, testing and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 13:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#pullrequestreview-6075192937) · **reviewed** **Needs changes: stale SRV ownership survives a console UAV overwrite.** At head `2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4`, a test-only probe through the actual `dev_create_uav_x` and `copy_console_slots` paths reproduced the missing cleanup. A null texture UAV writes a null companion SRV, but tracking still associates both the source and copied slot with the old placed texture. The earlier four passing CPU tests remain valid; they did not cover this entry point. The new probe on unchanged runtime code produced **0 passed, 1 expected failure, 0 ignored, 0 skipped**: both tracked slots retained `Some(0x2731)` after actual fake-device descriptor writes and copy had completed, instead of becoming `None`. I prepared an uncommitted local repair that clears old ownership immediately after actual companion SRV writes and on buffer/empty-view conversion. It preserves tracking when an unsupported image form leaves the companion descriptor unchanged. The same regression, an unchanged-descriptor ownership control and the original four tests then produced **6 passed, 0 failed, 0 ignored, 0 skipped**. Complete local patch SHA256: `8eed2fa056b859db9df663015027af9654cc16db4a2ca8226101b5620b7aa947`. These are results for the locally repaired tree, not a passing claim for unchanged upstream runtime code. The two production-path probes use owned fake device/descriptor storage; no driver receives the unsupported descriptor. `XCL_TEXTURE_BUDGET_EVICT=1`, `XCL_TRACE_FRAME` unset, one exact test per fresh process. Build: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>`; run: `<test-exe> <exact-name> --exact --test-threads=1 --nocapture`. New exact filters: `hle::d3d12x::real::uav_tracking_probe::null_texture_uav_overwrite_clears_tracked_srv_before_console_copy` and `hle::d3d12x::real::uav_tracking_probe::unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy`. The four retained filters are in my earlier report. This fixes stale old ownership, not complete new-companion registration, evictable-heap alias identity or an eviction policy. No visual corruption, VRAM saving, GPU behavior, full-suite or title result is claimed. Local changes remain separate from the installed build. AI use: Codex (GPT-6) traced the entry/copy paths, prepared and cross-reviewed the local repair and inspected raw regression results. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 15:13 UTC · original · reviewed

Separate issue from the companion-SRV overwrite: the pinned/evictable heap guarantee can fail when two resources alias the same guest-owned tile. Bind an evictable top mip first, then bind a pinned resource to that guest tile. The reuse path in vram.rs increases the existing mapping's user count without promoting its heap or excluding that heap from evictable allocation. When the evictable references are gone, the pinned reference can still prevent heap reclamation.

This is source-traced. The existing heap-class test uses fresh disjoint tiles. Please add an alias case that verifies both binds retain physical tile identity, excludes the mixed heap from fully reclaimable accounting, and checks that the pinned value survives release of the evictable alias.

AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary Discord for coordinating contributor work, testing, and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 15:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#pullrequestreview-6076550017) · **reviewed** **Separate issue from the companion-SRV overwrite:** the pinned/evictable heap guarantee can fail when two resources alias the same guest-owned tile. Bind an evictable top mip first, then bind a pinned resource to that guest tile. The reuse path in `vram.rs` increases the existing mapping's user count without promoting its heap or excluding that heap from evictable allocation. When the evictable references are gone, the pinned reference can still prevent heap reclamation. This is source-traced. The existing heap-class test uses fresh disjoint tiles. Please add an alias case that verifies both binds retain physical tile identity, excludes the mixed heap from fully reclaimable accounting, and checks that the pinned value survives release of the evictable alias. AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing, and comparing results.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 22:20 UTC · original

Follow-up to the pinned/evictable alias review on head 2f2bb070. I reproduced that specific heap-class gap and checked a small candidate repair.

A test-only GPU fixture binds an evictable top tile, then a pinned resource to the same guest page. They retain one physical tile, but its heap remains classed evictable. A third, disjoint evictable tile then allocates in that heap. On unchanged runtime code the exact test failed 0 passed, 1 failed, 0 ignored, 0 skipped at a heap containing a pinned alias cannot stay evictable. This is a classification failure; I did not observe a reclaimed live heap or pixel corruption.

After a successful pinned bind, marking every heap touched by its mapped tiles as pinned makes the test pass. It keeps the existing tile mapping, including aliases, and prevents fresh evictable tiles from entering that heap. The class remains conservative until the heap slot is recycled. The test also unmaps/releases the evictable alias and verifies the pinned page still has the original tile with one user. On this local candidate, cargo test --offline --locked -p xcl --lib hle::d3d12x::vram::tests:: -- --test-threads=1 reported 24 passed, 0 failed, 1 ignored, 0 skipped.

Candidate patch against 2f2bb070
diff --git a/crates/xcl/src/hle/d3d12x/vram.rs b/crates/xcl/src/hle/d3d12x/vram.rs
@@ -920,6 +920,11 @@ impl Pages {
             };
             tiles.push(tile);
         }
+        if !evictable {
+            for &(h, _) in &tiles {
+                pool.heap_evictable[h as usize] = false;
+            }
+        }
         self.map(res, sub, &tiles);
@@ -2718,6 +2723,57 @@ mod tests {
         assert!(!reclaimed.contains(&expected_pinned_heap), "pinned tail heap remains live");
     }
+
+    #[test]
+    fn pinned_alias_excludes_its_heap_from_fresh_evictable_tiles() {
+        let _guard = VRAM_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
+        use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0;
+        use windows::Win32::Graphics::Dxgi::Common::*;
+        unsafe {
+            let mut dev: Option<ID3D12Device> = None;
+            if D3D12CreateDevice(None, D3D_FEATURE_LEVEL_11_0, &mut dev).is_err() {
+                return crate::gpu::recomp::runner::skip_test("no D3D12 device");
+            }
+            let dev = dev.unwrap();
+            let Some(mut pages) = Pages::new(&dev) else {
+                return crate::gpu::recomp::runner::skip_test("no tiled tier 2");
+            };
+            let desc = D3D12_RESOURCE_DESC {
+                Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, Width: 64, Height: 64,
+                DepthOrArraySize: 1, MipLevels: 1, Format: DXGI_FORMAT_R8G8B8A8_UNORM,
+                SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
+                Layout: D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE,
+                ..Default::default()
+            };
+            let make = || {
+                let mut res = None;
+                dev.CreateReservedResource(&desc, D3D12_RESOURCE_STATE_COMMON, None, &mut res).unwrap();
+                res.unwrap()
+            };
+            let (top, pinned, fresh) = (make(), make(), make());
+            let mut total = 0u32;
+            dev.GetResourceTiling(&top, Some(&mut total), None, None, None, 0, std::ptr::null_mut());
+            assert!(total >= 1);
+            let (shared_va, fresh_va) = (0x66_0000_0000usize, 0x67_0000_0000usize);
+            let (top_used, top_extra) = pages.bind_range(&dev, &top, shared_va, Some(16384), total, 0, 0..1, true).unwrap();
+            let first = pages.pages[&shared_va].tile;
+            pages.bind_range(&dev, &pinned, shared_va, Some(16384), total, 0, 0..1, false).unwrap();
+            let second = pages.pages[&shared_va].tile;
+            let class_after_alias = pages.pool.heap_evictable[first.0 as usize];
+            pages.bind_range(&dev, &fresh, fresh_va, Some(16384), total, 0, 0..1, true).unwrap();
+            let third = pages.pages[&fresh_va].tile;
+            pages.unmap(&top, total);
+            pages.release_tiles(top_used, top_extra, Instant::now(), true);
+            let pinned_after_release = (pages.pages[&shared_va].tile, pages.pages[&shared_va].users);
+            pages.fence.SetEventOnCompletion(pages.value, windows::Win32::Foundation::HANDLE::default()).unwrap();
+            drop((top, pinned, fresh));
+            drop(pages);
+            assert_eq!(first, second, "the two guest-address aliases must retain one physical tile");
+            assert_eq!(pinned_after_release, (first, 1), "releasing the evictable alias must retain the pinned tile");
+            assert!(!class_after_alias, "a heap containing a pinned alias cannot stay evictable");
+            assert_ne!(first.0, third.0, "fresh evictable tiles must go to a different heap");
+        }
+    }

Environment: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35 active display adapter, Rust 1.99.1 MSVC debug. This fixture uses D3D12CreateDevice(None) and does not record its selected adapter LUID, so I cannot independently prove the device identity. Not tested: full workspace suite, paired title smoke, actual budget eviction, AMD/Intel/Wine, or GPU pixel contents. This is a candidate for the author to integrate and verify, not a merge-readiness claim.

AI use: Codex (GPT-6.2 Sol) wrote and ran the fixture, checked the candidate, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-26 22:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7204582195) Follow-up to the [pinned/evictable alias review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2731) on [head `2f2bb070`](https://github.com/xcl-dev/xcl/commit/2f2bb070fafc8f9fca30d9ac81a3e5fe4f71fbe4). I reproduced that specific heap-class gap and checked a small candidate repair. A test-only GPU fixture binds an evictable top tile, then a pinned resource to the **same guest page**. They retain one physical tile, but its heap remains classed evictable. A third, disjoint evictable tile then allocates in that heap. On unchanged runtime code the exact test failed **0 passed, 1 failed, 0 ignored, 0 skipped** at `a heap containing a pinned alias cannot stay evictable`. This is a classification failure; I did not observe a reclaimed live heap or pixel corruption. After a successful pinned bind, marking every heap touched by its mapped tiles as pinned makes the test pass. It keeps the existing tile mapping, including aliases, and prevents fresh evictable tiles from entering that heap. The class remains conservative until the heap slot is recycled. The test also unmaps/releases the evictable alias and verifies the pinned page still has the original tile with one user. On this local candidate, `cargo test --offline --locked -p xcl --lib hle::d3d12x::vram::tests:: -- --test-threads=1` reported **24 passed, 0 failed, 1 ignored, 0 skipped**. <details><summary>Candidate patch against 2f2bb070</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/vram.rs b/crates/xcl/src/hle/d3d12x/vram.rs @@ -920,6 +920,11 @@ impl Pages { }; tiles.push(tile); } + if !evictable { + for &(h, _) in &tiles { + pool.heap_evictable[h as usize] = false; + } + } self.map(res, sub, &tiles); @@ -2718,6 +2723,57 @@ mod tests { assert!(!reclaimed.contains(&expected_pinned_heap), "pinned tail heap remains live"); } + + #[test] + fn pinned_alias_excludes_its_heap_from_fresh_evictable_tiles() { + let _guard = VRAM_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner()); + use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0; + use windows::Win32::Graphics::Dxgi::Common::*; + unsafe { + let mut dev: Option<ID3D12Device> = None; + if D3D12CreateDevice(None, D3D_FEATURE_LEVEL_11_0, &mut dev).is_err() { + return crate::gpu::recomp::runner::skip_test("no D3D12 device"); + } + let dev = dev.unwrap(); + let Some(mut pages) = Pages::new(&dev) else { + return crate::gpu::recomp::runner::skip_test("no tiled tier 2"); + }; + let desc = D3D12_RESOURCE_DESC { + Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, Width: 64, Height: 64, + DepthOrArraySize: 1, MipLevels: 1, Format: DXGI_FORMAT_R8G8B8A8_UNORM, + SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 }, + Layout: D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE, + ..Default::default() + }; + let make = || { + let mut res = None; + dev.CreateReservedResource(&desc, D3D12_RESOURCE_STATE_COMMON, None, &mut res).unwrap(); + res.unwrap() + }; + let (top, pinned, fresh) = (make(), make(), make()); + let mut total = 0u32; + dev.GetResourceTiling(&top, Some(&mut total), None, None, None, 0, std::ptr::null_mut()); + assert!(total >= 1); + let (shared_va, fresh_va) = (0x66_0000_0000usize, 0x67_0000_0000usize); + let (top_used, top_extra) = pages.bind_range(&dev, &top, shared_va, Some(16384), total, 0, 0..1, true).unwrap(); + let first = pages.pages[&shared_va].tile; + pages.bind_range(&dev, &pinned, shared_va, Some(16384), total, 0, 0..1, false).unwrap(); + let second = pages.pages[&shared_va].tile; + let class_after_alias = pages.pool.heap_evictable[first.0 as usize]; + pages.bind_range(&dev, &fresh, fresh_va, Some(16384), total, 0, 0..1, true).unwrap(); + let third = pages.pages[&fresh_va].tile; + pages.unmap(&top, total); + pages.release_tiles(top_used, top_extra, Instant::now(), true); + let pinned_after_release = (pages.pages[&shared_va].tile, pages.pages[&shared_va].users); + pages.fence.SetEventOnCompletion(pages.value, windows::Win32::Foundation::HANDLE::default()).unwrap(); + drop((top, pinned, fresh)); + drop(pages); + assert_eq!(first, second, "the two guest-address aliases must retain one physical tile"); + assert_eq!(pinned_after_release, (first, 1), "releasing the evictable alias must retain the pinned tile"); + assert!(!class_after_alias, "a heap containing a pinned alias cannot stay evictable"); + assert_ne!(first.0, third.0, "fresh evictable tiles must go to a different heap"); + } + } ``` </details> Environment: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35 active display adapter, Rust 1.99.1 MSVC debug. This fixture uses `D3D12CreateDevice(None)` and does not record its selected adapter LUID, so I cannot independently prove the device identity. **Not tested:** full workspace suite, paired title smoke, actual budget eviction, AMD/Intel/Wine, or GPU pixel contents. This is a candidate for the author to integrate and verify, not a merge-readiness claim. AI use: Codex (GPT-6.2 Sol) wrote and ran the fixture, checked the candidate, and drafted this report.
Author
Owner

@⁠O5-7 on GitHub · 2026-11-27 12:25 UTC · original

Updated in 104265ea:

CBV/UAV slot overwrite untracking (@⁠Prime1997): Added untrack_srv(slot.pc_srv) in dev_create_cbv_x and in dev_create_uav_x whenever the slot/companion descriptor is overwritten (null/invalid views, buffer UAVs, or image companion SRV writes), while leaving TRACKED_SRVS untouched when uav_companion_srv returns None and skips rewriting slot.pc_srv. Covered by new production-path tests null_texture_uav_overwrite_clears_tracked_srv_before_console_copy and unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy.
Pinned alias heap demotion (@⁠Prime1997, @⁠thehollowedone): In Pages::bind_range, when a !evictable bind aliases an existing pages or extra_pages guest page, TilePool::mark_heap_pinned now demotes that heap out of heap_evictable so subsequent disjoint evictable allocations do not pack into a pinned-by-alias heap. Covered by gpu_pinned_alias_on_evictable_guest_page_demotes_heap_and_survives_release.

**@⁠O5-7** on GitHub · 2026-11-27 12:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7218235866) Updated in 104265ea: CBV/UAV slot overwrite untracking (@⁠Prime1997): Added untrack_srv(slot.pc_srv) in dev_create_cbv_x and in dev_create_uav_x whenever the slot/companion descriptor is overwritten (null/invalid views, buffer UAVs, or image companion SRV writes), while leaving TRACKED_SRVS untouched when uav_companion_srv returns None and skips rewriting slot.pc_srv. Covered by new production-path tests null_texture_uav_overwrite_clears_tracked_srv_before_console_copy and unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy. Pinned alias heap demotion (@⁠Prime1997, @⁠thehollowedone): In Pages::bind_range, when a !evictable bind aliases an existing pages or extra_pages guest page, TilePool::mark_heap_pinned now demotes that heap out of heap_evictable so subsequent disjoint evictable allocations do not pack into a pinned-by-alias heap. Covered by gpu_pinned_alias_on_evictable_guest_page_demotes_heap_and_survives_release.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-27 12:37 UTC · original

Independent Windows check of #2731 head 104265ea, following the author’s pinned-alias and descriptor-overwrite changes. The checkout was clean. On Windows 11 build 26300 with an RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, rustc 1.99.1 MSVC and DXC 1.8.2502.11:

  • cargo build --locked --workspace: passed.
  • Each focused cargo test --locked -p xcl --lib <filter> -- --nocapture --test-threads=1 passed 1/0/0, no skip for gpu_pinned_alias_on_evictable_guest_page_demotes_heap_and_survives_release, null_texture_uav_overwrite_clears_tracked_srv_before_console_copy, and unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy. The GPU fixture calls D3D12CreateDevice(None) and does not log the chosen adapter LUID.
  • cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,441 passed, 1 failed, 47 ignored across 37 targets. There were 25 skip notices: 21 no native wave64, three refused per-lane cases, and one no heap windows. Skips are not GPU coverage.

The sole suite failure was gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, at cached_only console_mesh hit: "DXIL not compiled yet". I ran that exact filter separately on clean current main 06f90c1; it failed with the same message (0 passed, 1 failed, 0 ignored). This control supports treating the suite failure as pre-existing, not a regression from this PR. The new alias/overwrite regressions pass at this head.

I did not run a paired title smoke on 104265ea, test actual budget eviction under pressure, or test AMD, Intel, or Wine. The clean-head smoke pair and a green full-suite gate still need resolution before merge.

AI use: Codex (GPT-6.2 Sol) reviewed the changed paths, ran the commands, checked counts and skip notices, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-27 12:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2731#issuecomment-7218474201) Independent Windows check of [#2731 head `104265ea`](https://github.com/xcl-dev/xcl/commit/104265ea443e5cf653098d6f5a81c2c21f8b4204), following the author’s pinned-alias and descriptor-overwrite changes. The checkout was clean. On Windows 11 build 26300 with an RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, rustc 1.99.1 MSVC and DXC 1.8.2502.11: - `cargo build --locked --workspace`: passed. - Each focused `cargo test --locked -p xcl --lib <filter> -- --nocapture --test-threads=1` passed **1/0/0, no skip** for `gpu_pinned_alias_on_evictable_guest_page_demotes_heap_and_survives_release`, `null_texture_uav_overwrite_clears_tracked_srv_before_console_copy`, and `unsupported_texture_uav_without_companion_preserves_tracked_srv_before_console_copy`. The GPU fixture calls `D3D12CreateDevice(None)` and does not log the chosen adapter LUID. - `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --quiet`: **1,441 passed, 1 failed, 47 ignored** across 37 targets. There were **25 skip notices**: 21 no native wave64, three refused per-lane cases, and one no heap windows. Skips are not GPU coverage. The sole suite failure was `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk`, at `cached_only console_mesh hit: "DXIL not compiled yet"`. I ran that exact filter separately on clean [current main `06f90c1`](https://github.com/xcl-dev/xcl/commit/06f90c1986f43698d0405eff3c2ab0af230e1ed9); it failed with the same message (**0 passed, 1 failed, 0 ignored**). This control supports treating the suite failure as pre-existing, not a regression from this PR. The new alias/overwrite regressions pass at this head. I did not run a paired title smoke on `104265ea`, test actual budget eviction under pressure, or test AMD, Intel, or Wine. The clean-head smoke pair and a green full-suite gate still need resolution before merge. AI use: Codex (GPT-6.2 Sol) reviewed the changed paths, ran the commands, checked counts and skip notices, and drafted this report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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