Expand description
Shared run pipeline for persona binaries.
Encapsulates workload parsing → Polydat compilation → activity construction → execution (single or phased).
Each persona binary links its adapter crates (which register
themselves via inventory::submit!) and calls run().
The persona adds nothing but adapters and node functions —
all orchestration logic lives here.
Structs§
- Diagnostic
Config - Diagnostic configuration parsed from
dryrun=parameter. - Execution
Spec - SRD-88 — one execution’s spec for
run_executions: the workload CLI args, the observer that captures its lifecycle/log, and an optional per-execution output channel (SRD-87 buckets).channel = Nonefalls back to the process-global channel; in-process example verification passes aCaptureChannelso each execution’s op stdout is captured separately. - Manifest
Entry - One entry in a program’s output manifest: typed, modifier- aware view of a single output name.
Enums§
- Exec
Depth - Run a workload. Adapters are discovered from link-time inventory registrations — the calling binary just needs to link the adapter crates it wants available. Execution depth: how far through the pipeline to go.
- Resolved
Workload - Resolve a workload file path from a bare name. Tries: as-is, with .yaml/.yml extension, then under workloads/. SRD-85 resolution result: a local file path or a bundled catalog entry.
Constants§
- DEFERRED_
STDOUT_ FILE - Session-dir file holding end-of-run summary output that is
routed to stdout (SRD-46
to stdout) but could not be written inline because a TUI owned the terminal. The post-run printer flushes it verbatim once the terminal is back in cooked mode. - SESSION_
PARAMS - Param keys that configure the session-tier services — one value per
session, shared by every execution under it. Executions that declare
different values for any of these cannot share a session; a multi-
execution harness must group by them and set up one session per group
(see
session_param_signature).metrics_cadenceis the load-bearing case: it fixes the cadence the optimizer settle detector samples, so workloads wanting a sub-second cadence must run in their own session.
Functions§
- collect_
repeated_ flag - Collect every occurrence of a repeatable flag (e.g.
--trace=<spec>ortrace=<spec>) from a raw arg list. Returns the values in order of appearance —parse_paramscollapses repeats into a HashMap, so this is the escape hatch for repeatable args. - create_
adapter - Create an adapter from inventory registrations.
- detect_
conflicting_ duplicate_ params - Reject a
key=valuerun param supplied more than once with conflicting values. These params collapse into a map (last value wins — seeparse_params), which silently discards an earlier value: e.g.scenario=reset scenario=idx_sweepdropsresetand runsidx_sweep. A repeat with an IDENTICAL value is harmless and allowed (re-passing the same value shouldn’t break a script); a conflicting repeat is an ambiguous instruction, so it’s rejected and surfaced rather than silently last-wins (“Never Ignore Silently”). - effective_
params - The run’s effective parameters: the workload’s declared top-level
params:(extends-merged) as the base, with CLIkey=valueargs overlaid on top (CLI wins). This is the single consolidated param set — the same one whether a setting is declared in the workload or passed on the command line — used for session-tier services (metrics cadence, push reporters, per-instance metrics) and console-ownership detection alike. The per-execution path reaches the same result by overlaying CLI onto the fully-parsedworkload.params(seerun_execution). - expand_
workload_ params - Expand
{key}workload param placeholders in a string. - extract_
manifest - Extract the output manifest from a compiled Polydat program. Returns one entry per output, in declaration order.
- install_
known_ flags - Install the run-style flag vocabulary (long forms + aliases from the CLI command-spec, split by arity). Idempotent — first wins.
- install_
known_ params - Install the run-style param vocabulary (the keys the CLI command-spec
accepts, sans the trailing
=). Called once at binary startup from the CLI layer, which owns the canonical list. Idempotent — first wins. - normalize_
args - Normalize args: detect scenario shorthand where a bare word after
the workload file becomes
scenario=<name>. - parse_
count - Parse a cycle count that may have suffixes: K, M, B.
- parse_
log_ level - Parse a CLI/workload
loglevel=value. Case-insensitive, accepts the standard names plus the abbreviations the log sink emits (DBG/INF/WRN/ERR). - parse_
params - Parse
key=valuepairs from command line args. - render_
controls_ tree - Walk a component subtree and print every declared control
(name, type, current value, scope, final flag, applier
count) in a stable order. Used by
dryrun=controlsand any other discovery-style call site. - render_
scope_ elision_ summary - Render the SRD-13d scope-elision summary for
dryrun=op. One line per scope-tree node (DFS pre-order), showing the logical name and the materialised/elides-to mark. - report_
config_ from_ summary - Convert the workload-model
SummaryConfig(parsed from thesummary:workload field or the--summaryCLI flag) into the SQLite reporter’sReportConfig. Used by both the in-run summary path (workload finished, render tosummary.md) and the standalonenmbrs --summarycommand, so both produce identical output for the same spec. - resolve_
polydat_ config - Resolve a config value to u64 via Polydat scope lookup or numeric parsing.
- resolve_
workload - Resolve a
workload=value per SRD-85 nearest-first: local files first (exact path, extension probing, cwdworkloads/), then the bundled catalog by exact name. A name that resolves both ways FAVORS the logical filesystem location and logs a warning naming both — shadowing is allowed but never silent../-prefixed paths pin the local reading without a warning. - resolve_
workload_ file_ public - Try to resolve a workload name (bare or with extension) to an
actual file path, searching the current directory and
./workloads/. ReturnsNoneif nothing matches. - run
- run_
activity_ simple - run_
executions - SRD-88 — run N executions CONCURRENTLY in one process, all sharing
ONE session, at most
max_concurrentin flight. The session (SessionHost: dir / stores / cadence + scheduler services) is set up ONCE and torn down ONCE, after every execution. Each execution loads + runs its own workload, derives its ownExecution(distinct allocatedexec_id) under the shared session component, flushes its metrics into the shared store viaCadenceReporter::quiescewithout tearing the reporter down, and routes its lifecycle/log through its own observer (a scoped [ExecutionContext]). Results come back in input order. - run_
with_ observer - Run with a custom observer for phase lifecycle events. The TUI persona uses this to inject a TuiObserver that updates the display state instead of printing to stderr.
- scenarios_
in_ workload_ file - List the scenario names declared at the top level of a workload
YAML file. Used by shell-completion tooling to offer
scenario=<tab>suggestions. Returns an empty vector on any parse error — completion is best-effort, not a hard check. - session_
param_ signature - The session-grouping signature for a workload reference: its declared
values (following
extends:) for theSESSION_PARAMS, sorted. Workloads with equal signatures can share one session; differing ones must not. Empty signature = “the default session is fine”.