Skip to main content

Module serialize

Module serialize 

Source
Expand description

Serialize / deserialize a paged KV cache via a BlobStore.

Per agent_docs/cache-layer.md the K and V buffers of each physical page are content-addressed independently so a fork that mutates only V (e.g. a one-token decode step) shares its K page with siblings. The pf_core::cas::FsBlobStore does the zstd-19 compression at rest, so we pass raw bytes here.

Structs§

DeserializedCache
Output of deserialize_pages.

Functions§

deserialize_pages
Inverse of serialize_pages. Loads the PageManifest at digest, fetches every K/V blob, and yields (ix, PageBytes) pairs in canonical order along with the logical-seqs and metadata needed to rebuild the engine’s page table.
serialize_pages
Serialize a list of (ix, K-bytes, V-bytes) page tuples + the per-sequence logical mapping into a PageManifest and persist every blob through blobs. Returns the digest of the manifest itself, ready to drop into the .pfimg cache.manifest field.