D3D12.X: drop shared heap locks during CopyDescriptorsSimple and clamp publish_range to heap bounds #2621

Closed
Decodere wants to merge 1 commit from upstream-pr/2631 into main
Decodere commented 2026-11-26 03:19:52 +00:00 (Migrated from github.com)

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


What is in it

Drops shared descriptor-heap locks (GLOBAL / GLOBAL_SAMPLER / HEAPS) before calling ID3D12Device::CopyDescriptorsSimple on the hot descriptor publish path, clamps publish_range strictly to each heap's bounds, and defers recycling of in-flight destination ranges until copies complete (crates/xcl/src/hle/d3d12x/console_heap.rs):

  1. publish(s, uav): snapshots dev from GLOBAL_SAMPLER (or (dev, inc) from GLOBAL), records a zero-allocation SingleLease on the destination slot (dst_base..dst_base + 1) under that lock, and drops the mutex guard before calling CopyDescriptorsSimple, avoiding global lock serialization across D3D12 device calls and re-entrancy hazards with adopted device hooks.
  2. publish_range(first, n): returns early on n == 0; acquires HEAPS first and then GLOBAL_SAMPLER / GLOBAL (preserving the strict HEAPS -> GLOBAL* lock order); collects (dst, src, count) runs in a single HEAPS pass clamping each run to h.n - start_k and page boundaries (preventing overruns past tightly sized small/tail pages into adjacent shared-heap ranges, with a standalone synthetic Slot fallback when not registered in HEAPS); registers destination run leases in RangeLease under GLOBAL* while still holding HEAPS so a concurrent unregister() cannot recycle those destination ranges before leases are recorded; drops both locks and executes every CopyDescriptorsSimple call with zero locks held.
  3. Non-blocking deferred release (LeasePool): Global and GlobalSampler track active destination leases (leased) and ranges freed while leased (deferred). release_global / release_global_sampler defer any released range overlapping an active lease without blocking unregister(), and dropping SingleLease / RangeLease immediately promotes newly unblocked deferred ranges back into free (coalesced).
  4. Tests: adds three subprocess-isolated mock-COM unit tests (vt[24] = CopyDescriptorsSimple, zero GPU/UMA required):
    • publish_and_publish_range_do_not_hold_locks_during_device_calls: asserts GLOBAL, GLOBAL_SAMPLER, and HEAPS are unlocked during CopyDescriptorsSimple for single publish (SRV, UAV, Sampler) and multi-page publish_range (views and samplers), and checks exact descriptor counts and CPU handles.
    • publish_range_clamps_to_heap_bounds_without_overrunning_tail_pages: registers a 4-slot view heap, a 3-slot sampler heap, and a 260-slot view heap (4-slot tail page) and verifies publish_range extending past h.n clamps strictly to h.n - start_k with zero overrun (n == 0 emits zero calls).
    • publish_leases_prevent_unregister_range_reuse_while_copy_in_flight: blocks a worker thread inside mock CopyDescriptorsSimple for single publish, multi-page view publish_range, and sampler publish_range while the main thread calls unregister + reserve_global*, verifying zero overlap with the in-flight destination range, verifying all locks stay unlocked during CopyDescriptorsSimple, and verifying full slot reclamation as soon as the copy finishes.

Part of #2508
Part of #1833

