Skip to content

Keep the run going when a host command list will not close - #3975

Open
dragoncello357 wants to merge 1 commit into
trustno1-coder:mainfrom
dragoncello357:close-refused-3823
Open

dragoncello357 wants to merge 1 commit into
trustno1-coder:mainfrom
dragoncello357:close-refused-3823

Conversation

@dragoncello357

Copy link
Copy Markdown

[pr-fix] Keep the run going when a host command list will not close

Fixes #
Refs #3823 (a mitigation: it does not close the issue)

What it changes

A host list that fails Close() (0x80070057) used to end the run. Now its work for that frame is dropped, the list is reset and closed empty, and the run goes on. After the device is lost, or after 1000 refusals, it fails as before. The warning is logged on the 1st, 2nd, 4th... refusal.

This does not fix the invalid command behind the failure; that is what #3792 and #3488 go at. A frame can show a glitch where the list's work was dropped, and state the dropped commands changed (texture states) is not put back.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 5060 Ti 16 GB, Series X profile, 2560x1440 output, DLSS Quality, frame generation off
  • Before: the run ended with "a host command list did not close (0x80070057)" in the prologue, about 9 minutes in (diagnostics build)
  • After: it builds (release and diagnostics). The error did not happen again in my run, so the recovery itself has not been seen working in play
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a
  • cargo test passed for the crates it touches: Yes, it run for this change

Checked for overlap

A list that fails Close() is reset and closed empty instead of ending the run (up to 1000 times). Mitigates, does not fix, the invalid command behind it. Refs Ex. trustno1-coder#3823.
@tyr0nsur

Copy link
Copy Markdown
Contributor

I reproduced a blocker for the recovery at 37caf45 on Windows with both an RTX 4060 and WARP, with the D3D12 debug layer off. Using two 64-byte buffers, record CopyBufferRegion(dst, 64, src, 0, 4) on a fresh DIRECT list, then call Close() without submitting it.

Operation RTX 4060 and WARP
Failed list Close() 0x80070057
Allocator Reset() S_OK
Failed list Reset(), with the original or a fresh allocator 0x80070057
Replacement list Close() and queue fence Both succeed

In this PR, HostList::close_refused calls self.reset(), whose same-list Reset failure is fatal. The empty Close and the refusal limit therefore never get a chance to recover this case. Both devices stayed healthy in the probe. This matches the D3D12 Reset contract.

A recovery path needs a fresh command-list object and must account for discarded barriers, uploads and readbacks before later work consumes them. #3488 already contains a forced-failure and replacement test that could be reused. The synthetic case here verifies the Reset contract. The original invalid command in #3823 still needs identification.

@dyshay

dyshay commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Merged for testing into our integration branch dyshay/VIctory-NVIDIA janus-prs. Builds and the targeted CPU tests pass; a run on an RTX 4090 (Series S, hardware RT) is queued and I'll post the result here.

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.

4 participants