D3D12.X: segments parked as spares stop holding their PC allocator (port of #2936 to nvidia-dev) #3004

Merged
Kalmarv merged 2 commits from upstream-pr/3004 into nvidia-dev 2026-11-28 00:30:52 +00:00
Kalmarv commented 2026-11-27 11:50:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-27T11:50:01Z.


Port of #2936 to nvidia-dev. Stacked on #3003; only the top commit (bf42a6ee) belongs here. Part of #2688.

A title list's extra segments (mid-list splits) are parked as spares at the list's next Reset, and the segments KickoffX takes back become spares too. A spare records again only after its own later Reset, but alloc_pool still counted it as a user of the PC allocator it last recorded on, so that allocator never became free; every later Reset of the title's allocator put one more PC allocator aside, never reused or released. On the title this is a host GPU memory step of several GB about 160-180 s into the world. Measured on main (#2936): non-local video memory 6.2 -> 9.6 GB from 100 s to 240 s without, 5.0 -> 5.5 GB with (about 4 GB less), PC allocators 1,928 against 897, no frame-rate cost.

What is in it

  • alloc_pool::park_list: drops a list from its allocator's users; the allocator's submit marks stay, so it is reused only once the GPU is past them (alloc_pool.rs, test a_parked_spare_no_longer_holds_its_allocator).
  • title_list::reset parks the moved segments and the recording a stand-in replaces (title_list.rs); kickoff_x parks its reclaimed segments after both submits (list_x.rs).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), Ryzen 9 9950X, Windows 11 Pro 26200, Rust 1.99.0 MSVC, debug tests, release smoke; DXC 1.9.2609 via XCL_DXC_DIR.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on bf42a6ee: 1827 passed, 8 failed, 48 ignored. The same command on nvidia-dev a5e2d851: 1822 passed, 10 failed, 48 ignored.
  • Failed here and on a5e2d851 as well: async_compute_pso_registers_real_pso_and_not_standin, console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays, hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels, split_compute_prefers_the_offline_whole_pipeline, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.
  • 26 SKIPPED: 8 no wave64; 1 const_mask, wave64: no wave64; 1 f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); 1 f16 arithmetic, wave64: no wave64; 1 f32 arithmetic, wave64: no wave64; 1 f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)); 1 f16 packed, wave64: no wave64; 1 f32 compares, wave64: no wave64; 1 integer arithmetic, wave64: no wave64; 1 mask_ff0_flbit, wave64: no wave64; 1 f64, wave64: no wave64; 1 f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)); 1 f32 conversions, wave64: no wave64; 1 integer carries, wave64: no wave64; 1 f32 rounding, wave64: no wave64; 1 f32 transcendentals, wave64: no wave64; 1 f32 three-source, wave64: no wave64; 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1); 1 no heap windows.
  • CI: Build and test (Windows, no GPU) is red on nvidia-dev itself and on every PR into it, this one included: the lib test process ends with 0x887a0020 in a sparse test on the runner's software adapter, with no test reported failed. #2837 fixes that test; nothing here touches it.

Regression run
150 s runs, same title, same env (XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=all XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_PSO_JOURNAL=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=120000, DXC 1.9), no switch of this PR set. The main run from a hard-link copy of our team branch's DXIL cache; the base and head runs from hard-link copies of one cache warmed on nvidia-dev a5e2d851 (on this branch the title starts after about 75-90 s of startup shader preparation, so 60 s would end inside it).

