pub enum DeltaAdaptationState {
Idle,
Pending {
pre_snapshot: HashMap<String, Tensor>,
pre_muon: HashMap<String, Tensor>,
pre_eff_ranks: HashMap<String, usize>,
ttt_result: TTTResult,
created_at: Instant,
timeout_ms: u64,
},
}Expand description
The lifecycle state of a tenant delta’s pending adaptation.
Stored inside TenantDelta. Replaces the external
pending_adaptations: Mutex<HashMap<Subject, PendingAdaptation>>.
Variants§
Idle
No pending work. Delta holds its last committed state.
Pending
Adaptation applied in-place. Snapshot held for potential rollback.
Implementations§
Source§impl DeltaAdaptationState
impl DeltaAdaptationState
pub fn new() -> Self
pub fn is_pending(&self) -> bool
pub fn is_expired(&self) -> bool
Sourcepub fn resolve(
&mut self,
strategy: AdaptationStrategy,
guard: &GuardStatus,
result: &TTTResult,
pre_snapshot: HashMap<String, Tensor>,
pre_muon: HashMap<String, Tensor>,
pre_eff_ranks: HashMap<String, usize>,
) -> ResolveOutcome
pub fn resolve( &mut self, strategy: AdaptationStrategy, guard: &GuardStatus, result: &TTTResult, pre_snapshot: HashMap<String, Tensor>, pre_muon: HashMap<String, Tensor>, pre_eff_ranks: HashMap<String, usize>, ) -> ResolveOutcome
Resolve a new adaptation result according to the given strategy.
This is the single entry point for all commit/rollback/pending decisions. Called by both the adapt-then-generate and pure-training paths.
For the Evicted outcome, the baseline snapshot (pre-first-adaptation state)
is returned inside ResolveOutcome::Evicted so the caller can restore weights
without needing to retain ownership of the inputs before this call.
Sourcepub fn writeback_stats(&mut self) -> Result<WritebackInfo>
pub fn writeback_stats(&mut self) -> Result<WritebackInfo>
Write back (accept) a pending adaptation. Returns stats info for the caller to apply to the delta’s counters.
Sourcepub fn evict(&mut self) -> Result<EvictedSnapshot>
pub fn evict(&mut self) -> Result<EvictedSnapshot>
Evict (discard) a pending adaptation. Returns the snapshot for the caller to restore onto the delta.
Trait Implementations§
Source§impl Debug for DeltaAdaptationState
impl Debug for DeltaAdaptationState
Auto Trait Implementations§
impl Freeze for DeltaAdaptationState
impl RefUnwindSafe for DeltaAdaptationState
impl Send for DeltaAdaptationState
impl !Sync for DeltaAdaptationState
impl Unpin for DeltaAdaptationState
impl UnsafeUnpin for DeltaAdaptationState
impl UnwindSafe for DeltaAdaptationState
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more