D3D12.X: recycle released reserved sampled textures by description and state #2436

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

@⁠saintwolf on GitHub · 2026-11-25 18:40 UTC · original
saintwolf:vram/recycle-reserved-textures → main · +420 −33 · 4 files · 1 commits · open

Recycles released reserved sampled textures in a bounded per-device pool keyed by exact (D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES) so streamed texture placements skip CreateReservedResource and GetResourceTiling. Fixes #1268. Part of #1833.

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: forget(res) returns the removed texture's last tracked uniform D3D12_RESOURCE_STATES when all subresources share a single state (states.len() == 1), or None for mixed-state / untracked textures.
  • crates/xcl/src/hle/d3d12x/real.rs: on final Release (n == 0) while late_release holds the last PC ref, parks eligible place_pages sampled textures with their actual uniform D3D12 state; exposes note_reserved so reused pointers re-register in RESERVED.
  • crates/xcl/src/hle/d3d12x/late_release.rs: once every live GPU queue is past a batch's fence, hands parked textures to vram::recycle_ready instead of destroying them.
  • crates/xcl/src/hle/d3d12x/vram.rs: adds ReservedKey and a bounded per-device ReservedPool (512 idle entries/device, generation-tombstoned FIFO eviction with bounded order compaction, evicted entries dropped outside PAGES.lock(), opt-out via XCL_RESERVED_POOL=0). recycle_ready unmaps any still-mapped tiles (pages.unmap) on the background late_release thread so retired 64 MiB VRAM pool heaps never leave stale page-table references. place_on_pages pops matching pooled reserved textures via QueryInterface and reuses their cached tile count, skipping CreateReservedResource and GetResourceTiling. Adds unit tests (reuse hit, state isolation, FIFO eviction, cap=0, repeated take/repark tombstoning + cap-FIFO ordering) and a GPU recycle/rebind test.

Tested

  • Windows 11 (build 26300), NVIDIA GeForce RTX 4070 SUPER (driver 32.0.16.2140), AMD Ryzen 7 7800X3D, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL 1.8.2502.11.
  • .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4, debug) on head 2f92cc8: 1426 passed, 0 failed, 46 ignored across 37 test binaries, including all hle::d3d12x::vram::tests (reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo, reserved_pool_repark_tombstones_stale_order_and_preserves_fifo, and reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu).
  • SKIPPED GPU tests on this adapter (27 total): 21 no wave64, 3 per-lane form #1426 refusals (V_CVT_F16_F32, V_MUL_F16, V_PK_MUL_F16), 1 cannot disable the driver cache (Windows Developer Mode is required) (0x887A002D), 1 no xgameruntime.dll, 1 no heap windows.
  • Isolated #1268 microbenchmark on RTX 4070 SUPER (release, 2,000 iterations each):
    • 256x256 BC1 (9 mips): CreateReservedResource + GetResourceTiling + Release 222.33 ms (111.17 µs/tex) → recycled pool 0.04 ms (0.019 µs/tex) (5,730× faster).
    • 1024x1024 BC7 (11 mips): 279.58 ms (139.79 µs/tex) → recycled pool 0.04 ms (0.019 µs/tex) (7,262× faster).
  • Paired retail world-load A/B run (XCL_DIRECT_DXIL=1, XCL_PSO_WAIT_MS=50, XCL_PRESS_A_AT=15,20,25,30,35,40,45, isolated caches): XCL_RESERVED_POOL=1 cleanly recycled 32+ streamed reserved textures live before both arms hit the same pre-existing xboxbvhbuilder.dll 40-bit VA exception (~112–116 s), with 0 device removals and -352 MB lower peak commit (28,903 MB vs 29,255 MB).

Regression run

xcl-smoke v1
commit: 3f4495a2b325ae5a9df314dd86d10327502b5cf5
gpu: NVIDIA GeForce RTX 4070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 971 (PresentX 971)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14961 MB
xcl-smoke v1
commit: 2f92cc841ad65e2dc7e63fea17d227a71e44f16b
gpu: NVIDIA GeForce RTX 4070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 914 (PresentX 914)
presents per 2 s (last 3): 56 54 53
device removals: 0
crashes: 0
peak commit: 15405 MB

