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

Merged
theaustinayers merged 1 commit from upstream-pr/907 into main 2026-11-24 08:02:55 +00:00
theaustinayers commented 2026-11-24 08:02:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by theaustinayers on 2026-11-24T08:02:22Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:6577324009 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/907). Originally posted by [theaustinayers](https://github.com/theaustinayers) on 2026-11-24T08:02:22Z. --- 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)
upstream-sync closed this pull request 2026-11-24 08:03:39 +00:00
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!901
No description provided.