Expand description
Canonical scope tree for a workload’s runtime hierarchy.
ScenarioNode (in nmbrs-workload) is the static authored
tree — what the user wrote in YAML. ScopeTree is the
runtime hierarchy — what Polydat and the scheduler see. Every
non-trivial scenario node gets a 1:1 scope here, with
parent pointers, depth, pragma sets, and a slot for a compiled
kernel.
This module is structural only — it builds the tree and exposes traversal helpers. Pragma attachment, kernel compilation, and execution scheduling live in subsequent steps of SRD 18b §“Migration”:
- (this module) introduce the data structure
- nest each scope’s
PragmaSetin its parent’s at scope-tree construction (M2 follow-up) - replace text-substitution of iteration vars with extern binding (compile leaf phases once)
- pluggable scheduler reading the
schedule=<level0>/...spec - hierarchical display surface
Until those steps land, ScopeTree is built but not consumed
by the runner — the existing executor continues to drive
traversal directly off ScenarioNode. Building the tree is
cheap and deterministic; intermediate sysrefs (TUI display,
dryrun=phase) can already start consuming it.
Structs§
- Ancestors
Iter - Walk from a node up through its ancestors to the root.
- DfsIter
- Depth-first pre-order iterator over
(idx, &ScopeNode). - Scope
Node - One node in the runtime scope tree. Carries enough metadata for the scheduler to walk and the compiler to fill in.
- Scope
Tree - A workload’s runtime scope hierarchy. Built once per session.
Stable indices into
nodes; parent / child pointers areScopeNodeIdx. Use the helpers on this struct for traversal — directnodesaccess is fine for read-only inspection but the navigation helpers are easier to read.
Enums§
- Scope
Kind - What kind of scope a
ScopeNoderepresents. Mirrors theScenarioNodevariants 1:1, with two extra kinds for the implicit workload root and the named scenario layer that wraps the user’s authored children. SRD 18b §“Canonical traversal”.
Functions§
- bindings_
label - One-line display label for a scenario-level
bindings:scope. - set_
kernel_ install_ visitor - Register a visitor that fires on every
install_kernelcall. Replaces any prior visitor; passNoneto clear. Called by the runner at session start whendryrun=kernelsis set.
Type Aliases§
- Kernel
Install Visitor - Ride-along visitor for kernel-installation events. Set by
the runner when
dryrun=kernelsis requested so eachinstall_kernelfires the printer as the planning walk encounters the scope.None(the default) keeps install a no-cost hot path. - Scope
Node Idx - Index into the
ScopeTree.nodesvector. Stable for the lifetime of the tree.