D3D12.X: a released allocator leaves nothing behind in alloc_pool #907

Manually merged
github merged 1 commit from gh-pr/907/head into gh-pr/907/base 2026-11-26 04:36:31 +00:00
Owner

@⁠theaustinayers on GitHub · 2026-11-24 08:02 UTC · original
theaustinayers:alloc-release → main · +45 −0 · 2 files · 1 commits · merged 2026-11-24 08:02 UTC

Fixes the CI failure #897 left on main: mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares fails there with E_INVALIDARG from a list Reset (run 45351827679, "Build and test (Windows, no GPU)").

#897 keeps, by address, which PC allocator a title's allocator stands for. The entry stayed when the allocator was released, so a later allocator at the same address went on with the old one's PC allocator – of another type or device. In the suite, alloc_pool's own test left such an entry and the split test's allocator then got that address. A title that releases its allocators would meet the same.

What is in it

  • crates/xcl/src/hle/d3d12x/alloc_pool.rs: forget – the allocator's entries go at its last Release; the PC allocators made for it are released when nothing records on them any more. The test now also releases the allocator while another PC allocator stands for it and checks that nothing is left.
  • crates/xcl/src/hle/d3d12x/real.rs: alloc_release calls it.

Tested

  • NVIDIA GeForce RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 build 26300, rustc 1.100.0, debug build for tests, release for the run
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4: 716 passed, 0 failed, 41 ignored; no SKIPPED tests on this adapter

Regression run

main (11920b5 is the commit of #897, merged as 1c87b1d):

xcl-smoke v1
commit: 11920b5e0d127f04d45363ac8475e82d174d9e40
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16186 MB

PR:

xcl-smoke v1
commit: 5c3ff31790711dcb010590c6c1e0889a61be27fd
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15994 MB

Not tested

  • The failure itself did not reproduce on this machine before the fix (the suite passed here on #897: it depends on which address the allocator gets); that this fixes it on CI is for this PR's CI run to show.
  • The retail title's world with this commit; AMD and Intel GPUs; Wine.

AI use

  • Claude Code, Claude Fable 5.2: read the CI log, wrote the fix, the test and this description. The runs above were made on the hardware named.

🤖 Generated with Claude Code

**@⁠theaustinayers** on GitHub · 2026-11-24 08:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/907) `theaustinayers:alloc-release` → `main` · +45 −0 · 2 files · 1 commits · merged 2026-11-24 08:02 UTC Fixes the CI failure #897 left on `main`: `mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares` fails there with E_INVALIDARG from a list Reset (run 45351827679, "Build and test (Windows, no GPU)"). #897 keeps, by address, which PC allocator a title's allocator stands for. The entry stayed when the allocator was released, so a later allocator at the same address went on with the old one's PC allocator – of another type or device. In the suite, `alloc_pool`'s own test left such an entry and the split test's allocator then got that address. A title that releases its allocators would meet the same. **What is in it** - `crates/xcl/src/hle/d3d12x/alloc_pool.rs`: `forget` – the allocator's entries go at its last Release; the PC allocators made for it are released when nothing records on them any more. The test now also releases the allocator while another PC allocator stands for it and checks that nothing is left. - `crates/xcl/src/hle/d3d12x/real.rs`: `alloc_release` calls it. **Tested** - NVIDIA GeForce RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 build 26300, rustc 1.100.0, debug build for tests, release for the run - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: 716 passed, 0 failed, 41 ignored; no SKIPPED tests on this adapter **Regression run** main (11920b5 is the commit of #897, merged as 1c87b1d): ``` xcl-smoke v1 commit: 11920b5e0d127f04d45363ac8475e82d174d9e40 gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1639 (PresentX 1639) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 16186 MB ``` PR: ``` xcl-smoke v1 commit: 5c3ff31790711dcb010590c6c1e0889a61be27fd gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15994 MB ``` **Not tested** - The failure itself did not reproduce on this machine before the fix (the suite passed here on #897: it depends on which address the allocator gets); that this fixes it on CI is for this PR's CI run to show. - The retail title's world with this commit; AMD and Intel GPUs; Wine. **AI use** - Claude Code, Claude Fable 5.2: read the CI log, wrote the fix, the test and this description. The runs above were made on the hardware named. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#897 kept, by address, which PC allocator a title's allocator stands for.
The entry stayed when the allocator was released, so a later allocator at the
same address went on with the old one's PC allocator - of another type or
device. On CI (WARP) that failed
mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares: its list Reset
got E_INVALIDARG after alloc_pool's own test had left an entry for an address
the test's allocator then received.

The allocator's last Release now drops its entries; the PC allocators made
for it go with it when nothing records on them any more.

Assisted-by: Claude Code (Claude Fable 5.2)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:29 +00:00
github manually merged commit 5c3ff31790 into gh-pr/907/base 2026-11-26 04:36:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.