D3D12.X: merge released ranges of the shared descriptor heap #834

Closed
mastrr9 wants to merge 1 commit from upstream-pr/840 into main
mastrr9 commented 2026-11-24 06:39:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T06:39:45Z.


Keeps GLOBAL.free in console_heap.rs sorted, coalesces adjacent released ranges in give_back(), and reclaims trailing free ranges back into next (switching take_range() from swap_remove to remove to preserve order).

  • Previously, release_global() pushed released ranges onto free without coalescing or shrinking next, so creating and destroying descriptor heaps over a session fragmented the shared heap until larger contiguous page allocations failed even when enough total descriptors were free.
  • Adds unit test released_shared_ranges_merge verifying full reclamation, out-of-order releases interleaved with small allocations, and bridging two adjacent free ranges.

Tested

  • Hardware/OS: NVIDIA RTX 5080 (driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC debug, DXC Windows SDK 10.0.26100.0, d3d12SDKLayers.dll installed
  • Commit tested: 20795afd9f6c9ed7ca01cb4b9f4b23b829b99fc1
  • cargo build --workspace: clean (only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (new test hle::d3d12x::console_heap::tests::released_shared_ranges_merge passed)
  • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64

Not tested

  • Retail title regression run (scripts/smoke.ps1) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run.

AI use

  • Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
<!-- greyfinch-sync:ivall/xcl:issue:6576192121 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/840). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T06:39:45Z. --- Keeps `GLOBAL.free` in `console_heap.rs` sorted, coalesces adjacent released ranges in `give_back()`, and reclaims trailing free ranges back into `next` (switching `take_range()` from `swap_remove` to `remove` to preserve order). - Previously, `release_global()` pushed released ranges onto `free` without coalescing or shrinking `next`, so creating and destroying descriptor heaps over a session fragmented the shared heap until larger contiguous page allocations failed even when enough total descriptors were free. - Adds unit test `released_shared_ranges_merge` verifying full reclamation, out-of-order releases interleaved with small allocations, and bridging two adjacent free ranges. **Tested** - Hardware/OS: NVIDIA RTX 5080 (driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC debug, DXC Windows SDK `10.0.26100.0`, `d3d12SDKLayers.dll` installed - Commit tested: `20795afd9f6c9ed7ca01cb4b9f4b23b829b99fc1` - `cargo build --workspace`: clean (only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **714 passed, 0 failed, 41 ignored** (new test `hle::d3d12x::console_heap::tests::released_shared_ranges_merge` passed) - `SKIPPED` GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` **Not tested** - Retail title regression run (`scripts/smoke.ps1`) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run. **AI use** - Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
futurepro62 commented 2026-11-24 07:06:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T07:06:21Z.


Full-suite run, since this PR has no test report yet. Tested exact head 20795af (on its base beaa245).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: released_shared_ranges_merge.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7124621562 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/840#issuecomment-7124621562). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T07:06:21Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `20795af` (on its base `beaa245`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **714 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `released_shared_ranges_merge`. **Not tested** - AMD, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
SlopTart commented 2026-11-24 08:03:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T07:17:49Z.


Linux / AMD RDNA3 datapoint.

Merged state: head 20795af onto main a1672ef, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 705 passed, 11 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Descriptor-heap range merge tests green on RDNA3; no new failures.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

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

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

<!-- greyfinch-sync:ivall/xcl:comment:7124834263 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/840#issuecomment-7124834263). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T07:17:49Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `20795af` onto main `a1672ef`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **705 passed, 11 failed, 41 ignored**. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Descriptor-heap range merge tests green on RDNA3; no new failures. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
CuteBooty commented 2026-11-24 21:09:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T19:41:33Z.


Regression run on a retail title for feacb14: pass (no device removal, no crash, frames and peak commit within the check's limits).

Tested

  • RTX 3070 8 GB (32-lane waves), NVIDIA 621.24; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build.
  • scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and on main beaa245, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. The main block is shared with my reports on other PRs of the same base.

main:

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: NVIDIA GeForce RTX 3070
title: game
seconds: 60
exit: 0x0
frames shown: 1466 (PresentX 1466)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15248 MB

this PR:

xcl-smoke v1
commit: feacb14207928339a31e01cc8841c9b0c06140a3
gpu: NVIDIA GeForce RTX 3070
title: game
seconds: 60
exit: 0x0
frames shown: 1549 (PresentX 1549)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15440 MB

Not tested

  • Whether the 60 s reach the code this PR changes, the world load, the test suite, current main merged in, AMD and Intel GPUs.

AI use

  • Claude Code (Claude Opus 5.5) made the runs with me present and wrote this from the script's output.
<!-- greyfinch-sync:ivall/xcl:comment:7142454906 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/840#issuecomment-7142454906). Originally posted by [CuteBooty](https://github.com/CuteBooty) on 2026-11-24T19:41:33Z. --- Regression run on a retail title for `feacb14`: **pass** (no device removal, no crash, frames and peak commit within the check's limits). **Tested** - RTX 3070 8 GB (32-lane waves), NVIDIA 621.24; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build. - `scripts\smoke.ps1 -Game <folder> -Seconds 60`, no input, on this PR's head as it is and on `main` `beaa245`, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. The `main` block is shared with my reports on other PRs of the same base. main: ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: NVIDIA GeForce RTX 3070 title: game seconds: 60 exit: 0x0 frames shown: 1466 (PresentX 1466) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15248 MB ``` this PR: ``` xcl-smoke v1 commit: feacb14207928339a31e01cc8841c9b0c06140a3 gpu: NVIDIA GeForce RTX 3070 title: game seconds: 60 exit: 0x0 frames shown: 1549 (PresentX 1549) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15440 MB ``` **Not tested** - Whether the 60 s reach the code this PR changes, the world load, the test suite, current `main` merged in, AMD and Intel GPUs. **AI use** - Claude Code (Claude Opus 5.5) made the runs with me present and wrote this from the script's output.
JJAutoCompare commented 2026-11-25 06:06:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:57:23Z.


Empirical test report (feacb142)

Verified xcl-dev/xcl PR #840 at commit feacb14207928339a31e01cc8841c9b0c06140a3 in a clean detached worktree.

Hardware / environment

Windows x64 build 26200.0 on an AMD Family 23 Model 113 CPU with 12 logical processors available to the process. Rust was rustc 1.100.0 (0ef1bc386 2026-11-09) for x86_64-pc-windows-msvc. DXC reported 1.9.2609.5 (01b62ad47). The workspace used the unoptimized test profile with debug information and incremental compilation disabled. The fixture ran on the CPU without initializing a D3D12 device.

Commands and results

  • cargo test --workspace --no-run compiled the workspace test targets and exited 0.
  • cargo test -p xcl --lib hle::d3d12x::console_heap::tests::released_shared_ranges_merge -- --exact ran with XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1, outside the Arc wrapper. It exited 0. The focused log recorded 1 passed, 0 failed, 0 ignored, and 0 explicit skips. The exact filter excluded 693 other library tests.

Observed behavior

The allocator fixture recovered all four 512-descriptor pages in a 2,048-descriptor simulated heap after out-of-order page releases and intervening eight-descriptor allocations. It also verified that returning an interior range joins the free ranges on both sides and that freeing through the allocation frontier resets it to zero and empties the free list.

Not tested

The full GPU workspace suite and game smoke runs were omitted. This fixture exercised the allocator helpers in memory. Live D3D12 heap creation and descriptor reuse through the runtime were outside the test's coverage.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr840-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154297997 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/840#issuecomment-7154297997). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:57:23Z. --- ### Empirical test report (feacb142) Verified xcl-dev/xcl PR #840 at commit `feacb14207928339a31e01cc8841c9b0c06140a3` in a clean detached worktree. **Hardware / environment** Windows x64 build 26200.0 on an AMD Family 23 Model 113 CPU with 12 logical processors available to the process. Rust was `rustc 1.100.0 (0ef1bc386 2026-11-09)` for `x86_64-pc-windows-msvc`. DXC reported `1.9.2609.5 (01b62ad47)`. The workspace used the unoptimized test profile with debug information and incremental compilation disabled. The fixture ran on the CPU without initializing a D3D12 device. **Commands and results** - `cargo test --workspace --no-run` compiled the workspace test targets and exited 0. - `cargo test -p xcl --lib hle::d3d12x::console_heap::tests::released_shared_ranges_merge -- --exact` ran with `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`, outside the Arc wrapper. It exited 0. The focused log recorded 1 passed, 0 failed, 0 ignored, and 0 explicit skips. The exact filter excluded 693 other library tests. **Observed behavior** The allocator fixture recovered all four 512-descriptor pages in a 2,048-descriptor simulated heap after out-of-order page releases and intervening eight-descriptor allocations. It also verified that returning an interior range joins the free ranges on both sides and that freeing through the allocation frontier resets it to zero and empties the free list. **Not tested** The full GPU workspace suite and game smoke runs were omitted. This fixture exercised the allocator helpers in memory. Live D3D12 heap creation and descriptor reuse through the runtime were outside the test's coverage. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr840-focused.log` and published.
DavidM1911 commented 2026-11-25 11:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:27:58Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7159732992 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/840#issuecomment-7159732992). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:27:58Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
upstream-sync closed this pull request 2026-11-26 08:03:34 +00:00

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