Skip to main content

Module offload

Module offload 

Source
Expand description

The shared shrink primitive: lossy-but-restorable, owned here and nowhere else. Four invariants, each enforced in code: store-before-cut; substitute (hint included) never larger than the original nor the cap; only lossy transforms store; the substitute always carries a materialized read-only rest path. CAS dedup makes repeated offloads of the same bytes idempotent.

Structs§

OffloadRecord
The outcome: a substitute that fits the cap, the original pinned in CAS, and a read-only path the model can keep reading from.
OffloadSite
Where offloaded bytes live: the CAS for the original, and the room whose REST_DIR holds the materialized rest file. The room travels as its city address because the model’s read tool resolves every path from the city root. origin is the run and building the original is pinned for, so that a cas: read of it is judged where the output was made.

Constants§

REST_DIR
The directory inside the room that holds materialized rest files.

Functions§

offload
Shrinks bytes to at most cap_bytes. Callers only come here for lossy cases (len > cap); a lossless call is refused — invariant 3 says only lossy transforms may store.
rematerialize
Restores the rest file from the CAS after external cleanup; the bytes are the original, verbatim (A7’s third assertion).