D3D12.X: count retained sparse heaps in memory activity #1828

Closed
gloger2003 wants to merge 1 commit from upstream-pr/1838 into main
gloger2003 commented 2026-11-24 21:38:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gloger2003 on 2026-11-24T21:38:38Z.


Part of #1773. The memory activity line omitted sparse heaps that XCL retained after retirement. Its existing mapped field counts occupied tiles, including those pinned by placed buffers.

What is in it

  • Keep the existing sparse-pool fields for log readers, including #1854. Append occupied capacity, parked mapping coverage and retired capacity. Parked mappings overlap occupied tiles.
  • Verify accounting for a real 64 MiB heap as it retires, returns to use and is released.

Tested

  • Windows x64, Ryzen 7 5700X, Radeon RX 7800 XT. Release builds for the smoke run and a debug workspace build.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output. 959 reported passed, 0 failed, 43 ignored. Runtime skips: 7 (gpu, heap_window_out_of_memory_falls_back_to_the_switch_form).
  • The unmodified parser from #1854 reported no_sample for a real log from the previous head a96b70f. With this head it returned valid samples from both main and the PR at 20 seconds. The three new counters were present in the PR log.

Regression run

Minecraft Preview, 30 seconds per build using the same 1x MSAA settings.

xcl-smoke v1
commit: 1d027e5c76c9a86a7ee2ca1cc677edf0be95d331
gpu: AMD Radeon RX 7800 XT
title: c22a3829
seconds: 30
exit: 0x0
frames shown: 1612 (PresentX 1612)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 3381 MB
xcl-smoke v1
commit: 2e56d37f1dbd27e1a004b556f4e2192f41f065e8
gpu: AMD Radeon RX 7800 XT
title: c22a3829
seconds: 30
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 120 121 120
device removals: 0
crashes: 0
peak commit: 3339 MB

Not tested

World-load and long-session memory usage. The game run covers startup and menu rendering.

AI use

OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) traced the counter, wrote the change and its test, checked log-reader compatibility and ran validation.

<!-- greyfinch-sync:ivall/xcl:issue:5480770295 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838). Originally posted by [gloger2003](https://github.com/gloger2003) on 2026-11-24T21:38:38Z. --- Part of #1773. The memory activity line omitted sparse heaps that XCL retained after retirement. Its existing `mapped` field counts occupied tiles, including those pinned by placed buffers. **What is in it** - Keep the existing sparse-pool fields for log readers, including #1854. Append occupied capacity, parked mapping coverage and retired capacity. Parked mappings overlap occupied tiles. - Verify accounting for a real 64 MiB heap as it retires, returns to use and is released. **Tested** - Windows x64, Ryzen 7 5700X, Radeon RX 7800 XT. Release builds for the smoke run and a debug workspace build. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output`. 959 reported passed, 0 failed, 43 ignored. Runtime skips: 7 (gpu, heap_window_out_of_memory_falls_back_to_the_switch_form). - The unmodified parser from #1854 reported `no_sample` for a real log from the previous head `a96b70f`. With this head it returned valid samples from both main and the PR at 20 seconds. The three new counters were present in the PR log. **Regression run** Minecraft Preview, 30 seconds per build using the same 1x MSAA settings. ``` xcl-smoke v1 commit: 1d027e5c76c9a86a7ee2ca1cc677edf0be95d331 gpu: AMD Radeon RX 7800 XT title: c22a3829 seconds: 30 exit: 0x0 frames shown: 1612 (PresentX 1612) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 3381 MB ``` ``` xcl-smoke v1 commit: 2e56d37f1dbd27e1a004b556f4e2192f41f065e8 gpu: AMD Radeon RX 7800 XT title: c22a3829 seconds: 30 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 120 121 120 device removals: 0 crashes: 0 peak commit: 3339 MB ``` **Not tested** World-load and long-session memory usage. The game run covers startup and menu rendering. **AI use** OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) traced the counter, wrote the change and its test, checked log-reader compatibility and ran validation.
gabrielsteglich commented 2026-11-24 23:08:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gabrielsteglich on 2026-11-24T22:48:10Z.


Independent NVIDIA validation for 2e56d37f1dbd27e1a004b556f4e2192f41f065e8, merged locally into main 689f2db477c3c062cf162649781640ef8a977c18 as 5a49f707a9d412f171b76db6d92758e5c472dc19. The merge was clean.

Tested

  • NVIDIA GeForce RTX 3090 24 GB (driver 621.01, wave32), Core i9-13900K, Windows 11 Pro build 26300, Rust 1.97.0 MSVC, DXC 1.9.2602.17, debug.
  • cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output reported 975 passed, 0 failed, 45 ignored.
  • hle::d3d12x::sparse::tests::a_pool_retired_a_moment_ago_is_taken_back passed on the RTX 3090, including the new counters for the active, retired, reused and released heap.

The suite emitted 24 explicit skips: 18 native-wave64 subcases, three wave32 per-lane refusals (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), two debug-layer tests (test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state) and heap_window_out_of_memory_falls_back_to_the_switch_form with heap windows off. The wave64 skips were in the four gpu::recomp::lower parity tests, the five gpu::recomp::lower_dxil GPU tests and gpu_geometry_wave32_prefix_count_over_a_mask / gpu_wave32_program_in_wave64_hardware.

Not tested

Retail smoke, AMD or Intel. This run covered synthetic tests on the local merge.

AI use

OpenAI's coding agent (GPT-6) ran the build and tests and prepared the report.

<!-- greyfinch-sync:ivall/xcl:comment:7146661611 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7146661611). Originally posted by [gabrielsteglich](https://github.com/gabrielsteglich) on 2026-11-24T22:48:10Z. --- Independent NVIDIA validation for `2e56d37f1dbd27e1a004b556f4e2192f41f065e8`, merged locally into `main` `689f2db477c3c062cf162649781640ef8a977c18` as `5a49f707a9d412f171b76db6d92758e5c472dc19`. The merge was clean. **Tested** - NVIDIA GeForce RTX 3090 24 GB (driver 621.01, wave32), Core i9-13900K, Windows 11 Pro build 26300, Rust 1.97.0 MSVC, DXC 1.9.2602.17, debug. - `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` reported **975 passed, 0 failed, 45 ignored**. - `hle::d3d12x::sparse::tests::a_pool_retired_a_moment_ago_is_taken_back` passed on the RTX 3090, including the new counters for the active, retired, reused and released heap. The suite emitted 24 explicit skips: 18 native-wave64 subcases, three wave32 per-lane refusals (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`), two debug-layer tests (`test_title_draws_with_a_root_signature_under_the_debug_layer`, `uploads_start_from_each_subresources_state`) and `heap_window_out_of_memory_falls_back_to_the_switch_form` with heap windows off. The wave64 skips were in the four `gpu::recomp::lower` parity tests, the five `gpu::recomp::lower_dxil` GPU tests and `gpu_geometry_wave32_prefix_count_over_a_mask` / `gpu_wave32_program_in_wave64_hardware`. **Not tested** Retail smoke, AMD or Intel. This run covered synthetic tests on the local merge. **AI use** OpenAI's coding agent (GPT-6) ran the build and tests and prepared the report.
DavidM1911 commented 2026-11-25 01:11:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:03:36Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7149164138 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7149164138). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T01:03:36Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
pickles976 commented 2026-11-25 17:07:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T17:01:22Z.


