pub struct PhaseIdentity {
pub yaml_path: Vec<PathSegment>,
pub coords: String,
pub phase_hash: Option<[u8; 32]>,
}Expand description
Per-phase identity, used by the checkpoint writer to record “what phase is this” and by the resume planner to match a saved entry to a freshly-pre-mapped phase.
(yaml_path, coords) together are necessary for a saved
entry to apply to a new pre-map; phase_hash (when
present) is the sufficiency check. See SRD-44 §“Identity
matching at resume” for the full contract.
coords is the canonical scope-coordinate-path string
(the leaf-first striated form produced by
polydat::kernel::format_scope_coordinate_path).
Stored as a string rather than typed Vec<ScopeCoord>
because:
- the runtime already produces it for every phase via
parent_kernel.scope_coordinates()+ the formatter, - it serialises trivially to JSON,
- identity comparison reduces to string equality, and
- the formatting function is the canonical identity producer for both pre-map and runtime — they cannot disagree without the formatter itself drifting.
Fields§
§yaml_path: Vec<PathSegment>§coords: String§phase_hash: Option<[u8; 32]>SHA-256 of the canonical re-emission of the phase’s
compiled PolydatProgram. None when checkpoint.hashed = false was declared on the workload (operator
opt-out per SRD-44); resume falls back to
tuple-only match in that case.
Implementations§
Source§impl PhaseIdentity
impl PhaseIdentity
Sourcepub fn matches_structural(&self, other: &PhaseIdentity) -> bool
pub fn matches_structural(&self, other: &PhaseIdentity) -> bool
Tuple-only match — (yaml_path, coords) equal.
Necessary precondition for any further match check;
if this returns false, the saved entry simply
doesn’t apply to the candidate phase.
Sourcepub fn matches_full(&self, other: &PhaseIdentity) -> bool
pub fn matches_full(&self, other: &PhaseIdentity) -> bool
Full match — tuple-equal AND, when both sides carry a
hash, hashes equal too. The “both carry a hash” bit
covers the operator opt-out (checkpoint.hashed = false): in that case the saved entry has None and
the candidate may also have None, in which case
tuple-only equivalence is what the operator asked for.
Mismatched-hash → invalidate this single phase per
SRD-44 §“Identity matching at resume” item 3.
Trait Implementations§
Source§impl Clone for PhaseIdentity
impl Clone for PhaseIdentity
Source§impl Debug for PhaseIdentity
impl Debug for PhaseIdentity
Source§impl<'de> Deserialize<'de> for PhaseIdentity
impl<'de> Deserialize<'de> for PhaseIdentity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PhaseIdentity
Source§impl PartialEq for PhaseIdentity
impl PartialEq for PhaseIdentity
Source§impl Serialize for PhaseIdentity
impl Serialize for PhaseIdentity
impl StructuralPartialEq for PhaseIdentity
Auto Trait Implementations§
impl Freeze for PhaseIdentity
impl RefUnwindSafe for PhaseIdentity
impl Send for PhaseIdentity
impl Sync for PhaseIdentity
impl Unpin for PhaseIdentity
impl UnsafeUnpin for PhaseIdentity
impl UnwindSafe for PhaseIdentity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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