pub enum WorkTypeValidationError {
ZeroBurstDuration {
group_idx: usize,
},
ZeroSleepDuration {
group_idx: usize,
},
ZeroTimerInterval {
group_idx: usize,
},
NetTrafficFrameBytes {
frame_bytes: u16,
group_idx: usize,
},
IrqWakeFrameBytes {
frame_bytes: u16,
group_idx: usize,
},
InsufficientWakeChainDepth {
depth: usize,
group_idx: usize,
},
NonDivisibleWorkerCount {
name: String,
group_idx: usize,
group_size: usize,
num_workers: usize,
},
ZeroIpcVarianceParam {
field: &'static str,
group_idx: usize,
},
}Expand description
Spawn-time validation failures for WorkType preconditions.
Returned (boxed inside anyhow::Error) by
WorkloadHandle::spawn when a per-group WorkSpec violates a
runtime invariant the variant doc declares as a precondition.
Tests that need to assert on a specific variant downcast via
err.downcast_ref::<WorkTypeValidationError>(); the
Display impl carries the same human-readable text the previous
anyhow::bail! strings did so call sites that match on the
rendered message keep working.
Each variant carries group_idx, a unified group index where 0
is the primary group and the i-th WorkloadConfig::composed
entry is group_idx == i + 1, so multi-group scenarios can
locate the offending entry without re-parsing the message string. Variants
with multiple constraint inputs (depth, divisor, observed count)
expose those values as named fields to the same end.
Variants§
ZeroBurstDuration
WorkType::IdleChurn with burst_duration == Duration::ZERO.
Collapses the per-iteration loop to pure nanosleep so the
worker accrues no runtime — useless as a scheduler test. See
the variant doc’s “Spawn-time validation” section for the
full rationale.
Fields
ZeroSleepDuration
WorkType::IdleChurn with sleep_duration == Duration::ZERO.
Collapses the per-iteration loop to a CPU-bound burst with
no idle path; the kernel’s nanosleep(0) is yield-like
rather than idle-like. The diagnostic steers the caller to
WorkType::SpinWait (pure CPU spin) or
WorkType::YieldHeavy (the closer overlap).
Fields
ZeroTimerInterval
WorkType::TimerLatency with interval_us == 0. A zero interval never
advances the absolute deadline, collapsing the cyclictest loop to a tight
busy-spin rather than a timer-latency probe.
Fields
NetTrafficFrameBytes
WorkType::NetTraffic with frame_bytes outside [60, 1514]. Below
60 (ETH_ZLEN) there is no room for the L2 header the loopback echoes;
above 1514 (standard MTU + header) the frame exceeds the virtio-net MTU.
Fields
IrqWakeFrameBytes
WorkType::IrqWake with frame_bytes outside [60, 1514] — same bound
and reasoning as Self::NetTrafficFrameBytes (the IrqWake sender reuses
the NetTraffic frame builder).
Fields
InsufficientWakeChainDepth
WorkType::WakeChain with depth < 2. A 1-stage chain has
no successor to wake, and the post-fork close-other-fds
block would close the worker’s own write end (deadlock).
Fields
NonDivisibleWorkerCount
num_workers is not a positive multiple of the variant’s
worker_group_size. Affects
every grouped variant (paired, fan-out, herd, contention,
chain). The diagnostic names the variant via WorkType::name.
Fields
name: StringPascalCase variant name from WorkType::name.
group_idx: usizeUnified group index of the offending group: 0 for the
primary group, i + 1 for WorkloadConfig::composed[i].
group_size: usizeRequired group size (the variant’s
worker_group_size).
ZeroIpcVarianceParam
WorkType::IpcVariance with one of hot_iters,
cold_iters, or period_iters equal to 0. A zero in
any of the three collapses the alternation: zero
hot_iters produces a pure cold-phase memory loop, zero
cold_iters produces a pure ALU loop (use
WorkType::AluHot directly for that), and zero
period_iters produces a worker that never advances
past the first stop check. Each rejection names the
offending field so the caller knows which to fix.
Trait Implementations§
Source§impl Clone for WorkTypeValidationError
impl Clone for WorkTypeValidationError
Source§fn clone(&self) -> WorkTypeValidationError
fn clone(&self) -> WorkTypeValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkTypeValidationError
impl Debug for WorkTypeValidationError
Source§impl Display for WorkTypeValidationError
impl Display for WorkTypeValidationError
Source§impl Error for WorkTypeValidationError
impl Error for WorkTypeValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl Hash for WorkTypeValidationError
impl Hash for WorkTypeValidationError
Source§impl PartialEq for WorkTypeValidationError
impl PartialEq for WorkTypeValidationError
impl Eq for WorkTypeValidationError
impl StructuralPartialEq for WorkTypeValidationError
Auto Trait Implementations§
impl Freeze for WorkTypeValidationError
impl RefUnwindSafe for WorkTypeValidationError
impl Send for WorkTypeValidationError
impl Sync for WorkTypeValidationError
impl Unpin for WorkTypeValidationError
impl UnwindSafe for WorkTypeValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> ErrorExt for T
impl<T> ErrorExt for T
§fn and_raise<T>(self, context: T) -> Exn<T>
fn and_raise<T>(self, context: T) -> Exn<T>
§fn raise_erased(self) -> Exnwhere
Self: Sized,
fn raise_erased(self) -> Exnwhere
Self: Sized,
§fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
sources as causes.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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