pub enum Purity {
Pure,
SideChannel {
sink: SideChannelSink,
},
Nondeterministic {
reason: &'static str,
},
}Expand description
Per-node purity classification per
runtime_model.md’s D2 axiom and
composition_substrate.md’s T1+T2 axioms.
Every node declares its purity status via
PolydatNode::purity. The default is Purity::Pure; nodes
with observable side channels (logging, file I/O, network)
or eval-call-spanning state override to declare
Purity::SideChannel or Purity::Nondeterministic.
D1 (Typed Return Determinism) holds for every purity class. The slot contract carries only typed return values; impure nodes still produce typed-deterministic returns. What varies between purity classes is the observable side channels (D2): pure nodes have none; SideChannel nodes have declared side channels; Stateful nodes additionally have internal eval-call-spanning state that affects future evaluations.
Variants§
Pure
Pure function — eval(inputs) is a function of inputs,
no observable side effects, byte-identical determinism
across calls with identical inputs.
SideChannel
Has an observable side channel (logging, file I/O,
network, etc.) but the typed return value is still a
function of inputs. Hosts that care about side-channel
observability examine the sink to know what
observable surface this node writes to.
Fields
sink: SideChannelSinkThe observable surface the node writes to.
Nondeterministic
The typed return value is not a function of declared
inputs alone — it depends on external sources (system
clock, entropy, thread identity, environment) or on
eval-call-spanning internal state mutated by prior calls.
In either case, the runtime’s node_clean caching model
must opt the node out of within-cycle memoization
suppression; the lifecycle classifier marks the node as
nondeterministic per kernel/engines.rs::nondeterministic_nodes.
The reason string documents the source of
non-determinism (e.g., “reads system clock”,
“monotonic counter incremented per call”,
“accumulates signal buffer across calls”).
This is the intrinsic-volatility marker referenced by
runtime_model.md R1.v: certain library nodes declare
themselves volatile via this variant; no user opt-in is
required, and the workload author cannot remove the
marker. User-opt-in volatility via the volatile
modifier is a separate surface that produces the same
runtime effect (see R1.v).
Trait Implementations§
impl Eq for Purity
impl StructuralPartialEq for Purity
Auto Trait Implementations§
impl Freeze for Purity
impl RefUnwindSafe for Purity
impl Send for Purity
impl Sync for Purity
impl Unpin for Purity
impl UnsafeUnpin for Purity
impl UnwindSafe for Purity
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,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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