pub enum StorageClass {
Shared,
SessionState,
Transient,
}Expand description
How a node’s storage is shared and how long it lives — its storage
class ([03-ir §“Storage classes and sessions”]). A node is a
structural fact and does not need storage to exist; when storage is
attached, its class governs sharing and lifetime so one optimized graph
can serve many concurrent sessions (weights shared, session state
SessionId-keyed, activations per-realize scratch).
The class is inferred from the op (infer_storage_class) with an
explicit override recorded in the graph’s storage_class side-table
— e.g. KV-cache placeholder Op::Consts, which are session state, not
shared weights.
Phase D substrate (PR-D1): the classification is recorded but not yet consumed by realize. Session keying (D2) and the persistent decode graph (D3–D5) build on it.
Variants§
Weights / constants: one storage for the whole model, identical
across all sessions; keyed by NodeId. The op-inferred default for
Op::Const.
SessionState
Per-session durable buffers (KV-caches + explicit cache-write
targets): one storage per session, keyed by (NodeId, SessionId).
The op-inferred default for the in-place cache-write ops
(Op::WriteSlice / Op::WriteSliceRotating); KV-cache placeholder
Op::Consts take it via an explicit override.
Transient
Activations / scratch: ephemeral, allocated per realize and freed
after use; never persisted. The op-inferred default for everything
else. A transient value may cross devices mid-realize (a D2D
Op::Copy) but never crosses to disk.
Trait Implementations§
Source§impl Clone for StorageClass
impl Clone for StorageClass
impl Copy for StorageClass
Source§impl Debug for StorageClass
impl Debug for StorageClass
impl Eq for StorageClass
Source§impl Hash for StorageClass
impl Hash for StorageClass
Source§impl PartialEq for StorageClass
impl PartialEq for StorageClass
impl StructuralPartialEq for StorageClass
Auto Trait Implementations§
impl Freeze for StorageClass
impl RefUnwindSafe for StorageClass
impl Send for StorageClass
impl Sync for StorageClass
impl Unpin for StorageClass
impl UnsafeUnpin for StorageClass
impl UnwindSafe for StorageClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.