Environment: memxt v0.4.0, x86_64-macos (Intel Mac, macOS 26)
Symptom: memxt doctor always fails the model check, even with a valid 45.9 MB MiniLM GGUF at ~/.memxt/lib/minilm.gguf:
✗ model file at /Users/vhor/.memxt/lib/minilm.gguf is only 0.0 MB — looks truncated
The same happens with MEMXT_MODEL=/bin/ls (a 154 KB file) — reported as 0.0 MB. So fileSize() in src/doctor.zig reads st_size == 0 for every path.
Not the file: the GGUF is valid (GGUF v3 magic, 101 tensors, 45,949,216 bytes), and the embedder loads it fine — memxt embdbg prints dim=384 with real vectors. C stat() on the same path returns st_size = 45949216.
Likely cause: fileSize() (doctor.zig:69-77) calls libc stat() via @cImport struct_stat. On this x86_64 build the field read is 0, while the same layout works on Apple Silicon. v0.4.0 added Intel-Mac cross-compilation (issue #4); the x86_64 release binary appears to carry a wrong struct stat field layout (e.g. built against arm64 headers), so st_size lands on the wrong offset. fileExists() (which uses access()) works fine, which is why resolveModelPath still finds the file and the embedder still loads.
Impact: only memxt doctor diagnostics + any path that uses fileSize — memory store/search work because access() is used elsewhere. Repro:
MEMXT_MODEL=/bin/ls memxt doctor # reports 0.0 MB for /bin/ls
Environment: memxt v0.4.0, x86_64-macos (Intel Mac, macOS 26)
Symptom:
memxt doctoralways fails the model check, even with a valid 45.9 MB MiniLM GGUF at~/.memxt/lib/minilm.gguf:The same happens with
MEMXT_MODEL=/bin/ls(a 154 KB file) — reported as 0.0 MB. SofileSize()insrc/doctor.zigreadsst_size == 0for every path.Not the file: the GGUF is valid (GGUF v3 magic, 101 tensors, 45,949,216 bytes), and the embedder loads it fine —
memxt embdbgprintsdim=384with real vectors. Cstat()on the same path returnsst_size = 45949216.Likely cause:
fileSize()(doctor.zig:69-77) calls libcstat()via@cImportstruct_stat. On this x86_64 build the field read is 0, while the same layout works on Apple Silicon. v0.4.0 added Intel-Mac cross-compilation (issue #4); the x86_64 release binary appears to carry a wrongstruct statfield layout (e.g. built against arm64 headers), sost_sizelands on the wrong offset.fileExists()(which usesaccess()) works fine, which is whyresolveModelPathstill finds the file and the embedder still loads.Impact: only
memxt doctordiagnostics + any path that usesfileSize— memory store/search work becauseaccess()is used elsewhere. Repro:MEMXT_MODEL=/bin/ls memxt doctor # reports 0.0 MB for /bin/ls