Expand description
Checkpointing support for evolution state persistence
This module provides serialization and recovery of evolution state, enabling long-running experiments to be paused and resumed.
The state submodule (data structures) is always available.
The recovery submodule (file I/O) requires the checkpoint feature and
a target with a filesystem.
The second half of that condition is not a new restriction, it is the one
CheckpointError already encodes: its
Io variant is #[cfg(not(target_arch = "wasm32"))] and its docs read
“native only”, with Storage(String) offered as the wasm alternative. The
module gate had not been kept in step, so on wasm32 the file-I/O code was
still compiled while the error variant its ? operators desugar into was
not — cargo check --target wasm32-unknown-unknown failed on the default
feature set with a dozen “? couldn’t convert the error to
CheckpointError”.
Gating the module rather than adding a wasm From<io::Error> is the fix
that matches the intent: wasm32-unknown-unknown has no filesystem, so
File::create there could only ever be a compile-time promise of a
runtime failure.
Modules§
- prelude
- Prelude for checkpoint module
Structs§
- Checkpoint
- Complete evolution state for checkpointing
- Checkpoint
Builder - Builder for creating checkpoints
- Checkpoint
Manager - Checkpoint manager for automatic saving
- CmaEs
Checkpoint State - CMA-ES checkpoint state
- Hyperparameter
State - Hyperparameter learning state
Enums§
- Algorithm
State - Algorithm-specific state variants
- Checkpoint
Format - Format for checkpoint serialization
Constants§
- CHECKPOINT_
VERSION - Current checkpoint format version
- DEFAULT_
MAX_ CHECKPOINT_ BYTES - Default cap on the size (in bytes) of a checkpoint file that
load_checkpointwill deserialize (EV-48). Files larger than this, and individual length-prefixed fields larger than this, are rejected with a typed error rather than triggering an unbounded allocation. - MIN_
SUPPORTED_ CHECKPOINT_ VERSION - Oldest checkpoint schema version this build can still load (EV-45).
Traits§
- Snapshot
Rng - An RNG whose complete internal state can be captured to bytes and restored, enabling bit-identical checkpoint resume.
Functions§
- load_
checkpoint - Load a checkpoint from a file using the default size limit
(
DEFAULT_MAX_CHECKPOINT_BYTES). - load_
checkpoint_ with_ limit - Load a checkpoint from a file, rejecting inputs larger than
max_bytes. - save_
checkpoint - Save a checkpoint to a file