Tested

  • Failing-first check on unmodified origin/main (b49be183) with the lock-free/bounds tests (cargo test -p xcl --lib hle::d3d12x::console_heap::tests::publish_ -- --test-threads=1 --nocapture): 0 passed, 2 failed (CopyDescriptorsSimple ran while GLOBAL, GLOBAL_SAMPLER, or HEAPS was locked; publish_range overran tail pages with 20 vs 6, 7 vs 2, and 28 vs 8 descriptors).
  • Post-fix targeted debug tests on WARP (XCL_ADAPTER=warp, XCL_WARP=1, cargo test -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture): 15 passed, 0 failed, 0 ignored, 0 skipped.
  • Post-fix targeted release tests on WARP (XCL_ADAPTER=warp, XCL_WARP=1, cargo test --release -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture): 15 passed, 0 failed, 0 ignored, 0 skipped.
  • Post-fix targeted release tests on NVIDIA GeForce RTX 4060 (cargo test --release -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture): 15 passed, 0 failed, 0 ignored, 0 skipped.
  • Full release workspace on NVIDIA GeForce RTX 4060 (cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture): 37 test binaries (36 compiled + 1 doc-test), 1438 passed, 0 failed, 47 ignored, 29 SKIPPED lines:
    • 21 no wave64 on wave32-only RTX 4060 (dispatch_chain_native_wave64_builds_whole, 4 in gpu::recomp::lower, 14 in gpu::recomp::lower_dxil, 2 in gpu::recomp::tests)
    • 3 per-lane form: refused in gpu::recomp::lower_dxil (f16 arithmetic, f16 packed, f32 conversions on wave32)
    • 3 D3D12 debug layer unavailable (no d3d12SDKLayers.dll x2, uploads_start_from_each_subresources_state)
    • 1 cannot disable the driver cache (shaders::tests::pso_measurement_compiles_an_exact_synthetic_record)
    • 1 no heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form)

Regression run

Paired 60-second smoke runs on NVIDIA GeForce RTX 4060 against origin/main ancestor (889ef3e8aa7f267323ab4879e735e65da6bcef10, ancestor of b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):

PR head:

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

Base (origin/main ancestor):

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

Both runs exit 0x0 with steady 60 60 60 presents per 2 s, 0 device removals, and 0 crashes (1518 vs 1550 frames, 97.9%; peak commit 14001 MB vs 13981 MB).

Not tested

  • Native wave64 GPU hardware tests (RTX 4060 is wave32-only; 21 wave64 GPU tests skipped).
  • D3D12 debug-layer tests (d3d12SDKLayers.dll is not installed on this host; 3 tests skipped).
  • Multi-threaded live contention benchmark on CopyDescriptorsSimple (lock-release and unregister-lease behavior are verified deterministically via synchronized mock ID3D12Device::CopyDescriptorsSimple callbacks).
  • The 47 #[ignore] tests.

AI use

Written and verified with Google Antigravity (Gemini 4 Neon). Every change in console_heap.rs, the failing-first reproducer, the debug/release WARP, RTX 4060, and full workspace test runs, and the paired 60 s smoke runs were verified locally.

