Repository navigation
Conversation
HailLucifer666
added a commit
to HailLucifer666/victory-fork
that referenced
this pull request
Nov 25, 2026
…o write THE BUG. save() cleared both dirty flags before either write landed: it stored 0 into the library's added count before replace_library() renamed the serialised bytes into place, and it cleared the early list's changed flag before write_atomically() wrote that list. When a rename failed (the target held by a folder, the file held open, a system refusing to replace a mapped file), the retry found nothing dirty and returned: the pipelines this run had added, and the title pipelines it had noted for an early start, were lost with the process. WHY NOT HYPOTHETICAL. avt0m4t48 reproduced it on baf1154 and on main (2119b0e): with the obstruction removed, a second save(true) returned without writing the pending data. Both destinations replace_library() tries have to fail for the library to be lost, but the early list is one write and fails on its own. THE FIX. publish() puts the library and the early list in place and clears the dirty state for exactly what reached the disk: the added count is acknowledged with fetch_sub(snapshot) only after the rename succeeds, so stores that arrived while the library was being serialised stay pending, and a write that did not land sets the early list's flag again. A serialise failure restores it too. SCOPE. The rest of the save path is unchanged: the same lock, the same unique staging file, the same order. The startup ordering change in fxceless#211 is not part of this. Three tests, three probes: acknowledging the stores before the rename, clearing every store instead of the snapshot, and dropping the early-list restore each fail the test named for it. Co-authored-by: avt0m4t48 <avt0m4t48@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #27 and #164. If one save falls back to
host-pipelines.nextand the next save can replacehost-pipelines.bindirectly, startup promotes the older pending file over the newer save. Keep publishing to the pending path while it exists. Startup can then promote the latest successful save.Both source-built filesystem tests pass on native Windows in mapped and buffered modes. The Linux buffered-mode probe reproduced rollback on main, #147 and #164. The control where both saves must use the fallback passes before and after the change. Windows tests
The ordering guarantee covers successive saves. #164 adds separate same-process save serialization. Cross-process coordination and application startup performance were outside these tests. AI-assisted using Codex.