Retry incomplete pipeline book writes and flush on orderly exit #63
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!63
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-63"
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?
@Yoshi-233 on GitHub · 2026-11-26 01:14 UTC · original
Yoshi-233:fix/pipeline-book-flush-retry→main· +199 −21 · 7 files · 2 commits · merged 2026-11-26 08:17 UTCFixes #41.
On
0a43566, I forced either cache file to fail to open, removed the obstruction, and submitted the same pipeline again followed by a second one. The book remembered both keys, but only the second pipeline made it to disk. When the pipeline file was blocked, the first shader had already been appended.The writer now tracks the bytes each file actually accepted. A failed flush puts the unwritten suffix ahead of records noted during I/O. The timer and final save serialize their appends, and the title can continue recording pipelines while the disk is busy. The existing on-disk format and deduplication keys are preserved.
The last batch is also flushed when the title's main thread returns, before CRT teardown stops the other threads, and through the existing lifecycle save. The CRT hook runs under the existing shutdown watchdog. For fatal GPU errors, the runtime writes its crash report first, then wakes the existing book writer and waits up to 250 ms for the attempt before calling
TerminateProcess. The failing thread never acquires the book or writer lock. A stalled write or an external process kill can still lose the last batch. Thanks to sharan104 for suggesting the device-loss case in #88.Verification
Repeated both file-open failures on Linux in a CPU-only harness using the production recording, flush and readback functions with synthetic shader data. Before the change both runs read back pipeline IDs
[2]. With the change both read back[1, 2]and exactly two shader records, matching the no-failure control.Exercised a short write and retry. Also blocked a 2 MiB shader append on a Linux pipe, noted another pipeline while that write was pending, then failed the pipeline-file open. Both records were readable in order after retry. The two regression tests included in this PR and the extra pipe check passed in the harness.
Rust 1.98.1:
cargo check --target x86_64-pc-windows-gnu --locked --tests -p victory-gpu -p victory-loader -p victorypassed. The native Linux GPU and loader test binaries still hit the same Windows-only symbol errors as on the base commit. Windows shutdown and an actual game run remain untested here.For the fatal-path follow-up (
33439c8), I ran a Linux subprocess harness using the production book and writer with synthetic shaders. After the flush request the child exited immediately. A second process recovered both pipeline IDs and shader hashes in 20/20 healthy runs and 8/8 runs after a transient pipeline-file open failure. With a blocked file write (5 runs) or the book lock held by the caller (5 runs), the new hook returned in 250.1–250.3 ms. I also checked the regular two-second timer and the disabled and uninitialized cases.The Windows GNU target passed
cargo check --locked --testsfor the affected crates in default and diagnostics builds. Actual Windows device removal has not been exercised.AI-assisted implementation and testing with Codex.
@avatarmanz on GitHub · 2026-11-26 07:55 UTC · original
Merged into main in the next push (tests pass); thanks.