<!-- greyfinch-sync:ivall/xcl:issue:5503381306 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T03:19:52Z. --- **What is in it** Drops shared descriptor-heap locks (`GLOBAL` / `GLOBAL_SAMPLER` / `HEAPS`) before calling `ID3D12Device::CopyDescriptorsSimple` on the hot descriptor publish path, clamps `publish_range` strictly to each heap's bounds, and defers recycling of in-flight destination ranges until copies complete (`crates/xcl/src/hle/d3d12x/console_heap.rs`): 1. **`publish(s, uav)`:** snapshots `dev` from `GLOBAL_SAMPLER` (or `(dev, inc)` from `GLOBAL`), records a zero-allocation `SingleLease` on the destination slot (`dst_base..dst_base + 1`) under that lock, and drops the mutex guard before calling `CopyDescriptorsSimple`, avoiding global lock serialization across D3D12 device calls and re-entrancy hazards with adopted device hooks. 2. **`publish_range(first, n)`:** returns early on `n == 0`; acquires `HEAPS` first and then `GLOBAL_SAMPLER` / `GLOBAL` (preserving the strict `HEAPS -> GLOBAL*` lock order); collects `(dst, src, count)` runs in a single `HEAPS` pass clamping each run to `h.n - start_k` and page boundaries (preventing overruns past tightly sized small/tail pages into adjacent shared-heap ranges, with a standalone synthetic `Slot` fallback when not registered in `HEAPS`); registers destination run leases in `RangeLease` under `GLOBAL*` while still holding `HEAPS` so a concurrent `unregister()` cannot recycle those destination ranges before leases are recorded; drops both locks and executes every `CopyDescriptorsSimple` call with zero locks held. 3. **Non-blocking deferred release (`LeasePool`):** `Global` and `GlobalSampler` track active destination leases (`leased`) and ranges freed while leased (`deferred`). `release_global` / `release_global_sampler` defer any released range overlapping an active lease without blocking `unregister()`, and dropping `SingleLease` / `RangeLease` immediately promotes newly unblocked deferred ranges back into `free` (coalesced). 4. **Tests:** adds three subprocess-isolated mock-COM unit tests (`vt[24] = CopyDescriptorsSimple`, zero GPU/UMA required): - `publish_and_publish_range_do_not_hold_locks_during_device_calls`: asserts `GLOBAL`, `GLOBAL_SAMPLER`, and `HEAPS` are unlocked during `CopyDescriptorsSimple` for single `publish` (SRV, UAV, Sampler) and multi-page `publish_range` (views and samplers), and checks exact descriptor counts and CPU handles. - `publish_range_clamps_to_heap_bounds_without_overrunning_tail_pages`: registers a 4-slot view heap, a 3-slot sampler heap, and a 260-slot view heap (4-slot tail page) and verifies `publish_range` extending past `h.n` clamps strictly to `h.n - start_k` with zero overrun (`n == 0` emits zero calls). - `publish_leases_prevent_unregister_range_reuse_while_copy_in_flight`: blocks a worker thread inside mock `CopyDescriptorsSimple` for single `publish`, multi-page view `publish_range`, and sampler `publish_range` while the main thread calls `unregister` + `reserve_global*`, verifying zero overlap with the in-flight destination range, verifying all locks stay unlocked during `CopyDescriptorsSimple`, and verifying full slot reclamation as soon as the copy finishes. Part of #2508 Part of #1833 **Tested** - Failing-first check on unmodified `origin/main` (`b49be183`) with the lock-free/bounds tests (`cargo test -p xcl --lib hle::d3d12x::console_heap::tests::publish_ -- --test-threads=1 --nocapture`): 0 passed, 2 failed (`CopyDescriptorsSimple ran while GLOBAL, GLOBAL_SAMPLER, or HEAPS was locked`; `publish_range` overran tail pages with 20 vs 6, 7 vs 2, and 28 vs 8 descriptors). - Post-fix targeted debug tests on WARP (`XCL_ADAPTER=warp`, `XCL_WARP=1`, `cargo test -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture`): 15 passed, 0 failed, 0 ignored, 0 skipped. - Post-fix targeted release tests on WARP (`XCL_ADAPTER=warp`, `XCL_WARP=1`, `cargo test --release -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture`): 15 passed, 0 failed, 0 ignored, 0 skipped. - Post-fix targeted release tests on NVIDIA GeForce RTX 4060 (`cargo test --release -p xcl --lib -- hle::d3d12x::console_heap::tests:: --nocapture`): 15 passed, 0 failed, 0 ignored, 0 skipped. - Full release workspace on NVIDIA GeForce RTX 4060 (`cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture`): 37 test binaries (36 compiled + 1 doc-test), 1438 passed, 0 failed, 47 ignored, 29 `SKIPPED` lines: - 21 `no wave64` on wave32-only RTX 4060 (`dispatch_chain_native_wave64_builds_whole`, 4 in `gpu::recomp::lower`, 14 in `gpu::recomp::lower_dxil`, 2 in `gpu::recomp::tests`) - 3 `per-lane form: refused` in `gpu::recomp::lower_dxil` (f16 arithmetic, f16 packed, f32 conversions on wave32) - 3 D3D12 debug layer unavailable (`no d3d12SDKLayers.dll` x2, `uploads_start_from_each_subresources_state`) - 1 `cannot disable the driver cache` (`shaders::tests::pso_measurement_compiles_an_exact_synthetic_record`) - 1 `no heap windows` (`heap_window_out_of_memory_falls_back_to_the_switch_form`) **Regression run** Paired 60-second smoke runs on NVIDIA GeForce RTX 4060 against `origin/main` ancestor (`889ef3e8aa7f267323ab4879e735e65da6bcef10`, ancestor of `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`): PR head: ``` xcl-smoke v1 commit: 40a9bcc980215f2619981875f1ca9de66bd7734a gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1519) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14001 MB ``` Base (`origin/main` ancestor): ``` xcl-smoke v1 commit: 889ef3e8aa7f267323ab4879e735e65da6bcef10 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1550 (PresentX 1550) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13981 MB ``` Both runs exit `0x0` with steady `60 60 60` presents per 2 s, 0 device removals, and 0 crashes (1518 vs 1550 frames, 97.9%; peak commit 14001 MB vs 13981 MB). **Not tested** - Native wave64 GPU hardware tests (RTX 4060 is wave32-only; 21 wave64 GPU tests skipped). - D3D12 debug-layer tests (`d3d12SDKLayers.dll` is not installed on this host; 3 tests skipped). - Multi-threaded live contention benchmark on `CopyDescriptorsSimple` (lock-release and unregister-lease behavior are verified deterministically via synchronized mock `ID3D12Device::CopyDescriptorsSimple` callbacks). - The 47 `#[ignore]` tests. **AI use** Written and verified with Google Antigravity (Gemini 4 Neon). Every change in `console_heap.rs`, the failing-first reproducer, the debug/release WARP, RTX 4060, and full workspace test runs, and the paired 60 s smoke runs were verified locally.
pickles976 commented 2026-11-26 04:07:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T03:29:50Z.


