Expand description
Section payload formats (v1).
Each non-binary section starts with a 12-byte header:
[0..4) u32 version (LE) - currently 1
[4..12) u64 count (LE) - number of entriesThen a payload that depends on the section. Embeddings use a different shape (no per-entry header - dim/count come from the file header).
All multi-byte integers are little-endian. Strings are raw UTF-8 bytes prefixed by a u32 length (no NUL terminators).
Re-exports§
pub use blob::BLOB_DATA_PAYLOAD_VERSION;pub use blob::BLOB_REF_NONE;pub use blob::BLOB_REFS_PAYLOAD_VERSION;pub use blob::BLOB_SPAN_OVERLAY_PAYLOAD_VERSION;pub use blob::BlobDataTable;pub use blob::BlobRefRecord;pub use blob::BlobSpanEntry;pub use blob::decode_blob_data_table;pub use blob::decode_blob_refs;pub use blob::decode_blob_span_overlay;pub use blob::encode_blob_data;pub use blob::encode_blob_refs;pub use blob::encode_blob_span_overlay;
Modules§
- blob
- blob section codecs (media blob references and the blob-relative span
overlay). both are OPTIONAL and EXCLUDED from content_hash, additive
within frozen format v1, and never touch the embedding hot path.
refsis the 0x14 table of content-hash references to source media (self-contained or catalog);span_overlayis the 0x16 per-chunk blob-relative span replacement for chunks_original_spans (0x03). - graph
- graph section codecs (chunk-to-chunk csr adjacency and, later, the
entity/property-graph sections). all are OPTIONAL and EXCLUDED from
content_hash, additive within frozen format v1, and never touch the
embedding hot path. G1 ships only
adjacency(SECTION_GRAPH_ADJACENCY, 0x0C); the entity sections (0x11..=0x13) land in G2.
Structs§
- Original
Span - Search
Contract - Space
Entry - one row of the 0x15 table.
space_indexaddresses the band: the vectors live at section 0x20 + space_index (and the optional fp source at 0x30 + space_index).model_hashfingerprints the model that produced THIS space’s vectors.
Constants§
- REPACK_
KIND_ CHUNK_ IDS intpack(encoding id 4) repack kinds. the kind byte leads the packed payload so the wire codec can rebuild the exact canonical bytes of the section it was packed from, keepingcontent_hashstable. canonical sections are never version-bumped; this is a wire encoding, not a payload-format change.- REPACK_
KIND_ SPANS - SPACE_
DTYPE_ F16 - SPACE_
DTYPE_ F32 - dtype codes for the band slab (mirror the manifest dtype strings).
- SPACE_
DTYPE_ I4 - SPACE_
DTYPE_ I8 - SPACE_
TABLE_ PAYLOAD_ VERSION
Functions§
- decode_
chunk_ ids - decode_
chunk_ ids_ intpack - reconstruct the canonical (raw-encoding) chunk-ids payload from the
body of an
intpackrepack (the bytes after the kind byte). the output is byte-identical toencode_chunk_idssocontent_hashis preserved. - decode_
chunks_ canonical - decode_
chunks_ original_ spans - decode_
chunks_ original_ spans_ intpack - reconstruct the canonical (raw-encoding) spans payload from the body
of an
intpackrepack (the bytes after the kind byte). byte-identical toencode_chunks_original_spanssocontent_hashis preserved. - decode_
intpack_ repack - decode an
intpackrepack payload (the full wire bytes, including the leading kind byte) back to the canonical section payload it was packed from. dispatched byencoding::decode_payloadfor encoding id 4. - decode_
provenance - decode_
search_ contract - decode_
space_ table - decode the payload back to entries. typed errors on truncation, a version mismatch, hostile counts, or an invalid entry; never panics.
- decode_
txt_ streams - decode a
txt_streamspayload (the full wire bytes, including the leading kind/version byte) back to the canonicalchunks_canonicalsection payload. byte-identical toencode_chunks_canonical, socontent_hashis unchanged. dispatched byencoding::decode_payloadfor encoding id 10 (parallel todecode_intpack_repack). - encode_
chunk_ ids - encode_
chunk_ ids_ intpack - encode the chunk-ids section as an
intpackrepack payload: a kind byte, the count, then the 32 raw digest bytes per id. returnsNonewhen any id is not a canonicalsha256:<64 lowercase hex>string, so the writer falls back to the raw encoding and reconstruction stays guaranteed byte-exact. - encode_
chunks_ canonical - encode_
chunks_ original_ spans - encode_
chunks_ original_ spans_ intpack - encode the spans section as an
intpackrepack: a kind byte, the count, a deduped uri pool, then three bitpacked columns (uri index, byte_start, and byte_end - byte_start). lengths are stored as a wrapping difference so reconstruction is byte-exact for any input. - encode_
provenance - encode_
search_ contract - encode_
space_ table - encode
entriesinto the 0x15 payload. deterministic: same entries in the same order, same bytes. rejects duplicate indices/names.