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.
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.
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.
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.
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.