D3D12.X: keep allocator recordings held on device removal #2831

Open
github-bot wants to merge 1 commit from github-bot/gh-2831 into nvidia-dev AGit
Owner

@⁠rafelis1997 on GitHub · 2026-11-26 16:24 UTC · original
rafelis1997:fix/allocator-fence-removal → nvidia-dev · +28 −6 · 1 files · 1 commits · draft

Part of #2688 (WS2). Reproduction and discussion.

ID3D12Fence::GetCompletedValue() returns UINT64_MAX on device removal. The allocator used a numeric comparison to retire a backing and the inverse comparison to decide whether a list was still in flight. The removal sentinel satisfied both tests for successful completion. This changes reuse eligibility after removal. The original cause of device removal remains under investigation. D3D12 fence contract

What is in it

  • Add one completion predicate in alloc_pool.rs. Use it for both backing retirement and the list's in-flight check. Keep the bounded queue-wait path's immediate exit on a removed device.
  • Extend the existing fake COM fence regression to cover valid completion, removal, releasing the last list, and immediate return from the wait.
  • Base nvidia-dev at af2cecc40886a8682ecf3267f5328c6dc4b66ad7; head 965806a09804384324dc6cec463afa51c00b0822. The related mesh reclaim path is still in #2815. Its author can use the same predicate there.

Tested

  • Windows 11 Pro build 26200, Ryzen 7 5700X3D, RTX 5070 Ti 16 GB, NVIDIA driver 616.92. The regression is CPU-only. Used rustc 1.100.0 --test --edition 2021 in debug mode, compiling the real allocator module with a synthetic COM fence and shims for surrounding runtime dependencies.
  • Ran released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing with the head's assertions against both implementations. Base: 0 passed, 1 failed at device removal must not make the list reusable. Head: 1 passed, 0 failed, 0 ignored, 7 filtered out.
  • git show --check HEAD passed.

Regression run

Paired clean-tree game smoke runs are pending. The reported retail trace in the linked issue comment came from a separate experimental tree.

Not tested

The full Windows workspace suite and the two clean-tree GPU smokes are pending for this commit. This draft makes no FPS, VRAM savings, or device-loss prevention claim. The integrated synthetic test can be run with cargo test -p xcl --lib released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing.

AI use

OpenAI Codex (GPT-6) investigated the issue, wrote the patch and regression, ran the isolated test, and prepared the PR description.

**@⁠rafelis1997** on GitHub · 2026-11-26 16:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/2831) `rafelis1997:fix/allocator-fence-removal` → `nvidia-dev` · +28 −6 · 1 files · 1 commits · draft Part of #2688 (WS2). [Reproduction and discussion](https://git.gtahub.st/github/xcl-dev--xcl/issues/2688). `ID3D12Fence::GetCompletedValue()` returns `UINT64_MAX` on device removal. The allocator used a numeric comparison to retire a backing and the inverse comparison to decide whether a list was still in flight. The removal sentinel satisfied both tests for successful completion. This changes reuse eligibility after removal. The original cause of device removal remains under investigation. [D3D12 fence contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12fence-getcompletedvalue) **What is in it** - Add one completion predicate in `alloc_pool.rs`. Use it for both backing retirement and the list's in-flight check. Keep the bounded queue-wait path's immediate exit on a removed device. - Extend the existing fake COM fence regression to cover valid completion, removal, releasing the last list, and immediate return from the wait. - Base `nvidia-dev` at `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`; head `965806a09804384324dc6cec463afa51c00b0822`. The related mesh reclaim path is still in [#2815](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2815). Its author can use the same predicate there. **Tested** - Windows 11 Pro build 26200, Ryzen 7 5700X3D, RTX 5070 Ti 16 GB, NVIDIA driver 616.92. The regression is CPU-only. Used `rustc 1.100.0 --test --edition 2021` in debug mode, compiling the real allocator module with a synthetic COM fence and shims for surrounding runtime dependencies. - Ran `released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing` with the head's assertions against both implementations. Base: 0 passed, 1 failed at `device removal must not make the list reusable`. Head: 1 passed, 0 failed, 0 ignored, 7 filtered out. - `git show --check HEAD` passed. **Regression run** Paired clean-tree game smoke runs are pending. The reported retail trace in the linked issue comment came from a separate experimental tree. **Not tested** The full Windows workspace suite and the two clean-tree GPU smokes are pending for this commit. This draft makes no FPS, VRAM savings, or device-loss prevention claim. The integrated synthetic test can be run with `cargo test -p xcl --lib released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing`. **AI use** OpenAI Codex (GPT-6) investigated the issue, wrote the patch and regression, ran the isolated test, and prepared the PR description.
An XCL fence reads UINT64_MAX after device loss. It cannot confirm that a submitted command list or its allocator backing is free to reuse. Keep the bounded resubmit wait terminal on removal.

The synthetic fence regression exercises both reuse decisions and checks that a removed fence is never selected for polling. Part of #2688.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 16:27:22 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2831/head:github-bot/gh-2831'
git switch 'github-bot/gh-2831'

Merge

Merge the changes and update on Forgejo.
git switch 'nvidia-dev'
git merge --no-ff 'github-bot/gh-2831'
git switch 'github-bot/gh-2831'
git rebase 'nvidia-dev'
git switch 'nvidia-dev'
git merge --ff-only 'github-bot/gh-2831'
git switch 'github-bot/gh-2831'
git rebase 'nvidia-dev'
git switch 'nvidia-dev'
git merge --no-ff 'github-bot/gh-2831'
git switch 'nvidia-dev'
git merge --squash 'github-bot/gh-2831'
git switch 'nvidia-dev'
git merge --ff-only 'github-bot/gh-2831'
git switch 'nvidia-dev'
git merge 'github-bot/gh-2831'
git push origin 'nvidia-dev'
This discussion has been locked. Commenting is limited to contributors.
No description provided.