Summary
The dense-only vindex load path fails on Windows only (ubuntu + macos are green). Introduced by #159 (BitNet --dense-only build/load).
test extract::build::tests::dense_only_vindex_loads_without_gate_vectors ... FAILED
thread '...' panicked at crates\larql-vindex\src\extract\build\mod.rs:568:
dense-only vindex failed to load: Some(Io(Os { code: 87, kind: InvalidInput,
message: "The parameter is incorrect." }))
Root cause
Windows error 87 (ERROR_INVALID_PARAMETER) is the classic symptom of memmap2::Mmap::map on a 0-byte file: CreateFileMapping rejects a zero size on Windows, whereas Linux/macOS map an empty file fine. The dense-only build skips gate_vectors.bin (and the load path mmaps gate/weight files unconditionally), so a zero-length / empty file reaches an unguarded Mmap::map.
Likely site: crates/larql-vindex/src/format/weights/load/f32.rs (the gate_vectors.bin mmap around the config.quant == None && !opts.skip_ffn branch), but every load-path Mmap::map should be audited — there are several (embeddings.rs, f32.rs).
Suggested fix
Guard the load-path mmaps against zero-length files — skip the mmap (treat as absent / empty) when file.metadata()?.len() == 0. This is correct cross-platform (a 0-byte mapping has no data anyway) and matches how dense-only intentionally omits gate vectors.
Notes
Summary
The dense-only vindex load path fails on Windows only (ubuntu + macos are green). Introduced by #159 (BitNet
--dense-onlybuild/load).Root cause
Windows error 87 (
ERROR_INVALID_PARAMETER) is the classic symptom ofmemmap2::Mmap::mapon a 0-byte file:CreateFileMappingrejects a zero size on Windows, whereas Linux/macOS map an empty file fine. The dense-only build skipsgate_vectors.bin(and the load path mmaps gate/weight files unconditionally), so a zero-length / empty file reaches an unguardedMmap::map.Likely site:
crates/larql-vindex/src/format/weights/load/f32.rs(thegate_vectors.binmmap around theconfig.quant == None && !opts.skip_ffnbranch), but every load-pathMmap::mapshould be audited — there are several (embeddings.rs,f32.rs).Suggested fix
Guard the load-path mmaps against zero-length files — skip the mmap (treat as absent / empty) when
file.metadata()?.len() == 0. This is correct cross-platform (a 0-byte mapping has no data anyway) and matches how dense-only intentionally omits gate vectors.Notes
--admin(all other platforms green) to unblock the bitnet stack; this issue tracks the follow-up.