Not tested

  • AMD RDNA / Intel GPUs (tested on NVIDIA RTX 4070 SUPER only; the 0.62–1.70 ms per-texture CreateReservedResource stall from #1268 was measured on AMD RDNA2 and should see the largest streaming speedup there).
  • Extended past-world-load play under the D3D12 debug layer (the 60 s smoke run covers menus; the scripted world-load A/B run reached ~112–116 s before hitting the pre-existing xboxbvhbuilder.dll 40-bit VA exception).

AI use

  • Antigravity (Gemini 4 Neon) for issue diagnosis, implementation, tests, benchmarking, and PR drafting; all builds, tests, benchmarks, and retail runs were executed locally on the hardware above.
**@⁠saintwolf** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436) `saintwolf:vram/recycle-reserved-textures` → `main` · +420 −33 · 4 files · 1 commits · open Recycles released reserved sampled textures in a bounded per-device pool keyed by exact `(D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES)` so streamed texture placements skip `CreateReservedResource` and `GetResourceTiling`. Fixes #1268. Part of #1833. **What is in it** - `crates/xcl/src/hle/d3d12x/title_textures.rs`: `forget(res)` returns the removed texture's last tracked uniform `D3D12_RESOURCE_STATES` when all subresources share a single state (`states.len() == 1`), or `None` for mixed-state / untracked textures. - `crates/xcl/src/hle/d3d12x/real.rs`: on final `Release` (`n == 0`) while `late_release` holds the last PC ref, parks eligible `place_pages` sampled textures with their actual uniform D3D12 state; exposes `note_reserved` so reused pointers re-register in `RESERVED`. - `crates/xcl/src/hle/d3d12x/late_release.rs`: once every live GPU queue is past a batch's fence, hands parked textures to `vram::recycle_ready` instead of destroying them. - `crates/xcl/src/hle/d3d12x/vram.rs`: adds `ReservedKey` and a bounded per-device `ReservedPool` (`512` idle entries/device, generation-tombstoned FIFO eviction with bounded `order` compaction, evicted entries dropped outside `PAGES.lock()`, opt-out via `XCL_RESERVED_POOL=0`). `recycle_ready` unmaps any still-mapped tiles (`pages.unmap`) on the background `late_release` thread so retired 64 MiB VRAM pool heaps never leave stale page-table references. `place_on_pages` pops matching pooled reserved textures via `QueryInterface` and reuses their cached tile count, skipping `CreateReservedResource` and `GetResourceTiling`. Adds unit tests (reuse hit, state isolation, FIFO eviction, cap=0, repeated take/repark tombstoning + cap-FIFO ordering) and a GPU recycle/rebind test. **Tested** - Windows 11 (build 26300), NVIDIA GeForce RTX 4070 SUPER (driver `32.0.16.2140`), AMD Ryzen 7 7800X3D, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC/DXIL `1.8.2502.11`. - `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`, debug) on head `2f92cc8`: **1426 passed, 0 failed, 46 ignored** across 37 test binaries, including all `hle::d3d12x::vram::tests` (`reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo`, `reserved_pool_repark_tombstones_stale_order_and_preserves_fifo`, and `reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu`). - `SKIPPED` GPU tests on this adapter (27 total): 21 `no wave64`, 3 per-lane form `#1426` refusals (`V_CVT_F16_F32`, `V_MUL_F16`, `V_PK_MUL_F16`), 1 `cannot disable the driver cache (Windows Developer Mode is required)` (`0x887A002D`), 1 `no xgameruntime.dll`, 1 `no heap windows`. - Isolated `#1268` microbenchmark on RTX 4070 SUPER (release, `2,000` iterations each): - `256x256 BC1 (9 mips)`: `CreateReservedResource + GetResourceTiling + Release` **222.33 ms (`111.17 µs/tex`)** → recycled pool **0.04 ms (`0.019 µs/tex`)** (**5,730× faster**). - `1024x1024 BC7 (11 mips)`: **279.58 ms (`139.79 µs/tex`)** → recycled pool **0.04 ms (`0.019 µs/tex`)** (**7,262× faster**). - Paired retail world-load A/B run (`XCL_DIRECT_DXIL=1`, `XCL_PSO_WAIT_MS=50`, `XCL_PRESS_A_AT=15,20,25,30,35,40,45`, isolated caches): `XCL_RESERVED_POOL=1` cleanly recycled **32+ streamed reserved textures** live before both arms hit the same pre-existing `xboxbvhbuilder.dll` 40-bit VA exception (`~112–116 s`), with `0` device removals and `-352 MB` lower peak commit (`28,903 MB` vs `29,255 MB`). **Regression run** ``` xcl-smoke v1 commit: 3f4495a2b325ae5a9df314dd86d10327502b5cf5 gpu: NVIDIA GeForce RTX 4070 SUPER title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 971 (PresentX 971) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14961 MB ``` ``` xcl-smoke v1 commit: 2f92cc841ad65e2dc7e63fea17d227a71e44f16b gpu: NVIDIA GeForce RTX 4070 SUPER title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 914 (PresentX 914) presents per 2 s (last 3): 56 54 53 device removals: 0 crashes: 0 peak commit: 15405 MB ``` **Not tested** - AMD RDNA / Intel GPUs (tested on NVIDIA RTX 4070 SUPER only; the `0.62–1.70 ms` per-texture `CreateReservedResource` stall from #1268 was measured on AMD RDNA2 and should see the largest streaming speedup there). - Extended past-world-load play under the D3D12 debug layer (the 60 s smoke run covers menus; the scripted world-load A/B run reached ~112–116 s before hitting the pre-existing `xboxbvhbuilder.dll` 40-bit VA exception). **AI use** - Antigravity (Gemini 4 Neon) for issue diagnosis, implementation, tests, benchmarking, and PR drafting; all builds, tests, benchmarks, and retail runs were executed locally on the hardware above.
Streamed sampled textures placed on shared 64 KiB video-memory pages previously called CreateReservedResource and GetResourceTiling on every placement, costing 0.6-1.7 ms per texture on AMD drivers (#1268) and ~111-140 us on NVIDIA.

Keep a bounded per-device pool (512 idle entries, FIFO eviction, opt-out via XCL_RESERVED_POOL=0) of released reserved sampled textures keyed by exact (D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES). When late_release finishes draining all live GPU queues past a texture's batch, vram::recycle_ready unmaps any still-mapped tiles on the background thread and parks the ID3D12Resource for reuse; matching place_pages calls QueryInterface on the pooled object and reuse its cached tile count, skipping CreateReservedResource and GetResourceTiling.

Fixes #1268. Part of #1833.

Assisted-by: Antigravity (Gemini 4 Neon)

# Conflicts:
#	crates/xcl/src/hle/d3d12x/vram.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:30:51 +00:00
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-25 19:00 UTC · original

Independent AMD RDNA4 (native wave64) test report on exact head e2cf9357ba193507dfbc19d4e3b040b63ee957e7 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1275 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • Both PR tests passed (no skips): hle::d3d12x::vram::tests::reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo and reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: e2cf9357ba193507dfbc19d4e3b040b63ee957e7
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1598 (PresentX 1598)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13927 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
**@⁠emirduran707** on GitHub · 2026-11-25 19:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#issuecomment-7171688509) Independent AMD RDNA4 (native wave64) test report on exact head `e2cf9357ba193507dfbc19d4e3b040b63ee957e7` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1275 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - Both PR tests passed (no skips): `hle::d3d12x::vram::tests::reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo` and `reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: e2cf9357ba193507dfbc19d4e3b040b63ee957e7 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1598 (PresentX 1598) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13927 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 19:46 UTC · original

gpu_ suite (cold cache): 160 passed / 4 failed, no crashes. Three are the known baseline trio on this lane; the fourth is gpu_promoted_uav_clear_values_pass_create_committed_resource, newly red on main since #2280 (report), unrelated to this PR.
Targeted run of reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo: passed (the gpu-side recycle test ran inside the suite).

**@⁠SlopTart** on GitHub · 2026-11-25 19:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#issuecomment-7172746483) `gpu_` suite (cold cache): 160 passed / 4 failed, no crashes. Three are the known baseline trio on this lane; the fourth is `gpu_promoted_uav_clear_values_pass_create_committed_resource`, newly red on main since #2280 ([report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2280)), unrelated to this PR. Targeted run of `reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo`: passed (the gpu-side recycle test ran inside the suite).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 20:04 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 20:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#issuecomment-7173153125) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1219/1): ``` gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier assertion failed: group barriers in the program (lower_dxil.rs:1155) ``` The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin
Author
Owner

@⁠saintwolf on GitHub · 2026-11-25 20:28 UTC · original

@⁠bmjask Good catch — fixed in 2f92cc8 (also rebased onto main 6d12f58, picking up #2420 so the full workspace suite passes with 0 failures — cc @⁠DavidM1911):

  • ReservedPool now tracks a monotonic next_gen: u64 and live_gen: HashMap<usize, u64> with generation-tagged order / by_key entries.
  • take() removes the pointer from live_gen (immediately tombstoning any stale order entry) and calls compact_order(), which prunes front tombstones and compacts order whenever order.len() > max(2 * live, 16) so repeated take/repark cycles below cap cannot accumulate unbounded stale entries.
  • push() skips tombstoned generations during cap eviction so a reparked pointer is ordered strictly by its current parking time.
  • Added reserved_pool_repark_tombstones_stale_order_and_preserves_fifo covering 100× below-cap take/repark cycles behind an idle front entry, cap=2 repark FIFO ordering, and cap=3 non-front tombstone skipping.
**@⁠saintwolf** on GitHub · 2026-11-25 20:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#issuecomment-7173734494) @⁠bmjask Good catch — fixed in `2f92cc8` (also rebased onto `main` `6d12f58`, picking up #2420 so the full workspace suite passes with 0 failures — cc @⁠DavidM1911): - `ReservedPool` now tracks a monotonic `next_gen: u64` and `live_gen: HashMap<usize, u64>` with generation-tagged `order` / `by_key` entries. - `take()` removes the pointer from `live_gen` (immediately tombstoning any stale `order` entry) and calls `compact_order()`, which prunes front tombstones and compacts `order` whenever `order.len() > max(2 * live, 16)` so repeated take/repark cycles below cap cannot accumulate unbounded stale entries. - `push()` skips tombstoned generations during cap eviction so a reparked pointer is ordered strictly by its current parking time. - Added `reserved_pool_repark_tombstones_stale_order_and_preserves_fifo` covering 100× below-cap take/repark cycles behind an idle front entry, cap=2 repark FIFO ordering, and cap=3 non-front tombstone skipping.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 22:10 UTC · original

Independent AMD report for 2f92cc841ad65e2dc7e63fea17d227a71e44f16b.

Tested

  • AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 build 26200, rustc 1.100.0, debug profile, DXC from Windows SDK 10.0.26100.0, XCL_ADAPTER=radeon. Exact PR head (not a local merge onto main); main at the time was 6d12f58a.
  • cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4: 1425 passed, 1 failed, 46 ignored. The one failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff); it fails identically on main 6d12f58a on this adapter (cargo test -p xcl --lib fuzz_validate_and_gpu_1), so it is not caused by this PR.
  • 7 SKIPPED lines: 6 f16_programs_on_the_gpu / f32_programs_on_the_gpu per-lane cases refused for V_MUL_F16, V_PK_MUL_F16 or V_CVT_F16_F32, and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • The new vram::tests::reserved_pool_* and reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu (GPU) passed.

Not tested

  • scripts/smoke.ps1 / a retail title (no regression run), other adapters, NVIDIA. No game data was used.

AI use

Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included.

**@⁠oni-swr** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#issuecomment-7176020697) Independent AMD report for `2f92cc841ad65e2dc7e63fea17d227a71e44f16b`. **Tested** - AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 build 26200, rustc 1.100.0, debug profile, DXC from Windows SDK 10.0.26100.0, `XCL_ADAPTER=radeon`. Exact PR head (not a local merge onto `main`); main at the time was `6d12f58a`. - `cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4`: 1425 passed, 1 failed, 46 ignored. The one failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722: `res[30] = 0x1, CPU 0x7fffffff`); it fails identically on `main` `6d12f58a` on this adapter (`cargo test -p xcl --lib fuzz_validate_and_gpu_1`), so it is not caused by this PR. - 7 SKIPPED lines: 6 `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu` per-lane cases refused for `V_MUL_F16`, `V_PK_MUL_F16` or `V_CVT_F16_F32`, and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - The new `vram::tests::reserved_pool_*` and `reserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu` (GPU) passed. **Not tested** - `scripts/smoke.ps1` / a retail title (no regression run), other adapters, NVIDIA. No game data was used. **AI use** Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included.
Author
Owner

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

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

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

Thanks!

— Devin

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

@⁠bmjask on GitHub · 2026-11-25 20:19 UTC · original · reviewed

P2: ReservedPool::take at vram.rs:196-204 removes an entry from by_key/live but does not remove or invalidate its matching VecDeque entry in order. Every reuse/repark adds another order entry (:225-227), so a pool below cap accumulates stale entries indefinitely. At cap, a stale entry can match a reparked pointer and evict it by its original rather than current parking time, violating the intended bounded FIFO behavior. The test takes entries only once and misses reuse->repark cycles. Please tombstone/remove by generation on take and add a repeated recycle/repark plus cap-FIFO test.

**@⁠bmjask** on GitHub · 2026-11-25 20:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#pullrequestreview-6064368397) · **reviewed** P2: ReservedPool::take at vram.rs:196-204 removes an entry from by_key/live but does not remove or invalidate its matching VecDeque entry in order. Every reuse/repark adds another order entry (:225-227), so a pool below cap accumulates stale entries indefinitely. At cap, a stale entry can match a reparked pointer and evict it by its original rather than current parking time, violating the intended bounded FIFO behavior. The test takes entries only once and misses reuse->repark cycles. Please tombstone/remove by generation on take and add a repeated recycle/repark plus cap-FIFO test.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 07:43 UTC · original · reviewed

vram.rs:1177–1185: this returns the same native ID3D12Resource for a new texture without clearing its ID3D12Object private data. If a title sets a custom GUID payload on eligible sampled texture A, releases/drains A into this pool, and creates matching texture B, GetPrivateData on B can return A's payload. SetPrivateDataInterface also retains its attached COM reference until that native object is destroyed or the same GUID is overwritten (Microsoft's lifetime contract), so pooling can carry that ownership across apparent texture lifetimes. The pool key covers description/state, and I do not see setter tracking or a private-data reset on reuse.

