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: BindingsDefWorkload-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: ReportUnified 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: ReadoutsBindingsResolved 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
impl Workload
Sourcepub fn synthesize_default_phase(&mut self)
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.