Exact PR head 3b49f094ec06e7f7a8c1f6d085b42f62382390bf, Windows-target Wine 11.0/vkd3d-proton 3.2.0 on a 16 GiB RTX 4060 Laptop host: focused hle::d3d12x::console_heap::tests::publish_ 2/2 passed, 0 skipped/ignored, after a confirmed fresh compile from the clean head checkout. The mock-COM callback observed all three shared heap locks released for both single and multi-page CopyDescriptorsSimple, and the tightly sized view/sampler/tail heap cases clamped exactly to the heap ends. Log: .compat-xcl/logs/verify-pr2631-wine-rtx4060-descriptor-publish.log (not attached).

These are CPU/mock-device fixtures: the actual NVIDIA GPU was not exercised by the tests, and I have no matched parent run or live title contention/frame-time data on this laptop. The existing stock-vkd3d console-facing in-place D3D12 object/root-signature assertion (#175) still blocks a safe XCL retail-title comparison on this host; this positive result does not imply that blocker or our 16 GiB world-load limit is solved.

<!-- greyfinch-sync:ivall/xcl:comment:7181769845 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7181769845). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T03:29:50Z. --- Exact PR head `3b49f094ec06e7f7a8c1f6d085b42f62382390bf`, Windows-target Wine 11.0/vkd3d-proton 3.2.0 on a 16 GiB RTX 4060 **Laptop** host: focused `hle::d3d12x::console_heap::tests::publish_` **2/2 passed**, 0 skipped/ignored, after a confirmed fresh compile from the clean head checkout. The mock-COM callback observed all three shared heap locks released for both single and multi-page `CopyDescriptorsSimple`, and the tightly sized view/sampler/tail heap cases clamped exactly to the heap ends. Log: `.compat-xcl/logs/verify-pr2631-wine-rtx4060-descriptor-publish.log` (not attached). These are CPU/mock-device fixtures: the actual NVIDIA GPU was **not exercised by the tests**, and I have no matched parent run or live title contention/frame-time data on this laptop. The existing stock-vkd3d console-facing in-place D3D12 object/root-signature assertion (#175) still blocks a safe XCL retail-title comparison on this host; this positive result does not imply that blocker or our 16 GiB world-load limit is solved.
luckyteagirl commented 2026-11-26 04:38:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T04:38:52Z.

Review: COMMENTED


The new publish() snapshots GLOBAL and releases its lock before CopyDescriptorsSimple; publish_range() likewise collects shared destination handles and releases HEAPS before its copy loop. unregister() can then remove that title heap and immediately return its shared ranges through release_global, where a new heap can reserve the same indices. Interleaving: T1 captures a destination, T2 unregisters the old heap, T3 reserves its freed range, then T1's delayed copy overwrites T3's descriptors. The previous copy under GLOBAL prevented that particular reuse until the copy finished. Could these destination ranges be leased until their copies complete, while keeping the device call outside the locks? A mock callback test that blocks a copy while another thread unregisters and reallocates the range would cover it. This is a source-derived concurrency point; I did not run a title or test this interleaving.

<!-- greyfinch-sync:ivall/xcl:review:6068624469 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#pullrequestreview-6068624469). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T04:38:52Z. **Review:** COMMENTED --- The new `publish()` snapshots `GLOBAL` and releases its lock before `CopyDescriptorsSimple`; `publish_range()` likewise collects shared destination handles and releases `HEAPS` before its copy loop. `unregister()` can then remove that title heap and immediately return its shared ranges through `release_global`, where a new heap can reserve the same indices. Interleaving: T1 captures a destination, T2 unregisters the old heap, T3 reserves its freed range, then T1's delayed copy overwrites T3's descriptors. The previous copy under `GLOBAL` prevented that particular reuse until the copy finished. Could these destination ranges be leased until their copies complete, while keeping the device call outside the locks? A mock callback test that blocks a copy while another thread unregisters and reallocates the range would cover it. This is a source-derived concurrency point; I did not run a title or test this interleaving.
Decodere commented 2026-11-26 06:06:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T05:59:50Z.


@luckyteagirl Good catch — pushed 40a9bcc9 to prevent unregister() / release_global*() from recycling destination descriptor ranges while a lock-free CopyDescriptorsSimple is in flight:

  • Global and GlobalSampler now track active destination leases and deferred releases (LeasePool): publish takes a zero-allocation SingleLease under GLOBAL*, and publish_range takes a RangeLease under GLOBAL* while still holding HEAPS (preserving strict HEAPS -> GLOBAL* lock order) before dropping both locks for CopyDescriptorsSimple.
  • release_global / release_global_sampler defer ranges overlapping an active lease without blocking unregister(), and dropping the RAII lease guard promotes unblocked ranges back into free.
  • Added publish_leases_prevent_unregister_range_reuse_while_copy_in_flight verifying single publish, multi-page view publish_range, and sampler publish_range hold off reuse during concurrent unregister() + reserve_global*(), keep all locks unlocked during CopyDescriptorsSimple, and reclaim the slots once the copy finishes.
  • Re-verified debug/release WARP & RTX 4060 console_heap::tests:: (15/0/0), full release workspace (1438/0/47), and paired 60 s RTX 4060 smoke (1518 frames, 60 60 60, 0 removals/crashes).
<!-- greyfinch-sync:ivall/xcl:comment:7183994811 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7183994811). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T05:59:50Z. --- @luckyteagirl Good catch — pushed `40a9bcc9` to prevent `unregister()` / `release_global*()` from recycling destination descriptor ranges while a lock-free `CopyDescriptorsSimple` is in flight: - `Global` and `GlobalSampler` now track active destination leases and deferred releases (`LeasePool`): `publish` takes a zero-allocation `SingleLease` under `GLOBAL*`, and `publish_range` takes a `RangeLease` under `GLOBAL*` while still holding `HEAPS` (preserving strict `HEAPS -> GLOBAL*` lock order) before dropping both locks for `CopyDescriptorsSimple`. - `release_global` / `release_global_sampler` defer ranges overlapping an active lease without blocking `unregister()`, and dropping the RAII lease guard promotes unblocked ranges back into `free`. - Added `publish_leases_prevent_unregister_range_reuse_while_copy_in_flight` verifying single `publish`, multi-page view `publish_range`, and sampler `publish_range` hold off reuse during concurrent `unregister()` + `reserve_global*()`, keep all locks unlocked during `CopyDescriptorsSimple`, and reclaim the slots once the copy finishes. - Re-verified debug/release WARP & RTX 4060 `console_heap::tests::` (`15/0/0`), full release workspace (`1438/0/47`), and paired 60 s RTX 4060 smoke (`1518` frames, `60 60 60`, `0` removals/crashes).
Aniseto commented 2026-11-26 11:05:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-26T10:25:37Z.


