Preserve the shader book when startup cannot read it #4868
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by senduora on 2026-12-01T12:07:56Z.
What 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
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T13:01:42Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.