Keep the run going when a host command list will not close #3975
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3975"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by dragoncello357 on 2026-11-30T13:30:27Z.
[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
cargo testpassed for the crates it touches: Yes, it run for this changeChecked for overlap
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T13:35:23Z.
I reproduced a blocker for the recovery at
37caf458on Windows with both an RTX 4060 and WARP, with the D3D12 debug layer off. Using two 64-byte buffers, recordCopyBufferRegion(dst, 64, src, 0, 4)on a fresh DIRECT list, then callClose()without submitting it.Close()0x80070057Reset()S_OKReset(), with the original or a fresh allocator0x80070057Close()and queue fenceIn this PR,
HostList::close_refusedcallsself.reset(), whose same-listResetfailure is fatal. The emptyCloseand 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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T14:53:39Z.
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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tillo88 on 2026-11-30T17:58:54Z.
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
Resetfailed 36 µs later and ended the run: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.
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lag0 on 2026-11-30T21:02:45Z.
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
close_refusedcaught it and logged the warning (times=1).self.reset()call insideclose_refusedthen failed with the same code, so the run ended there: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
removedcheck 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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T01:29:59Z.
Code review location:
crates/victory-gpu/src/host.rs; line 9863I 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()return0x80070057. Resetting that same list returned0x80070057with 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 contractHere
self.reset()still callsReseton 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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:47:23Z.
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