Skip to content

fix(gpu/run): keep descriptor heaps alive, harden device loss handling - #239

Open
racknea wants to merge 1 commit into
ivall:mainfrom
racknea:patch-1
Open

racknea wants to merge 1 commit into
ivall:mainfrom
racknea:patch-1

Conversation

@racknea

@racknea racknea commented Nov 23, 2026

Copy link
Copy Markdown

No description provided.

@denio4321

Copy link
Copy Markdown

Tested cc124cf merged onto main 9ab7d76 on RTX 3060 12 GB (Ampere, 32-lane waves), NVIDIA 610.88, Windows 11 Pro 23H2 (22631), rustc 1.100.0 MSVC, DXC 1.9.2602.17.

.\scripts\test.ps1 (debug, --test-threads=4), no XCL_SAMPLE_* set. Baseline main 9ab7d76 alone on the same machine: 651 passed, 0 failed, 40 ignored.

  • This PR: 651 passed, 0 failed, 40 ignored, the same as main. Nothing regresses in the GPU tests that go through gpu/run.
  • The PR adds no test, and the suite never loses the device, so the device-loss path it changes isn't exercised by this run. A short description of what failed before (which heap was released early, and where) would make the 500 / 474 line rewrite easier to review.

AI-assisted (Claude Code).

@Kalmarv

Kalmarv commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Please keep the empty-draw heap fix and revise device removal before merging. Two controls on an RTX 5070 Ti showed where recovery breaks.

  1. A timeout removes the caller’s healthy device. I held an idle queue behind a CPU fence for 11.5 seconds. Both builds returned the ten-second timeout. On main, GetDeviceRemovedReason returned S_OK and the submission fence completed after release. On the merge it returned DXGI_ERROR_DEVICE_REMOVED (0x887A0005). No shader ran. Both draw_on_multi and dispatch_on pass a caller-owned device to this helper. Keep submitted resources alive until completion or confirmed removal and leave device-wide recovery to the owner. Error path · D3D12 removal semantics
  2. One failed recreation disables later retries. I retained a second device reference during explicit removal and the first retry. After releasing it, an independent init() succeeded on the merge, but the public runner still returned the cached removal error. Cache successful recreation and leave the slot empty on a transient failure. Cache path · D3D12 device identity

Tested

Windows 11 Pro 26200.9711, Ryzen 9 9950X, RTX 5070 Ti, NVIDIA 610.74, native D3D12, DXC 1.7.2308.16. Local merge 61583594e366877a62fb109066626dadedd0836a of head cc124cf80159f160da0505ac79e4d340b82afa60 onto main 7a033c8cd13194900cd49c01ed60a59c6c9559c7. The PR adds no tests.

Local synthetic control Main Merge
Empty-texture, empty-sampler draw Heap owner dropped before submission. Assertion stopped the draw. Owner survived the fence. Read back red and observed release on return.
Poisoned GPU mutex and explicit removal with no other owner Next lookup panicked or next allocation failed, respectively Both recovered
Short texture, seven-face cube, private zero-window arena Panicked, accepted, panicked All three returned errors
Two static samplers through run_code, stopping after PSO creation E_INVALIDARG PSO created
Valid UMA dispatch, with separate drop counters for the temporary window list and bound heaps Neither counter advanced Both advanced. Shader output matched main.

On the unmodified merge, cargo test -p xcl -j2 --lib --no-run followed by the binary with gpu::recomp:: --test-threads=1 reported 182 passed, 0 failed, 18 ignored, including two native-wave64 skips and one sample-dependent early return. Queued runs of the fence tests (5), compute integration tests (2), predication integration test (1), UMA test (1) and static-sampler test (1) passed on both builds. The 11 review controls above and in the findings ran individually in fresh processes. Nine failed on main and passed on the merge, one regressed, and one failed on both.

Merge order. Each head conflicts with #239 in runner.rs. Rebase #214 (bf2a27e) after #187 (c74b03a) and preserve #187’s populated window UAV heap in both arena and compute dispatch. #214 already conflicts with main in real.rs. Preserve #152’s cached draw queue and increasing fence value (4ba00d9) when applying the lifetime fix. Its conflicts in recomp/mod.rs and tests.rs already exist on main.

Not tested

The retail game, AMD, WARP, a real driver TDR, or timing changes from I/O packing, barrier batching and removing the second map. The static-sampler control checked PSO creation only. An initial invalid-DXIL arena probe terminated without an assertion result and is excluded from the counts.

🤖 GPT-6.2 Astra

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.

3 participants