Enum TrialState
pub enum TrialState {
Waiting,
Running,
Paused,
Complete,
Pruned,
Failed,
}Expand description
Where a trial is in its life cycle.
Variants§
Waiting
Created, not yet picked up by a worker.
Running
A worker is evaluating it.
Paused
Suspended by a scheduler, with a checkpoint reference; may resume.
Declared in M1 and legal in the state machine, but no built-in scheduler produces it before M4 (PBT/PASHA) — the state exists now so that storage backends and journal formats do not need a breaking change later.
Complete
Finished successfully; values hold the objective.
Pruned
Stopped early by a scheduler; the last intermediate value is the objective.
Failed
Stopped by an error; error holds the reason.
Implementations§
§impl TrialState
impl TrialState
pub const fn is_finished(self) -> bool
pub const fn is_finished(self) -> bool
true for the terminal states: Complete, Pruned, Failed.
Finished trials are immutable.
pub const fn is_active(self) -> bool
pub const fn is_active(self) -> bool
true if a worker is expected to be making progress on the trial.
Paused counts as active but not progressing: it is not finished and
it still owns its checkpoint, so it is not is_active.
pub const fn can_transition_to(self, next: Self) -> bool
pub const fn can_transition_to(self, next: Self) -> bool
Whether self -> next is a legal transition.
| From | To |
|---|---|
Waiting | Running, Failed |
Running | Complete, Pruned, Paused, Failed, Waiting |
Paused | Running, Pruned, Failed |
| terminal | — |
Running -> Waiting is legal but unused in-tree: stale-worker fail-over
(fail_over_stale) moves the
trial to Failed and, when the policy requeues, creates a replacement
trial instead of returning the original to the pool. A transition to
the same state is never legal — the caller has already lost the race
(see Storage::try_transition).
Trait Implementations§
§impl Clone for TrialState
impl Clone for TrialState
§fn clone(&self) -> TrialState
fn clone(&self) -> TrialState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more