Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

fix(tools): open the partial read-write before fsync on Windows

Léon Avic Simmons3ea116fdec50
diff --git a/c/tools/qpack_install_policy.py b/c/tools/qpack_install_policy.py
index 063af9e6..23222ca4 100644
--- a/c/tools/qpack_install_policy.py
+++ b/c/tools/qpack_install_policy.py
@@ -492,7 +492,10 @@ def commit_file(session: QpackInstallSession, file: QpackFile) -> None:
raise QpackInstallError(f"cannot commit over existing qpack artifact: {file.name}")
if not partial.is_file() or partial.stat().st_size != file.size:
raise QpackInstallError(f"qpack partial is not complete: {file.name}")
- descriptor = os.open(partial, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
+ # Windows implements fsync as _commit, which needs a writable handle; a
+ # read-only descriptor fails with EBADF there. POSIX flushes either way.
+ flags = (os.O_RDWR if os.name == "nt" else os.O_RDONLY) | getattr(os, "O_NOFOLLOW", 0)
+ descriptor = os.open(partial, flags)
try:
os.fsync(descriptor)
finally: