Skip to content

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

Draft
gloger2003 wants to merge 1 commit into
xcl-dev:mainfrom
gloger2003:fix/sparse-pool-activity-counts
Draft

gloger2003 wants to merge 1 commit into
xcl-dev:mainfrom
gloger2003:fix/sparse-pool-activity-counts

Conversation

@gloger2003

@gloger2003 gloger2003 commented Nov 24, 2026 •

Copy link
Copy Markdown

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 Scripts: compare activity memory samples at matching times #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 Scripts: compare activity memory samples at matching times #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 xcl-dev#1773

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
@gloger2003
gloger2003 force-pushed the fix/sparse-pool-activity-counts branch from a96b70f to 2e56d37 Compare November 24, 2026 22:17
@gabrielsteglich

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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

Thanks!

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@pickles976

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants