Skip to content

D3D12.X: keep reusable allocator in aside when Reset fails (#1004) - #1051

Closed
ksanjeev284 wants to merge 1 commit into
xcl-dev:mainfrom
ksanjeev284:pr-1004-alloc-pool-reset
Closed

ksanjeev284 wants to merge 1 commit into
xcl-dev:mainfrom
ksanjeev284:pr-1004-alloc-pool-reset

Conversation

@ksanjeev284

Copy link
Copy Markdown

Fixes #1004.

In alloc_pool::title_reset, the reusable-backing branch removed the spare candidate from aside and cleared its marks before calling reset_pc_allocator. If Reset returned an error, the spare was no longer in aside or cur, so it leaked out of the pool and a retry would allocate a new backing instead of reusing it.

What is in it

  • crates/xcl/src/hle/d3d12x/alloc_pool.rs: factor the state transition into State::reset_title, call reset_pc on the reusable candidate before removing it from aside and clearing its marks, and add failed_reset_keeps_reusable_allocator_in_aside_for_retry covering failed Reset, retry reuse without allocating a new backing, and publication to cur.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 3070 Ti (8 GB), Windows 11, Rust 1.88.0 (cargo +1.88.0), debug tests + release xcl.exe
  • cargo +1.88.0 test -p xcl --lib alloc_pool -- --nocapture: 2 passed (failed_reset_keeps_reusable_allocator_in_aside_for_retry, a_recording_outlives_the_reset_of_the_titles_allocator), 0 failed
  • cargo +1.88.0 test --workspace --no-fail-fast -- --test-threads=4 on base 6efdabc: 724 passed, 3 failed (pre-existing in this sandboxed environment: xmem_virtual_query_marks_cpu_readable_memory and 2 unbuilt e2e testtitle tests), 41 ignored (SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu_wave32_program_in_wave64_hardware: no wave64)

Regression run

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 3070 Ti
title: retail_title_smoke
seconds: 35
exit: 0x0
frames shown: 321 (PresentX 321)
presents per 2 s (last 3): 0 2 38
device removals: 0
crashes: 0
peak commit: 16096 MB

PR:

xcl-smoke v1
commit: efa54c63089530283993929596e9f3acf3db9dd3
gpu: NVIDIA GeForce RTX 3070 Ti
title: retail_title_smoke
seconds: 35
exit: 0x0
frames shown: 329 (PresentX 329)
presents per 2 s (last 3): 2 31 60
device removals: 0
crashes: 0
peak commit: 15736 MB

Not tested

  • AMD RDNA / wave64 GPUs
  • Triggering a real driver Reset failure on a live retail title (covered by the isolated state-machine unit test)

AI use

  • Antigravity (Gemini 3.1 Pro) wrote the fix, unit test, and PR description and ran the tests and smoke runs under author review.

)

Fixes xcl-dev#1004. In alloc_pool::title_reset, call reset_pc_allocator on the reusable candidate before removing it from aside and clearing its marks, so a failed Reset leaves the spare tracked and reusable on retry instead of leaking it.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@DavidM1911

Copy link
Copy Markdown
Contributor

Heads-up: current main 384f7f7 already contains this fix through the merged allocator-pool series (#994 "preserve busy allocators when replacement fails", #1009, #1012, #1023 — commit f52ec36 "keep reusable allocators after a failed Reset"). alloc_pool.rs on main now has title_reset_in keeping the failed candidate owned, with the regression "the failed candidate is still owned and reusable" — the same behaviour this PR adds, and this branch no longer merges cleanly. Suggest closing as superseded unless there's a remaining delta I'm missing.

AI use: checked by Devin (Cognition, SWE-2); merge attempted locally, no code changes.

@ksanjeev284

Copy link
Copy Markdown
Author

Closing as 384f7f7 (#1009) just landed on main covering reusable allocator retention across a failed Reset.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3D12.X: failed Reset removes a reusable allocator from its pool

3 participants