Module expert_pack

Module expert_pack 

Source

Structs§

ExpertFileReader
Reader used by tests / tooling to verify a built store without a GPU. The production streamer reads via the O_DIRECT backend::* engine; this is a plain-pread reference for the acceptance round-trip.
ExpertFileWriter
Offline writer: creates the manifest + one file per MoE layer and places records at their strided offsets. Plain buffered writes (no O_DIRECT) — alignment only matters on the streamer’s read path, and the record stride is already a 4 KiB multiple, so the files are O_DIRECT-readable.
ExpertIndex
Directory manifest describing a built expert store. Serialized as manifest.json next to the per-layer .xpr files. This is the streamer’s entry point — everything it needs to reconstruct geometry and open files.
ProjData
Borrowed packed+scale bytes for one projection, as they will sit on disk (prefill-resident / transposed layout).
ProjView
Borrowed view of one projection’s sub-buffers inside a parsed record.

Functions§

pack_record
Assemble one complete stride-byte record: header at offset 0, each projection’s packed+scale bytes placed at the spec’s sub-offsets, zero padding everywhere else. Returns exactly stride bytes.
unpack_record
Parse a record buf (>= spec.raw_bytes()), returning the header and borrowed views of each projection’s sub-buffers. Validates the header magic and version; returns an error on any mismatch.