Expand description
Flat binary mmap format for sparse-vector posting lists.
Layout (every struct is #[repr(C)] for a stable layout):
[FileHeader] 16 bytes
[DimHeader × num_dims] 16 bytes × N
[PostingEntry × total_entries] 16 bytes × MEach entry carries a max_next_weight ceiling. Files written here store
the inclusive ceiling of the wand module (tail_max: the maximum weight
over the entry and everything after it); readers fold
max(weight, max_next_weight), so a file whose ceiling excludes the
entry itself reads identically.
Structs§
- Mmap
Posting Data - Mmap’d posting data — read-only view of
sparse.mmap. - Posting
Entry - On-disk posting entry.
Functions§
- search_
mmap - Top-
limitsearch straight from the mapping, without loading anything into RAM.dim_maptranslates the query’s token ids into the file’s dimension indices. - search_
mmap_ allowed search_mmaprestricted toallowedids (seerun_search_allowed).- write_
mmap_ file - Write the flat binary mmap format from in-RAM posting lists, one per remapped dimension.