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

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

@⁠gloger2003 on GitHub · 2026-11-24 21:38 UTC · original
gloger2003:fix/sparse-pool-activity-counts → main · +45 −9 · 2 files · 1 commits · draft

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.

**@⁠gloger2003** on GitHub · 2026-11-24 21:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1838) `gloger2003:fix/sparse-pool-activity-counts` → `main` · +45 −9 · 2 files · 1 commits · draft 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.
Report active, occupied, parked and retired sparse capacity. Retired heaps still held by XCL previously vanished from the activity line. The pool-reuse test now checks accounting through retirement, reuse and release.

Part of #1773

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:53 +00:00
Author
Owner

@⁠gabrielsteglich on GitHub · 2026-11-24 22:48 UTC · original

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.

**@⁠gabrielsteglich** on GitHub · 2026-11-24 22:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7146661611) 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:03 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 01:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7149164138) 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!
Author
Owner

@⁠pickles976 on GitHub · 2026-11-25 17:01 UTC · original

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.

**@⁠pickles976** on GitHub · 2026-11-25 17:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7168883049) 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://git.gtahub.st/github/xcl-dev--xcl/pulls/1837). 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:28 UTC · original

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.

**@⁠DavidM1911** on GitHub · 2026-11-26 06:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1838#issuecomment-7184458423) 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.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/sparse.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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