Dsxir. OptimizerSession. Checkpoint
(dsxir v0.2.0)
Copy Markdown
Persisted record for one OptimizerSession state transition.
Session-owned structured fields (progress, best_program_artifact,
status) are readable without invoking the optimizer. The optimizer-owned
sampler_blob is opaque; only the optimizer that wrote it interprets it,
using sampler_format = {module, version} as a refusal gate on resume.
Summary
Functions
Decode a binary back to %Checkpoint{}. Raises Dsxir.Errors.Invalid.ResumeMismatch
on shape mismatch.
Encode %Checkpoint{} to a deterministic binary suitable for any Store impl
that accepts opaque bytes.
Hash the trainset for fingerprinting. Stable for byte-identical trainsets.
Build a fresh checkpoint for a brand-new session.
Types
@type progress() :: %{ trial_log: [trial_log_entry()], best_score: float() | nil, best_trial_idx: non_neg_integer() | nil, attempts: non_neg_integer(), completed: non_neg_integer(), errors: non_neg_integer(), started_at: DateTime.t() }
@type t() :: %Dsxir.OptimizerSession.Checkpoint{ best_program_artifact: map() | nil, created_at: DateTime.t(), optimizer: module(), optimizer_opts: keyword(), program_module: module() | nil, progress: progress(), sampler_blob: binary(), sampler_format: {module(), pos_integer()}, session_id: String.t(), status: :running | :paused | :completed | :failed | :cancelled, terminal_reason: term(), trainset_hash: binary(), updated_at: DateTime.t() }
@type trial_log_entry() :: %{ trial_idx: non_neg_integer(), candidate_id: String.t() | nil, score: float() | nil, status: :ok | :error, stats: map() | nil, duration_ms: non_neg_integer(), error: map() | nil, error_class: atom() | nil }
Functions
Decode a binary back to %Checkpoint{}. Raises Dsxir.Errors.Invalid.ResumeMismatch
on shape mismatch.
Encode %Checkpoint{} to a deterministic binary suitable for any Store impl
that accepts opaque bytes.
Hash the trainset for fingerprinting. Stable for byte-identical trainsets.
Build a fresh checkpoint for a brand-new session.