A commit of main (b49be183, the last one before the shader preparation screen of #2555):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1917 (PresentX 1917)
presents per 2 s (last 3): 0 0 2
device removals: 0
crashes: 0
peak commit: 33080 MB

The base, nvidia-dev a5e2d851:

xcl-smoke v1
commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 2464 (PresentX 2464)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 34597 MB

This PR's head:

xcl-smoke v1
commit: bf42a6ee003cca247c436b8e7e730cba27e934b8
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 2613 (PresentX 2613)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 34798 MB

Not tested

  • The memory measurement above is from main; on nvidia-dev it is not repeated alone. AMD.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, ported it, ran the suite and the regression runs on the hardware above, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5526123359 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3004). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-27T11:50:01Z. --- Port of #2936 to `nvidia-dev`. Stacked on #3003; only the top commit (bf42a6ee) belongs here. Part of #2688. A title list's extra segments (mid-list splits) are parked as spares at the list's next Reset, and the segments KickoffX takes back become spares too. A spare records again only after its own later Reset, but `alloc_pool` still counted it as a user of the PC allocator it last recorded on, so that allocator never became free; every later Reset of the title's allocator put one more PC allocator aside, never reused or released. On the title this is a host GPU memory step of several GB about 160-180 s into the world. Measured on `main` (#2936): non-local video memory 6.2 -> 9.6 GB from 100 s to 240 s without, 5.0 -> 5.5 GB with (about 4 GB less), PC allocators 1,928 against 897, no frame-rate cost. **What is in it** - `alloc_pool::park_list`: drops a list from its allocator's users; the allocator's submit marks stay, so it is reused only once the GPU is past them (`alloc_pool.rs`, test `a_parked_spare_no_longer_holds_its_allocator`). - `title_list::reset` parks the moved segments and the recording a stand-in replaces (`title_list.rs`); `kickoff_x` parks its reclaimed segments after both submits (`list_x.rs`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), Ryzen 9 9950X, Windows 11 Pro 26200, Rust 1.99.0 MSVC, debug tests, release smoke; DXC 1.9.2609 via `XCL_DXC_DIR`. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` on bf42a6ee: 1827 passed, 8 failed, 48 ignored. The same command on `nvidia-dev` `a5e2d851`: 1822 passed, 10 failed, 48 ignored. - Failed here and on `a5e2d851` as well: `async_compute_pso_registers_real_pso_and_not_standin`, `console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly`, `hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays`, `hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels`, `split_compute_prefers_the_offline_whole_pipeline`, `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs`. - 26 `SKIPPED`: 8 no wave64; 1 const_mask, wave64: no wave64; 1 f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); 1 f16 arithmetic, wave64: no wave64; 1 f32 arithmetic, wave64: no wave64; 1 f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)); 1 f16 packed, wave64: no wave64; 1 f32 compares, wave64: no wave64; 1 integer arithmetic, wave64: no wave64; 1 mask_ff0_flbit, wave64: no wave64; 1 f64, wave64: no wave64; 1 f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)); 1 f32 conversions, wave64: no wave64; 1 integer carries, wave64: no wave64; 1 f32 rounding, wave64: no wave64; 1 f32 transcendentals, wave64: no wave64; 1 f32 three-source, wave64: no wave64; 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1); 1 no heap windows. - CI: `Build and test (Windows, no GPU)` is red on `nvidia-dev` itself and on every PR into it, this one included: the lib test process ends with `0x887a0020` in a sparse test on the runner's software adapter, with no test reported failed. #2837 fixes that test; nothing here touches it. **Regression run** 150 s runs, same title, same env (`XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=all XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_PSO_JOURNAL=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=120000`, DXC 1.9), no switch of this PR set. The `main` run from a hard-link copy of our team branch's DXIL cache; the base and head runs from hard-link copies of one cache warmed on `nvidia-dev` `a5e2d851` (on this branch the title starts after about 75-90 s of startup shader preparation, so 60 s would end inside it). A commit of `main` (`b49be183`, the last one before the shader preparation screen of #2555): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 1917 (PresentX 1917) presents per 2 s (last 3): 0 0 2 device removals: 0 crashes: 0 peak commit: 33080 MB ``` The base, `nvidia-dev` `a5e2d851`: ``` xcl-smoke v1 commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 2464 (PresentX 2464) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 34597 MB ``` This PR's head: ``` xcl-smoke v1 commit: bf42a6ee003cca247c436b8e7e730cba27e934b8 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 2613 (PresentX 2613) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 34798 MB ``` **Not tested** - The memory measurement above is from `main`; on `nvidia-dev` it is not repeated alone. AMD. **AI use** - Claude Code (Claude Opus 5.5) wrote the change, ported it, ran the suite and the regression runs on the hardware above, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Decodere commented 2026-11-27 16:57:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T16:57:18Z.


Independent desktop NVIDIA verification of PR #3004 at head bf42a6ee003cca247c436b8e7e730cba27e934b8 (2 commits stacked on #3003 8d36887d; merge-base: a5e2d851a503fc0e04609f773ea53f2d2c4e3269, ancestor of nvidia-dev).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (bf42a6ee)

Command Result
cargo test --release -p xcl --lib -- --nocapture a_parked_spare_no_longer_holds_its_allocator (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1729 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped)
cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::alloc_pool:: hle::d3d12x::uma_driver:: hle::d3d12x::title_list:: (3 consecutive runs) 16 passed; 0 failed; 0 ignored; 1714 filtered out × 3 (0.22s, 0.23s, 0.23s, 0 skipped; includes live RTX 4060 failed_write_watch_does_not_release_the_original_window and full alloc_pool/title_list suites)
cargo build --release -p xcl Clean build (1m 54s, exit 0, 0 new warnings in alloc_pool.rs, title_list.rs, list_x.rs, uma_driver.rs, uma.rs, or PR-touched lines of real.rs)

Paired quiet 60 s retail smoke (title: 29640639, XCL_PREPARE=0, XCL_NETWORK=0)

Merge-base (a5e2d851a503fc0e04609f773ea53f2d2c4e3269, nvidia-dev ancestor, cached baseline on the same machine):

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

PR #3004 (bf42a6ee003cca247c436b8e7e730cba27e934b8, stacked on #3003 8d36887d):

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

