Preserve the shader book when startup cannot read it #4869
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4869
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4868"
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?
@senduora on GitHub · 2026-12-01 12:07 UTC · original
senduora:fix/preserve-shader-book-on-read-error→main· +43 −16 · 1 files · 1 commits · openWhat it changes
A failed shader-book scan used to return a byte offset, even when it could not open the file. Startup could then reopen the book for writing and truncate valid records. Propagate scan errors and repair a torn tail only after a successful scan. Successfully read records still count as known.
How it was tested
5fabb46.cargo test --locked --offline -p victory-gpu --lib pipeline::known::tests -- --nocapture --test-threads=1passed all 15 tests onc6f8f22, including the denied-open regression and successful torn-tail repair.Checked for overlap
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:01 UTC · original
I found another way for the startup repair to discard valid records on
c6f8f221. The scans stop at the length they measured. If another run appends beforereadchecks the file again, the new length exceeds the old scan end and can be trimmed as if it were a torn record. This affects both books.256a480e trims only a torn tail inside the scanned length, rechecks that length through a repair handle that excludes writers, and keeps the scanned file open until the operation finishes. An append can still run while the file is being scanned.
I used real Windows files and the exact startup readers with a callback that appended after the first record. The author head lost the new record in the shader and pipeline cases and trimmed a partial record while a writer was still open. The patch preserved both records in all three cases. The stable torn-tail control still trimmed both files, and staged policy passed for the one changed file.
Please keep the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change in.AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.