Rust: store replace on Windows tries POSIX-semantics rename first (store-windows-rs) #148

Merged
libby merged 6 commits from store-replace/windows-rs into main 2026-11-13 01:29:21 +00:00
Member

Cut variants:cut_spec:cut-store-windows-rs.r1, ruling variants:ruling:windows-replace-posix-first (operator, option c). Reports cut-store-windows-rs.h1 to .h3; Soul verdicts .s1 to .s3.

replace_with implements the ruled decision table over a ReplaceKernel seam (POSIX rename first; codes 1/50/87 fall back to write-through MoveFileExW for the rest of the call; 5/32/33 retry 25 x 20 ms; other codes error), tested with a fake kernel on Linux. The inline MoveFileExW loop is deleted.

Verified: Linux cargo test --locked; cargo check --locked --tests --target x86_64-pc-windows-gnu compiles the Windows FFI body and windows_replace_tests. Soul's Starfire probe confirmed the kernel behaviour the new delete-sharing-reader test relies on (POSIX rename returns 0, MoveFileExW returns 5).

Not verified: windows_replace_tests have never run on Windows (no Rust host on starfire), and the durability of the POSIX rename (no write-through flag) is unmeasured. Follow-up variants:follow_up:windows-replace-run-and-durability.

🤖 Generated with Claude Code

Cut `variants:cut_spec:cut-store-windows-rs.r1`, ruling `variants:ruling:windows-replace-posix-first` (operator, option c). Reports `cut-store-windows-rs.h1` to `.h3`; Soul verdicts `.s1` to `.s3`. `replace_with` implements the ruled decision table over a `ReplaceKernel` seam (POSIX rename first; codes 1/50/87 fall back to write-through MoveFileExW for the rest of the call; 5/32/33 retry 25 x 20 ms; other codes error), tested with a fake kernel on Linux. The inline MoveFileExW loop is deleted. **Verified:** Linux `cargo test --locked`; `cargo check --locked --tests --target x86_64-pc-windows-gnu` compiles the Windows FFI body and `windows_replace_tests`. Soul's Starfire probe confirmed the kernel behaviour the new delete-sharing-reader test relies on (POSIX rename returns 0, MoveFileExW returns 5). **Not verified:** `windows_replace_tests` have never run on Windows (no Rust host on starfire), and the durability of the POSIX rename (no write-through flag) is unmeasured. Follow-up `variants:follow_up:windows-replace-run-and-durability`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cultcache-rs: Windows store replace tries a POSIX-semantics rename first through a ReplaceKernel seam
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
531ff6755b
replace_with owns the decision table (POSIX first; 1/50/87 fall back to
MoveFileExW write-through for the rest of the call; 5/32/33 retry 25 x 20 ms;
else error), tested with a fake kernel on every OS. WindowsKernel holds only the
two syscalls. The inline MoveFileExW loop is deleted.
(variants:ruling:windows-replace-posix-first)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultcache-rs: import FILE_RENAME_FLAG_* from Win32::System::WindowsProgramming, where windows-sys 0.59 defines them
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
7ed1647375
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultcache-rs: the POSIX rename passes an absolute destination (FileName without RootDirectory must be a full path)
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
6094a7dba3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Soul's Starfire probe (build 26200) showed a relative FileName already works, so the reverted
claim was false. windows_replace_tests are compile-checked only and have never run on Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultcache-rs: the Windows parent-sync comment no longer credits MoveFileExW alone with durability
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
7acc51eebb
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultcache-rs: the replace doc says absence to a lock-free reader is rare on NTFS, not impossible
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Failing after 12m51s
b402757b27
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby force-pushed store-replace/windows-rs from b402757b27
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Failing after 12m51s
to d265b7d647
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 22m14s
2026-11-13 00:02:14 +00:00
Compare
libby merged commit 845c024379 into main 2026-11-13 01:29:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!148
No description provided.