Runtime telemetry observed in xcl.log on RTX 4060 (621.14)

  • Stacked #3003 driver CUSTOM L0 heap remapping succeeded (D3D12.X: the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched (132 reservations, 0 pages kept, 0 KB, 334 ms)), and the spare-list reset path fired live (a command list reset while its last submit is on the GPU records on another PC list (#1024) at 41.3 s; 213 blocks held for 213 allocators at 46.7 s).
  • Steady-state memory at ~58.2 s: 14620 MB committed (peak commit: 14655 MB, -213 MB vs. a5e2d851), 6114 MB local, 4765 MB non-local (budget 6896 MB).

Limits of coverage

  • a_parked_spare_no_longer_holds_its_allocator and all 16 tests across alloc_pool::, uma_driver::, and title_list:: (16/16, 0 skipped) passed 3/3, directly verifying that alloc_pool::park_list clears a parked spare segment's allocator hold so the title's allocator can be reset cleanly.
  • Because PR #3004 is stacked on #3003 (8d36887d), the 60 s retail smoke (XCL_PREPARE=0, XCL_NETWORK=0, 0 device removals, 0 crashes, steady 60 Hz) exercises both commits together vs. a5e2d851; long-run allocator-count growth over multi-minute world play was not measured in this 60 s startup window.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7223860427 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3004#issuecomment-7223860427). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T16:57:18Z. --- Independent desktop NVIDIA verification of **PR #3004** at head `bf42a6ee003cca247c436b8e7e730cba27e934b8` (`2` commits stacked on `#3003` `8d36887d`; merge-base: `a5e2d851a503fc0e04609f773ea53f2d2c4e3269`, ancestor of `nvidia-dev`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`bf42a6ee`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture a_parked_spare_no_longer_holds_its_allocator` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1729 filtered out` × 3 (`0.00s`, `0.00s`, `0.00s`, `0` skipped) | | `cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::alloc_pool:: hle::d3d12x::uma_driver:: hle::d3d12x::title_list::` (3 consecutive runs) | `16 passed; 0 failed; 0 ignored; 1714 filtered out` × 3 (`0.22s`, `0.23s`, `0.23s`, `0` skipped; includes live RTX 4060 `failed_write_watch_does_not_release_the_original_window` and full `alloc_pool`/`title_list` suites) | | `cargo build --release -p xcl` | Clean build (`1m 54s`, exit `0`, `0` new warnings in `alloc_pool.rs`, `title_list.rs`, `list_x.rs`, `uma_driver.rs`, `uma.rs`, or PR-touched lines of `real.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`, `XCL_PREPARE=0`, `XCL_NETWORK=0`) Merge-base (`a5e2d851a503fc0e04609f773ea53f2d2c4e3269`, `nvidia-dev` ancestor, cached baseline on the same machine): ``` xcl-smoke v1 commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1513 (PresentX 1513) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14868 MB ``` PR #3004 (`bf42a6ee003cca247c436b8e7e730cba27e934b8`, stacked on `#3003` `8d36887d`): ``` xcl-smoke v1 commit: bf42a6ee003cca247c436b8e7e730cba27e934b8 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14655 MB ``` #### Runtime telemetry observed in `xcl.log` on RTX 4060 (`621.14`) - Stacked `#3003` driver CUSTOM L0 heap remapping succeeded (`D3D12.X: the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched (132 reservations, 0 pages kept, 0 KB, 334 ms)`), and the spare-list reset path fired live (`a command list reset while its last submit is on the GPU records on another PC list (#1024)` at `41.3 s`; `213 blocks held for 213 allocators` at `46.7 s`). - Steady-state memory at ~58.2 s: `14620 MB` committed (`peak commit: 14655 MB`, `-213 MB` vs. `a5e2d851`), `6114 MB local`, `4765 MB non-local` (budget `6896 MB`). ### Limits of coverage - `a_parked_spare_no_longer_holds_its_allocator` and all `16` tests across `alloc_pool::`, `uma_driver::`, and `title_list::` (`16/16`, `0` skipped) passed `3/3`, directly verifying that `alloc_pool::park_list` clears a parked spare segment's allocator hold so the title's allocator can be reset cleanly. - Because PR `#3004` is stacked on `#3003` (`8d36887d`), the 60 s retail smoke (`XCL_PREPARE=0`, `XCL_NETWORK=0`, `0` device removals, `0` crashes, steady 60 Hz) exercises both commits together vs. `a5e2d851`; long-run allocator-count growth over multi-minute world play was not measured in this 60 s startup window. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
throny commented 2026-11-28 00:30:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T00:30:43Z.


merge-check claim
head: bf42a6ee00

<!-- greyfinch-sync:ivall/xcl:comment:7230971179 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3004#issuecomment-7230971179). Originally posted by [throny](https://github.com/throny) on 2026-11-28T00:30:43Z. --- merge-check claim head: bf42a6ee003cca247c436b8e7e730cba27e934b8
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!3004
No description provided.