pub fn emit_workload_param_chain_aware(
name: &str,
hashmap_default: &str,
parent_kernel: &ScopeKernel,
source: &mut String,
emitted: &mut HashSet<String>,
inherited_names: Option<&mut Vec<String>>,
)Expand description
Emit const NAME := <literal> for one workload param into
source, choosing the literal value via the canonical
chain-aware lookup order:
parent_kernel.lookup(name)— ifSome, this is the chain-resolved value. Abindings:/set:scope above us may have shadowed the workload-param default; whicheverconst NAME := <override>is closest in the chain wins via the local-final transit-suppression rule (SRD-13f §“Local-authoritative shadow”). If the lookup is non-scalar (vectors etc.), skip the chain path and fall back.hashmap_default— the workload-load-time default fromparams:plus CLI overrides. Used when nothing in the chain has a value forname.
Pre-marks name in emitted so subsequent cascade passes in
the caller skip it. Optionally appends to inherited_names
for the inherited-output bookkeeping consumers also do.
Why this helper exists: pre-helper, seven distinct
synthesizer sites each rolled their own const NAME := <hashmap>
emission, reading the HashMap directly without consulting the
chain. Any name a scenario-tree set: or bindings: scope
shadowed kept the stale HashMap default inside any sub-scope
synthesized via one of those sites — breaking the SRD-21 /
SRD-18 contract that the kernel chain is the single
resolution surface. Routing through this helper closes that
hole categorically.