Support transactional file replacement on Windows x64 #3

Closed
opened 2026-12-02 18:13:38 +00:00 by faumaray · 1 comment
Owner

At revision 7b0fea6095f603f9e1904f66dfdc7752f4be4792, Void::FileSystem::replace_file (and the atomic_write convenience API) in include/Void/System/Path.hpp returns SystemErrorCode::unsupported on Windows. The settlement game needs to publish a completed save snapshot on the same volume while readers may open the previous version.

A small contract test can start with an existing slot containing A, request replacement with B, and inject failures before the publish operation. Before publication the old contents must remain readable and intact. After a successful publish, readers may observe the entire old or entire new file. Cover first creation, replacement of an existing file, Unicode paths, and exclusive temporary-file naming. Cleanup must never delete the live destination. Return an explicit phase and visibility/durability result if failure occurs after visibility changed. Document the Windows guarantees available for each durability level, including the distinction between an application crash and power loss.

This would let the game replace its Windows-specific slot publication path with the public library API after the same regression cases pass under Windows x64.

At revision `7b0fea6095f603f9e1904f66dfdc7752f4be4792`, `Void::FileSystem::replace_file` (and the `atomic_write` convenience API) in `include/Void/System/Path.hpp` returns `SystemErrorCode::unsupported` on Windows. The settlement game needs to publish a completed save snapshot on the same volume while readers may open the previous version. A small contract test can start with an existing slot containing A, request replacement with B, and inject failures before the publish operation. Before publication the old contents must remain readable and intact. After a successful publish, readers may observe the entire old or entire new file. Cover first creation, replacement of an existing file, Unicode paths, and exclusive temporary-file naming. Cleanup must never delete the live destination. Return an explicit phase and visibility/durability result if failure occurs after visibility changed. Document the Windows guarantees available for each durability level, including the distinction between an application crash and power loss. This would let the game replace its Windows-specific slot publication path with the public library API after the same regression cases pass under Windows x64.
Author
Owner

Implemented on branch issue/3-windows-transactional-replace (commit 51ceb08).

Windows x64 replace_file/atomic_write implemented (exclusive staging, MoveFileExW publication, durable flush) with a portable contract test suite and documented crash-vs-power-loss guarantees.

Branch: https://git.faumaray.com/Void/Library/src/branch/issue/3-windows-transactional-replace
Merge request: https://git.faumaray.com/Void/Library/pulls/new/issue/3-windows-transactional-replace

Implemented on branch `issue/3-windows-transactional-replace` (commit `51ceb08`). Windows x64 `replace_file`/`atomic_write` implemented (exclusive staging, MoveFileExW publication, durable flush) with a portable contract test suite and documented crash-vs-power-loss guarantees. Branch: https://git.faumaray.com/Void/Library/src/branch/issue/3-windows-transactional-replace Merge request: https://git.faumaray.com/Void/Library/pulls/new/issue/3-windows-transactional-replace
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#3