D3D12.X: move allocator recordings only after successful Reset #1016

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

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


Native command-list Reset can fail while the old recording remains alive. list_x already preserves its old state in that case, but the preceding alloc_pool::for_list has moved the recording association to the requested allocator. Keep the old backing held until native Reset succeeds. Fixes #1018.

This extends #118's failure handling to the allocator tracking introduced by #897. Independent of #994, #1009 and #1012.

What is in it

  • alloc_pool.rs: replace the preparation-only call with reset_list, which snapshots the selected PC backing, calls native Reset without a pool lock, and commits the association only on success.
  • list_x.rs: use it for normal Reset, KickoffX reopening and split-segment reuse. Extend the existing synthetic Reset regression to check the old association after failure and the new one after success; clean up its pool entries.
  • Update the existing GPU allocator-lifetime test to use the same transition and document failed Reset behavior in README.

Tested

  • Source inspection on main 6efdabc; all three production call sites updated, no for_list callers remain.
  • git diff --check: exit 0.
  • No local builds, tests, GPU workloads or game runs at the user's request. Regression assertions were added, not executed.

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

Not tested

  • Compilation, the extended synthetic/GPU regressions, full workspace/GPU suite and retail gameplay.
  • Expected negative control by source inspection: moving the association before native Reset would report backing 0x333 after the injected failure instead of the old 0x111. Not executed.
  • No claim that this resolves the retail title's current watchdog/null-write crash.

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

<!-- greyfinch-sync:ivall/xcl:issue:6579723510 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1023). Originally posted by [nova-aryan](https://github.com/nova-aryan) on 2026-11-24T10:27:25Z. --- Native command-list Reset can fail while the old recording remains alive. `list_x` already preserves its old state in that case, but the preceding `alloc_pool::for_list` has moved the recording association to the requested allocator. Keep the old backing held until native Reset succeeds. Fixes #1018. This extends #118's failure handling to the allocator tracking introduced by #897. Independent of #994, #1009 and #1012. **What is in it** - `alloc_pool.rs`: replace the preparation-only call with `reset_list`, which snapshots the selected PC backing, calls native Reset without a pool lock, and commits the association only on success. - `list_x.rs`: use it for normal Reset, KickoffX reopening and split-segment reuse. Extend the existing synthetic Reset regression to check the old association after failure and the new one after success; clean up its pool entries. - Update the existing GPU allocator-lifetime test to use the same transition and document failed Reset behavior in README. **Tested** - Source inspection on main `6efdabc`; all three production call sites updated, no `for_list` callers remain. - `git diff --check`: exit 0. - No local builds, tests, GPU workloads or game runs at the user's request. Regression assertions were added, not executed. **Regression run** Not run. Main/head retail smoke blocks are missing; keep this a draft pending Windows validation. **Not tested** - Compilation, the extended synthetic/GPU regressions, full workspace/GPU suite and retail gameplay. - Expected negative control by source inspection: moving the association before native Reset would report backing `0x333` after the injected failure instead of the old `0x111`. Not executed. - No claim that this resolves the retail title's current watchdog/null-write crash. **AI use** Codex (GPT-6) inspected the code, wrote the patch/regression updates 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:27 +00:00
ivall commented 2026-11-24 11:05:58 +00:00 (Migrated from github.com)

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


Thanks – your commit is 01d4c77 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:7129239936 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1023#issuecomment-7129239936). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T10:47:03Z. --- Thanks – your commit is 01d4c77 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!1016
No description provided.