D3D12.X: preserve busy allocators when replacement fails #988
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/994"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by nova-aryan on 2026-11-24T10:04:51Z.
When a busy command allocator needs another backing, failure in
GetDeviceorCreateCommandAllocatorcurrently returnsNonefromtitle_reset. The caller interprets that as permission to reset the original allocator, even though its recordings are still held. Return the failure HRESULT instead and preserve the backing and recording associations. Fixes #989.This is a failure-path fix following #897/#907. It does not establish the cause of the retail world-loading watchdog or null-write reports.
What is in it
alloc_pool.rs: propagate replacement errors instead of falling through to the original Reset; synthetic COM regression for device-lookup failure, allocation failure, retries, recording associations and reference cleanup.README.md: describe failed replacement behavior. One commit, no new dependencies or game data.Tested
9aec53d.git diff --check: exit 0.main@02bfd1d, Windows 11 10.0.26300, RTX 5090 driver 621.24, Rust 1.100.0/MSVC 14.44.35207, debug;cargo test --workspace -- --test-threads=4: 728 passed, 0 failed, 41 ignored versus baseline 727/0/41. Report prepared using opencode (model not specified). This is an external patch-on-main run, not an exact-head retail smoke run; GPU skip counts were not reported.Regression run
Not run. Main/head retail smoke blocks are missing; this remains a draft pending Windows validation.
Not tested
Nonefor both injected failures, so the new HRESULT assertions should fail. This has not been executed.AI use
Codex (GPT-6) inspected the code, wrote the patch and regression, and prepared this description. The exact backend model identifier was not provided in this session.
Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T10:13:52Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@02bfd1d(baseline 727 passed, 0 failed, 41 ignored on this box):One more passing test than the baseline: preserving busy allocators when a replacement fails is exercised and green.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T11:55:31Z.
Heads-up: this branch no longer merges cleanly.
Rebuild today:
pull/994/headonto current main fails to merge - main took PRs #1009 and #1012 (384f7f7, the allocator pool: failed Resets / released lists), which touch the same allocator-recording code this PR'spreserve busy allocators when replacement failssits on. CI here is description-check-only, so the conflict won't surface beyond the merge button. Untested until rebased; I can run it on RDNA3/Wine after that (my allocator-adjacent rows: #1012/#1023 lanes were green here today).Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the checks and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:20:22Z.
Independent check — this branch no longer merges cleanly into current
main384f7f7.git merge upstream/mainconflicts incrates/xcl/src/hle/d3d12x/alloc_pool.rs(tests module, two hunks). It is not just textual: main's merged allocator-pool work (#1009/#1012/#1023) addeda_spare_whose_reset_fails_stays_available_for_retryandreleased_lists_leave_only_live_recordings_and_gpu_work_holding_the_backingin the same spot, and both sides defineunsafe extern "system" fn releasewith different signatures (Device refs vs Fence releases) plus share theunexpected_call/SLOTscaffolding — so the resolution needs a rename, not just keeping both blocks.Until rebased, the new test
a_failed_replacement_keeps_the_busy_allocatorcannot run against current main. (I did not resolve it locally — the fix belongs to the author.)AI use: merge test by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:09:53Z.
Regression run of
ff3182f9on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T07:59:55Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:36:31Z.
Triage (#1607) – head
ff3182fMain already does what this PR fixes. Since
8303b3a("D3D12.X: reset allocator backings outside global state"), theResetWork::Createbranch ofalloc_pool::title_resetturns aGetDeviceerror, a missing device and aCreateCommandAllocatorerror intoSome(error), aftercancel_reset. It no longer returnsNone, soalloc_resetdoes not fall back to resetting the busy allocator, and the backing and list associations are left as they were.This PR's
title_resethunk targets the old function body and conflicts. Its mock-COM test could still be useful on top of main as a separate test-only PR. The README line is not needed. #989 can be closed against8303b3a.Recommendation: close (superseded by main commit
8303b3a).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:41:39Z.
Closing as superseded: this change is already on
main(8303b3a1). main alloc_pool.rs ResetWork::Create returns the GetDevice/CreateCommandAllocator HRESULT and cancel_reset(token) instead of returning None; PR's mock-COM test and README sentence are the only remainderTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed