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

Closed
github-bot wants to merge 1 commit from github-bot/gh-3975 into main AGit
Owner

@⁠dragoncello357 on GitHub · 2026-11-30 13:30 UTC · original
dragoncello357:close-refused-3823 → main · +40 −4 · 1 files · 1 commits · closed without merging

[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

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3488 (also survives a failed Close, wider change), #3792 (a cause of the same error), #3776, #3487
**@⁠dragoncello357** on GitHub · 2026-11-30 13:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975) `dragoncello357:close-refused-3823` → `main` · +40 −4 · 1 files · 1 commits · closed without merging [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 - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3488 (also survives a failed Close, wider change), #3792 (a cause of the same error), #3776, #3487
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. #3823.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 13:34:52 +00:00
Author
Owner

@⁠andrelcalado on GitHub · 2026-11-30 13:31 UTC · original · approved these changes

**@⁠andrelcalado** on GitHub · 2026-11-30 13:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#pullrequestreview-6113035245) · **approved these changes**
Author
Owner

@⁠tyr0nsur on GitHub · 2026-11-30 13:35 UTC · original

I reproduced a blocker for the recovery at 37caf458 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.

**@⁠tyr0nsur** on GitHub · 2026-11-30 13:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#issuecomment-7280062362) I reproduced a blocker for the recovery at 37caf458 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](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-reset#runtime-validation). 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.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 14:53 UTC · original

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.

**@⁠dyshay** on GitHub · 2026-11-30 14:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#issuecomment-7282096973) Merged for testing into our integration branch [dyshay/VIctory-NVIDIA `janus-prs`](https://github.com/dyshay/VIctory-NVIDIA/tree/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.
Author
Owner

@⁠tillo88 on GitHub · 2026-11-30 17:58 UTC · original

Measured #3975 (head 37caf458) merged on top of v2026.11.30.01: 6 measured runs plus 1 warm-up, against 7 measured runs of plain v2026.11.30.01.

The recovery fired in play, but the run still ended. 2 of the 7 runs (the warm-up and measured run 1) hit the known #2237 failure at the prison-to-plane cut (+2:16 and +2:37 after the log starts, the same two spots as the base). In both, the new path logged and then the list Reset failed 36 µs later and ended the run:

WARN victory_gpu::host: a host command list did not close: its work this frame is given up and it closes empty (...) error=Parametro non corretto. (0x80070057) times=1
ERROR victory_gpu::host: a host command list did not reset (Parametro non corretto. (0x80070057)); ...
VIctory: host GPU failure: a host command list did not reset (Parametro non corretto. (0x80070057))

This matches tyr0nsur's synthetic finding above (resetting the same list after a failed Close() returns 0x80070057). On this route the mitigation does not keep the run going. For reference, the base had this failure in 1 of 9 runs on v2026.11.30.01 (warm-ups counted) and 14 of 43 on v2026.11.29.05, so 2 of 7 does not show a change either way.

Speed (the 5 runs that finished, against 7 base runs): no measurable difference. The base runs spread from 32.96 to 33.96 fps.

runs fps (mean, range) submitting thread ms refresh ms p95 ms p99 ms
v2026.11.30.01 7 33.57 (32.96-33.96) 21.25 6.74 47.29 62.92
+ #3975 5 33.60 (33.30-33.99) 20.98 6.57 47.44 65.92

Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X profile at 1440p, DLSS Quality, frame generation off, ray tracing off. Route: the same save restored before each run (start of the game), prison cutscene, plane cutscene, first boat section, about 6 minutes.

Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.

**@⁠tillo88** on GitHub · 2026-11-30 17:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#issuecomment-7287135408) Measured #3975 (head 37caf458) merged on top of v2026.11.30.01: 6 measured runs plus 1 warm-up, against 7 measured runs of plain v2026.11.30.01. **The recovery fired in play, but the run still ended.** 2 of the 7 runs (the warm-up and measured run 1) hit the known #2237 failure at the prison-to-plane cut (+2:16 and +2:37 after the log starts, the same two spots as the base). In both, the new path logged and then the list `Reset` failed 36 µs later and ended the run: ``` WARN victory_gpu::host: a host command list did not close: its work this frame is given up and it closes empty (...) error=Parametro non corretto. (0x80070057) times=1 ERROR victory_gpu::host: a host command list did not reset (Parametro non corretto. (0x80070057)); ... VIctory: host GPU failure: a host command list did not reset (Parametro non corretto. (0x80070057)) ``` This matches tyr0nsur's synthetic finding above (resetting the same list after a failed `Close()` returns 0x80070057). On this route the mitigation does not keep the run going. For reference, the base had this failure in 1 of 9 runs on v2026.11.30.01 (warm-ups counted) and 14 of 43 on v2026.11.29.05, so 2 of 7 does not show a change either way. Speed (the 5 runs that finished, against 7 base runs): no measurable difference. The base runs spread from 32.96 to 33.96 fps. | | runs | fps (mean, range) | submitting thread ms | refresh ms | p95 ms | p99 ms | |---|---|---|---|---|---|---| | v2026.11.30.01 | 7 | 33.57 (32.96-33.96) | 21.25 | 6.74 | 47.29 | 62.92 | | + #3975 | 5 | 33.60 (33.30-33.99) | 20.98 | 6.57 | 47.44 | 65.92 | Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X profile at 1440p, DLSS Quality, frame generation off, ray tracing off. Route: the same save restored before each run (start of the game), prison cutscene, plane cutscene, first boat section, about 6 minutes. Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
Author
Owner

@⁠Lag0 on GitHub · 2026-11-30 21:02 UTC · original

Data point from a long run with this PR applied: the recovery path itself can fail.

Build: v2026.11.30.02 + this PR + #3487 (diagnostics build).
Setup: RTX 4080 16 GB, driver 32.0.16.2140, Series X profile, 2560x1440 output, DLSS Quality, frame generation on, ray tracing off.

What happened

  • The run lasted 1 h 56 min. Without this PR, the same kit ended at 21.5 min with "a host command list did not close (0x80070057)".
  • The first close refusal of the whole run came at 1 h 56 min. close_refused caught it and logged the warning (times=1).
  • The self.reset() call inside close_refused then failed with the same code, so the run ended there:
WARN victory_gpu::host: a host command list did not close: its work this frame is given up and it closes empty (...) error=The parameter is incorrect. (0x80070057)
ERROR victory_gpu::host: a host command list did not reset (The parameter is incorrect. (0x80070057)); a diagnostics build with VICTORY_D3D12_DEBUG=1 names the command
VIctory: host GPU failure: a host command list did not reset (The parameter is incorrect. (0x80070057)); a diagnostics build with VICTORY_D3D12_DEBUG=1 names the command

Memory at the failure: 13.5 of 15.1 GB of the card's budget in use, 6.8 GB shared, 35 GB committed. Commit rose slowly through the run, from about 30 GB at 13 min to 35 GB at 1 h 56 min. The device was not removed: the removed check did not fire, so the path went on to reset.

So when Close() fails, Reset() on the same list can be refused too. Two possible fallbacks: create a fresh list on that allocator, or drop the frame and recreate the list and allocator pair, rather than ending the run. Related: #2053 (the same reset failure, there with 0x8007000E).

The debug layer was off, so the command behind the refusal is not named.

**@⁠Lag0** on GitHub · 2026-11-30 21:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#issuecomment-7291837951) Data point from a long run with this PR applied: the recovery path itself can fail. **Build:** v2026.11.30.02 + this PR + #3487 (diagnostics build). **Setup:** RTX 4080 16 GB, driver 32.0.16.2140, Series X profile, 2560x1440 output, DLSS Quality, frame generation on, ray tracing off. **What happened** - The run lasted 1 h 56 min. Without this PR, the same kit ended at 21.5 min with "a host command list did not close (0x80070057)". - The first close refusal of the whole run came at 1 h 56 min. `close_refused` caught it and logged the warning (times=1). - The `self.reset()` call inside `close_refused` then failed with the same code, so the run ended there: ``` WARN victory_gpu::host: a host command list did not close: its work this frame is given up and it closes empty (...) error=The parameter is incorrect. (0x80070057) ERROR victory_gpu::host: a host command list did not reset (The parameter is incorrect. (0x80070057)); a diagnostics build with VICTORY_D3D12_DEBUG=1 names the command VIctory: host GPU failure: a host command list did not reset (The parameter is incorrect. (0x80070057)); a diagnostics build with VICTORY_D3D12_DEBUG=1 names the command ``` **Memory at the failure:** 13.5 of 15.1 GB of the card's budget in use, 6.8 GB shared, 35 GB committed. Commit rose slowly through the run, from about 30 GB at 13 min to 35 GB at 1 h 56 min. The device was not removed: the `removed` check did not fire, so the path went on to reset. So when Close() fails, Reset() on the same list can be refused too. Two possible fallbacks: create a fresh list on that allocator, or drop the frame and recreate the list and allocator pair, rather than ending the run. Related: #2053 (the same reset failure, there with 0x8007000E). The debug layer was off, so the command behind the refusal is not named.
@ -9832,0 +9860,4 @@
"a host command list did not close: its work this frame is given up and it closes empty (the debug layer, VICTORY_D3D12_DEBUG=1 in a diagnostics build, names the command)"
);
}
self.reset();
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 01:29 UTC · original

I independently reproduced the Reset failure on an RTX 4060 (621.14) and on WARP. With private 64-byte buffers, a valid copy closed and reset successfully. A two-byte copy reading from byte 63 made Close() return 0x80070057. Resetting that same list returned 0x80070057 with both the original and a fresh allocator. A newly created empty list closed successfully and the device remained healthy. I did not submit any list. D3D12 Reset contract

Here self.reset() still calls Reset on the rejected list and terminates on that error. #3488 reports the same behavior and uses a replacement command list. Any recovery here would need a replacement too, with an explicit plan for the resource states and effects of the work it discards.

**@⁠tyr0nsur** on GitHub · 2026-12-01 01:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#discussion_r4747977104) I independently reproduced the Reset failure on an RTX 4060 (621.14) and on WARP. With private 64-byte buffers, a valid copy closed and reset successfully. A two-byte copy reading from byte 63 made `Close()` return `0x80070057`. Resetting that same list returned `0x80070057` with both the original and a fresh allocator. A newly created empty list closed successfully and the device remained healthy. I did not submit any list. [D3D12 Reset contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-reset#runtime-validation) Here `self.reset()` still calls `Reset` on the rejected list and terminates on that error. #3488 reports the same behavior and uses a replacement command list. Any recovery here would need a replacement too, with an explicit plan for the resource states and effects of the work it discards.
github-bot closed this pull request 2026-12-01 18:50:53 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:47 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3975#issuecomment-7321548629) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3975
No description provided.