Could a resource with application private data be excluded from reuse, or its tracked GUIDs be cleared before it is handed to B? A focused test could tag A with a custom GUID and confirm B behaves like a fresh resource. This is source/API-contract review at exact head 2f92cc841ad65e2dc7e63fea17d227a71e44f16b; I have not run the native reuse fixture or observed a title using custom private data. AI-assisted review with Codex.

**@⁠luckyteagirl** on GitHub · 2026-11-26 07:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2436#pullrequestreview-6070202590) · **reviewed** `vram.rs:1177–1185`: this returns the *same* native `ID3D12Resource` for a new texture without clearing its `ID3D12Object` private data. If a title sets a custom GUID payload on eligible sampled texture A, releases/drains A into this pool, and creates matching texture B, `GetPrivateData` on B can return A's payload. `SetPrivateDataInterface` also retains its attached COM reference until that native object is destroyed or the same GUID is overwritten ([Microsoft's lifetime contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12object-setprivatedatainterface)), so pooling can carry that ownership across apparent texture lifetimes. The pool key covers description/state, and I do not see setter tracking or a private-data reset on reuse. Could a resource with application private data be excluded from reuse, or its tracked GUIDs be cleared before it is handed to B? A focused test could tag A with a custom GUID and confirm B behaves like a fresh resource. This is source/API-contract review at exact head `2f92cc841ad65e2dc7e63fea17d227a71e44f16b`; I have not run the native reuse fixture or observed a title using custom private data. AI-assisted review with Codex.
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/2436/head:github-bot/gh-2436'
git switch 'github-bot/gh-2436'

Merge

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