Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Workload checkpointing — see SRD-44.

Submodules:

  • identity — PathSegment, PhaseIdentity, and the per-phase canonical-program hash. Identity is per-phase (no workload-level identity tuple) and (yaml_path, coords) is necessary; the program hash is sufficiency.
  • storage — JSON file format + atomic-rename writer.
  • writer — CheckpointWriter actor: subscribes to phase-lifecycle events, flushes on the metrics-tick cadence with sqlite-fsync-then-checkpoint-fsync ordering.
  • resume — resume planner: loads checkpoint, classifies each freshly-pre-mapped phase per the resume protocol, produces a ResumePlan the executor consults before dispatch.

Re-exports§

pub use events::CheckpointData;
pub use identity::PathSegment;
pub use identity::PhaseIdentity;
pub use resume::ResumeAction;
pub use resume::ResumePlan;
pub use storage::Checkpoint;
pub use storage::OpCounts;
pub use storage::PhaseEntry;
pub use storage::PhaseStatus;
pub use writer::CheckpointWriter;

Modules§

events
SRD-44a — Checkpoint event taxonomy.
identity
Per-phase identity for checkpoint match / mismatch decisions.
params_scope
SRD-107 — the consumed-params derivation.
resume
Resume planner — classify each freshly-pre-mapped phase against the saved checkpoint document and emit a ResumePlan the executor consults before dispatch.
storage
Checkpoint storage — fold-state types + JSONL event-log reader.
writer
CheckpointWriter — append-only event-log owner for the per-session checkpoint document. SRD-44a §“Writer behaviour”.

Functions§

declare_scene_tree_phases
Declare every phase node in a freshly-pre-mapped scene tree to the writer. Called once at session bootstrap, immediately after [crate::executor::pre_map_tree] returns. Each phase gets a Pending entry with no hash; the runtime updates the hash via CheckpointWriter::update_phase_hash when the phase compiles.
scene_tree_resume_candidates
Build a list of (identity, declared_idempotent) pairs for every phase the scene tree will execute. The runner feeds this to ResumePlan::from_checkpoint when resuming, so the planner can classify each freshly-pre-mapped phase against the saved document.