Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source

pub fn open(store: WarmStartStore, key: Fingerprint) -> Self

Source

pub fn preload(&self, entry: WarmStartEntry)

Stash a near-match payload that the next Self::try_load call should return in preference to looking up this session’s key.

Used by the workflow dispatcher to seed a fresh fit’s outer loop from a related but not-exact-fingerprint prior fit (e.g., cross-validation folds of the same model). The exact-key keyspace remains untouched by this — checkpoint and finalize writes still go to the session’s own key.

Source

pub fn key(&self) -> &Fingerprint

Source

pub fn run_id(&self) -> &str

Source

pub fn store(&self) -> &WarmStartStore

Source

pub fn try_load(&self) -> Option<WarmStartEntry>

Read the best entry currently on disk for this session’s key. Lookup is read-only against the store and may return entries from other runs (the whole point of cross-run resume).

If a near-match seed has been preloaded via Self::preload, the seed is returned in preference to the store lookup AND consumed (so subsequent calls fall back to the store). This makes the session a unified abstraction over “exact-key hit” and “hierarchical-prefix seed.”

Source

pub fn try_load_with_source(&self) -> Option<LoadedEntry>

Read the best available warm-start entry and report whether it came from this session’s exact key or from a preloaded near-match seed.

Callers that only need a seed can use Self::try_load. Callers that may skip expensive validation on a finalized exact hit need this source bit so a near-match prefix seed is never mistaken for a completed fit.

Source

pub fn peek_load(&self) -> Option<WarmStartEntry>

Read the currently available warm-start entry without consuming a preloaded near-match seed.

This is intentionally separate from Self::try_load: callers that only need to make a scheduling decision (for example, whether to run an expensive cold-start pilot) must not drain the preloaded seed that the outer optimizer is about to consume.

Source

pub fn peek_load_with_source(&self) -> Option<LoadedEntry>

Read the currently available warm-start entry with source metadata, without consuming a preloaded near-match seed.

Source

pub fn checkpoint( &self, payload: &[u8], objective: Option<f64>, iteration: Option<u64>, ) -> bool

Persist a mid-fit checkpoint. Rate-limited; returns true if a write actually happened. Always writes when the new objective strictly improves on the best-so-far observed in this session.

Source

pub fn finalize( &self, payload: &[u8], objective: Option<f64>, iteration: Option<u64>, ) -> bool

Persist the end-of-fit result, promoting this session’s slot to EntryKind::Final. Bypasses the rate limit.

Trait Implementations§

Source§

impl Debug for Session

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.