Skip to main content

Workload

Struct Workload 

Source
pub struct Workload {
Show 18 fields pub description: Option<String>, pub scenarios: HashMap<String, Vec<ScenarioStep>>, pub ops: Vec<ParsedOp>, pub bindings: BindingsDef, pub params: HashMap<String, String>, pub phases: HashMap<String, WorkloadPhase>, pub phase_order: Vec<String>, pub stop_when: Vec<StopConditionSpec>, pub declared_params: Vec<String>, pub report: Report, pub report_warnings: Vec<String>, pub resolution_warnings: Vec<String>, pub scenario_parse_errors: Vec<String>, pub status_metrics: Vec<String>, pub readouts: ReadoutsBindings, pub wrappers: Option<WrappersConfig>, pub implements: Option<String>, pub stick_session: Option<bool>,
}
Expand description

A complete workload definition after normalization.

Fields§

§description: Option<String>§scenarios: HashMap<String, Vec<ScenarioStep>>§ops: Vec<ParsedOp>§bindings: BindingsDef

Workload-level Polydat bindings declared via the top-level bindings: block. These compile into the workload-root kernel directly, separate from per-op bindings — so declarations like cursor row = range(0, 50) are visible to scenario-level comprehensions (e.g., for xval in all(row)) without needing to be threaded through phase-level ops.

§params: HashMap<String, String>

Resolved workload parameters. These are available as bind points in op templates and as constants in Polydat bindings. Populated from: workload params: defaults, CLI overrides, env vars.

§phases: HashMap<String, WorkloadPhase>

Phase definitions. Each phase has its own config and either inline ops or tag filters to select from blocks/top-level ops.

§phase_order: Vec<String>

Phase names in YAML definition order. HashMap does not preserve insertion order, so this Vec tracks the order phases appeared in the workload YAML for deterministic default scenario execution.

§stop_when: Vec<StopConditionSpec>

SRD-83 — workload-shell stop conditions. Declarations distribute by their each: selector: each: phase applies the predicate at every phase, while each: [self, workload] evaluates it at the workload shell itself (reading the children_* aggregate of child phase outcomes).

§declared_params: Vec<String>

Param names declared in the workload YAML params: section. Used to detect unrecognized CLI params. Does not include ad-hoc CLI params.

§report: Report

Unified report block (SRD-46): plots and tables under one schema with figure enumeration, palette/style cascade, and declaration-order rendering. Replaces the separate plot: and summary: blocks (gone, no shim).

§report_warnings: Vec<String>

Non-fatal warnings emitted by the report-block parser (SRD-46). Empty in normal mode; strict mode (SRD-15) promotes them to errors. Plumbed up so the runner / validator decide how to surface them.

§resolution_warnings: Vec<String>

Non-fatal reference-resolution warnings from the extends: chain (SRD-85 nearest-first): a target name that matched multiple resources resolved to the nearest, and the shadowing is surfaced here — never silently. Logged by the runner; strict mode promotes to errors.

§scenario_parse_errors: Vec<String>

Fatal scenario-parse errors collected during parse_scenario_nodes — typically “unknown scenario- node key” cases the parser used to silently drop. Per the project’s “Never Ignore Silently” rule (memory), the runner promotes these to hard errors before dispatching the workload. Unlike report_warnings, these are always-fatal regardless of strict mode — a malformed scenario-tree node never produces useful behavior, so a downstream phase 'iterate' not found error masks the real bug.

§status_metrics: Vec<String>

Workload-wide default for the per-phase WorkloadPhase::status_metrics field. Phases that don’t declare their own status_metrics: inherit this list. Supports glob-style patterns (recall*, latency*) so a single doc-root entry can emphasize a metric family across every phase that produces it.

Empty (default) → no metrics tail anywhere; per-phase declarations are still honoured.

§readouts: ReadoutsBindings

Resolved readouts: block bindings (SRD-63 §5). One entry per event slot the workload bound; the runtime binder reads this map and dispatches at fire time. Empty (default) → all slots fall back to the hard-coded built-ins activity.rs uses today.

Each value is a list of literal body strings — one per readout invocation in the slot. The body strings haven’t been parsed against the readout grammar yet; that happens at activity-init time once the workload kernel is in place. Push 3 ships the data shape only; Push 4 wires resolved layered overrides (CLI / extends).

§wrappers: Option<WrappersConfig>

SRD-32a Push 3 — workload-root wrapper composition override. When present, every op template in this workload uses this innermost-to-outermost order instead of the runtime’s default tiebreaker order. Per-op wrappers: { order: ... } shadows this entry entirely (no cascading merge).

§implements: Option<String>

SRD-108 Part B — names the blueprint this document IMPLEMENTS (resolved local-first, then bundled catalog, like extends: targets). A document carrying this is an implementation module: it provides op bodies for the blueprint’s abstract slots and must carry no phase scaffolding of its own.

§stick_session: Option<bool>

SRD-106 Part 3 — stick_session: true declares this workload’s intended usage as iterative re-attachment: when the operator passes no explicit session selection and sessions/latest exists, the run re-attaches to it and layers a new execution per SRD-77, announcing the re-attachment as the run’s first notable event. CLI stick_session=true|false overrides; --session new forces a fresh session. Absent → today’s fresh-session behavior.

Implementations§

Source§

impl Workload

Source

pub fn synthesize_default_phase(&mut self)

Unification (2026-05-27): the scenario-tree executor is the sole execution path. Workloads that pre-date the phases:/scenarios: shape — op=... inline CLI, blocks: YAML, top-level ops: lists — would historically run via a separate single-activity branch in the runner that bypassed run_phase. After unification that branch is gone; this method synthesizes an implicit main phase + default scenario so the runner has the phased shape to walk.

Idempotent: when phases is already populated the method returns without changes. The synthesized phase owns the ops; Workload::ops stays populated because downstream compile-time inspectors (the workload-root kernel, wrapper-cascade resolver, bind-point validator) still walk the top-level list.

Synthesized shape: phase name main, scenario name default containing [Phase("main")]. No cycles / concurrency / rate / errors overrides — those inherit from CLI / workload defaults via the existing phased resolution.

Trait Implementations§

Source§

impl Clone for Workload

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Workload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Workload

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl HasPolydatMatter for Workload

Source§

fn polydat_matter(&self) -> PolydatMatter

Classify this node’s contribution to Polydat content.
Source§

impl Serialize for Workload

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.