D3D12.X: keep reusable allocators after a failed Reset #1002

Closed
nova-aryan wants to merge 1 commit from upstream-pr/1009 into main
nova-aryan commented 2026-11-24 10:20:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nova-aryan on 2026-11-24T10:20:31Z.


A failed Reset of a reusable command allocator currently removes that spare from its owner's pool before returning the error. Keep it owned and available until Reset succeeds, so a retry uses the same backing instead of abandoning it and allocating another. Fixes #1004.

Independent of #994: that PR handles failure to create a new replacement; this handles failure to reset an existing spare.

What is in it

  • alloc_pool.rs: publish the reuse transition only after successful Reset. Extract the existing transition into a private helper taking the native Reset call, so an isolated regression can inject two failures and a successful retry without a device or shared global state.
  • README.md: document retry behavior. One commit, no dependencies or game data.

Tested

  • Source review on main 6efdabc; git diff --check: exit 0.
  • Regression added for retained ownership, unchanged current backing/recording, reuse of the same spare, and exactly one successful swap. No tests, builds or GPU/game workloads were run locally, at the user's request.

Regression run
Not run. Main/head retail smoke blocks are missing; keep this a draft pending Windows validation.

Not tested

  • Compilation, the new regression's execution, the full workspace/GPU suite, actual driver failures and retail gameplay.
  • Expected negative control from source inspection: removing the spare before the injected failed Reset leaves aside empty and fails the first ownership assertion. Not executed.
  • No claim of a measured memory reduction or a fix for the retail title's watchdog/null-write crash.

AI use
Codex (GPT-6) inspected the code, wrote the patch/regression and prepared this description. The exact backend model identifier was not provided in this session.

<!-- greyfinch-sync:ivall/xcl:issue:6579603456 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1009). Originally posted by [nova-aryan](https://github.com/nova-aryan) on 2026-11-24T10:20:31Z. --- A failed Reset of a reusable command allocator currently removes that spare from its owner's pool before returning the error. Keep it owned and available until Reset succeeds, so a retry uses the same backing instead of abandoning it and allocating another. Fixes #1004. Independent of #994: that PR handles failure to create a new replacement; this handles failure to reset an existing spare. **What is in it** - `alloc_pool.rs`: publish the reuse transition only after successful Reset. Extract the existing transition into a private helper taking the native Reset call, so an isolated regression can inject two failures and a successful retry without a device or shared global state. - `README.md`: document retry behavior. One commit, no dependencies or game data. **Tested** - Source review on main `6efdabc`; `git diff --check`: exit 0. - Regression added for retained ownership, unchanged current backing/recording, reuse of the same spare, and exactly one successful swap. No tests, builds or GPU/game workloads were run locally, at the user's request. **Regression run** Not run. Main/head retail smoke blocks are missing; keep this a draft pending Windows validation. **Not tested** - Compilation, the new regression's execution, the full workspace/GPU suite, actual driver failures and retail gameplay. - Expected negative control from source inspection: removing the spare before the injected failed Reset leaves `aside` empty and fails the first ownership assertion. Not executed. - No claim of a measured memory reduction or a fix for the retail title's watchdog/null-write crash. **AI use** Codex (GPT-6) inspected the code, wrote the patch/regression and prepared this description. The exact backend model identifier was not provided in this session.
upstream-sync closed this pull request 2026-11-24 11:05:23 +00:00
ivall commented 2026-11-24 11:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T10:46:56Z.


Thanks – your commit is f52ec36 on main. Merged into main together with #1009, #1012 and #1023 (merge 384f7f7). Taken without its README sentence: the README tells users what works, and these are internal details. #1012 and #1023 both added code right after move_list and tests at the same place; the conflicts were resolved by keeping both.

Tested on the merged tree (it was not run before, so here it is):

  • cargo build --workspace: no warnings. cargo test --workspace --no-fail-fast -- --test-threads=4: 737 passed, 0 failed, 41 ignored, no SKIPPED.
  • Each new test fails with its fix undone: a_spare_whose_reset_fails_stays_available_for_retry (spare removed before the Reset), released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing (no forget_list in on_release), reset_commits_state_only_after_native_success_and_always_restores_vtable (association committed on a failed Reset).
  • Retail title, 90 s with scripted presses, against main before it the same way: no crash, no device removal, exit 0; 1500 frames against 1200; peak process commit 29.2 GB against 29.7 GB; the same allocator swap counts.
<!-- greyfinch-sync:ivall/xcl:comment:7129237028 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1009#issuecomment-7129237028). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T10:46:56Z. --- Thanks – your commit is f52ec36 on `main`. Merged into `main` together with #1009, #1012 and #1023 (merge 384f7f7). Taken without its README sentence: the README tells users what works, and these are internal details. #1012 and #1023 both added code right after `move_list` and tests at the same place; the conflicts were resolved by keeping both. **Tested** on the merged tree (it was not run before, so here it is): - `cargo build --workspace`: no warnings. `cargo test --workspace --no-fail-fast -- --test-threads=4`: 737 passed, 0 failed, 41 ignored, no SKIPPED. - Each new test fails with its fix undone: `a_spare_whose_reset_fails_stays_available_for_retry` (spare removed before the Reset), `released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing` (no `forget_list` in `on_release`), `reset_commits_state_only_after_native_success_and_always_restores_vtable` (association committed on a failed Reset). - Retail title, 90 s with scripted presses, against `main` before it the same way: no crash, no device removal, exit 0; 1500 frames against 1200; peak process commit 29.2 GB against 29.7 GB; the same allocator swap counts.

Pull request closed

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!1002
No description provided.