Ran the descriptor-heap publish tests at 40a9bcc9:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --lib hle::d3d12x::console_heap::tests::publish_ -- --test-threads=1 --nocapture
3 passed; 0 failed; 0 ignored; 1336 filtered out      (exit 0)

All three new subprocess-isolated tests pass here: no heap locks held during CopyDescriptorsSimple, publish_range clamped to the registered heap bounds, and leases preventing unregister from recycling an in-flight destination range. They use a mock COM device, so they do not measure NVIDIA GPU performance.

What this adds: the author ran the targeted tests on WARP and an RTX 4060; this is a second NVIDIA host (Blackwell, different driver/DXC). The thread has no report from another machine.

Not tested: a live multi-threaded contention benchmark, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7189349965 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7189349965). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-26T10:25:37Z. --- Ran the descriptor-heap publish tests at `40a9bcc9`: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=nvidia cargo test -p xcl --lib hle::d3d12x::console_heap::tests::publish_ -- --test-threads=1 --nocapture 3 passed; 0 failed; 0 ignored; 1336 filtered out (exit 0) ``` All three new subprocess-isolated tests pass here: no heap locks held during `CopyDescriptorsSimple`, `publish_range` clamped to the registered heap bounds, and leases preventing `unregister` from recycling an in-flight destination range. They use a mock COM device, so they do not measure NVIDIA GPU performance. What this adds: the author ran the targeted tests on WARP and an RTX 4060; this is a second NVIDIA host (Blackwell, different driver/DXC). The thread has no report from another machine. Not tested: a live multi-threaded contention benchmark, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, title data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
github-actions[bot] commented 2026-12-01 02:33:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:50Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298750827 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7298750827). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:33:50Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:30:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:30:53Z.


Triage (#1607) – head 40a9bcc

main already does what this PR does in console_heap.rs. Commit 1229ce4 makes publish lease the destination slot and call CopyDescriptorsSimple with no lock held. Commit fab5da1 does the same for publish_range: it builds the page runs under HEAPS, takes leases under GLOBAL*, copies outside the locks, and stops at the heap end with limit = n.min(first.remaining).min(h.n - first.k). Ranges released while a copy is running are held back until it ends (PublishLeases::release_range / finish_ranges), which is this PR's LeasePool under another name. main also checks the heap generation and source handle, which this PR does not. The branch conflicts with main.
Recommendation: close (superseded by main commits 1229ce4 and fab5da1).

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

<!-- greyfinch-sync:ivall/xcl:comment:7305419154 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7305419154). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:30:53Z. --- **Triage (#1607)** – head 40a9bcc main already does what this PR does in `console_heap.rs`. Commit 1229ce4 makes `publish` lease the destination slot and call `CopyDescriptorsSimple` with no lock held. Commit fab5da1 does the same for `publish_range`: it builds the page runs under `HEAPS`, takes leases under `GLOBAL*`, copies outside the locks, and stops at the heap end with `limit = n.min(first.remaining).min(h.n - first.k)`. Ranges released while a copy is running are held back until it ends (`PublishLeases::release_range` / `finish_ranges`), which is this PR's `LeasePool` under another name. main also checks the heap generation and source handle, which this PR does not. The branch conflicts with main. Recommendation: close (superseded by main commits 1229ce4 and fab5da1). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:55:52 +00:00 (Migrated from github.com)

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


Closing as superseded: this change is already on main (1229ce4). main has PublishLeases/PublishLease/PublishRangeLease with deferred release (console_heap.rs) so publish and publish_range run outside the heap locks, and publish_range clamps to the heap end (limit = n.min(first.remaining).min(h.n - first.k)) with tests publish_calls_run_unlocked_and_hold_generation_and_ranges and publish_range_stops_at_small_and_tail_heap_bounds (fab5da1)

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311855587 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2631#issuecomment-7311855587). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:55:52Z. --- Closing as superseded: this change is already on `main` (1229ce4). main has PublishLeases/PublishLease/PublishRangeLease with deferred release (console_heap.rs) so publish and publish_range run outside the heap locks, and publish_range clamps to the heap end (limit = n.min(first.remaining).min(h.n - first.k)) with tests publish_calls_run_unlocked_and_hold_generation_and_ranges and publish_range_stops_at_small_and_tail_heap_bounds (fab5da1) Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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

No due date set.

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