Verified 2e56d37f1dbd27e1a004b556f4e2192f41f065e8 together with #1837 on a mixed Wine 11 / stock vkd3d 3.2 integration, RTX 4060 Laptop 8 GB / 16 GB RAM. Full tree, command, results and limitations.

The combined heap-lifecycle regression passed (1/1, no skips), including active/occupied/retired accounting across retirement, reuse and release; the release build passed. The title emitted 33 memory samples retaining the existing fields and appending the new counters. Retired capacity peaked at 384 MiB and returned to zero; parked-mapping coverage peaked at 164 MiB.

The title run ended at our available-RAM guard before gameplay. This is counter/lifecycle verification, not a demonstrated VRAM saving or a clean-head/performance comparison. No additional local accounting implementation was added.

AI assistance: omp / openai-codex/gpt-6-astra ran the integration checks and wrote/submitted these reports at the repository owner's request.

<!-- greyfinch-sync:ivall/xcl:comment:7168883049 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7168883049). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T17:01:22Z. --- Verified `2e56d37f1dbd27e1a004b556f4e2192f41f065e8` together with #1837 on a mixed Wine 11 / stock vkd3d 3.2 integration, RTX 4060 Laptop 8 GB / 16 GB RAM. [Full tree, command, results and limitations](https://github.com/xcl-dev/xcl/pull/1837#issuecomment-7168882566). The combined heap-lifecycle regression passed (1/1, no skips), including active/occupied/retired accounting across retirement, reuse and release; the release build passed. The title emitted 33 memory samples retaining the existing fields and appending the new counters. Retired capacity peaked at **384 MiB** and returned to zero; parked-mapping coverage peaked at **164 MiB**. The title run ended at our available-RAM guard before gameplay. This is counter/lifecycle verification, **not a demonstrated VRAM saving or a clean-head/performance comparison**. No additional local accounting implementation was added. AI assistance: omp / openai-codex/gpt-6-astra ran the integration checks and wrote/submitted these reports at the repository owner's request.
DavidM1911 commented 2026-11-26 07:03:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:28:07Z.


Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7184458423 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7184458423). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T06:28:07Z. --- Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
Foniass commented 2026-12-01 06:56:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:56:41Z.


Triage (#1607) – head 2e56d37

main already counts retained sparse heaps in XCL_ACTIVITY: commit d3e60ec (D3D12.X: report memory by tracked owner) added sparse::memory_bytes_for. It returns the active, occupied and retired pool bytes from a single lock, and memory_report.rs logs them as sparse tiles, sparse pools free and sparse pools retired.
The only part not on main is the parked mappings figure.
Recommendation: close (superseded by main commit d3e60ec).

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:7303463524 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7303463524). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:56:41Z. --- **Triage (#1607)** – head 2e56d37 main already counts retained sparse heaps in XCL_ACTIVITY: commit d3e60ec (`D3D12.X: report memory by tracked owner`) added `sparse::memory_bytes_for`. It returns the active, occupied and retired pool bytes from a single lock, and `memory_report.rs` logs them as `sparse tiles`, `sparse pools free` and `sparse pools retired`. The only part not on main is the `parked mappings` figure. Recommendation: close (superseded by main commit d3e60ec). 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 15:59:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T15:59:26Z.


Closing as superseded: this change is already on main (d3e60ecb). From Foniass's rechecked close list on #1607, checked again by script just now. If something here is still missing, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7316851896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7316851896). Originally posted by [throny](https://github.com/throny) on 2026-12-01T15:59:26Z. --- Closing as superseded: this change is already on `main` (d3e60ecb). From Foniass's rechecked close list on #1607, checked again by script just now. If something here is still missing, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5).

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