Expand description
The sans-IO Engine state machine. The sans-IO Engine state machine
Modules§
- bootstrap
- Engine bootstrap state — consolidated owner of every bootstrap field the engine reads during install + poll.
- call_
context - Per-function-call invocation context.
- core
- The
Enginestruct + test-only constructor + registration accessors. Hot-path poll cycle lives inengine::poll. - dispatch_
entry - Engine dispatch types
- graph_
slot GraphSlot- per-FunctionProto compiled data perdocs/ENGINE.md§3.- invoke
- Op invocation lifecycle
- pending_
async PendingAsync+ExecutionState- engine’s async-suspension bookkeeping + execution liveness tracking per §5.3.- poll
- 8-phase poll cycle +
handle_completionperdocs/ENGINE.md§7 + §9. - step
EngineStep- observable output ofEngine::pollperdocs/ENGINE.md§10 +docs/internal/IMPLEMENTATION_PLAN.md//! lines 751-753.
Structs§
- Bootstrap
Input - Host-supplied bootstrap input staging request — borrowed shape.
The host hands the engine a
targetname plus an ordered(input_name, value_bytes)slice; the engine validates against the target’s declared formal input ports and runs the Principle 1a copy (cap-check →try_reserve_exact→extend_from_slice) so the caller’s borrowed buffers can drop the momentcrate::node::Node::run_bootstrapreturns. - Engine
- Single-Node engine state. Built via
Node::ensure_ready; tests useEngine::new()and seed fields directly. - Engine
Stats - Point-in-time hot-path counters for dashboards + saturation detection. Not synchronized against an in-flight poll cycle.
- Execution
State - Per-execution liveness tracker
Stored in
Engine.execution_state, keyed byExecId. /// minimum-viable: just the output counter for GC bookkeeping; may extend. - Graph
Slot - Per-FunctionProto compiled data installed on the
Engine. Keyed inEngine.graphsby(domain, name, overload)- the canonical symbol-table key the linker dedupes on. The map key IS the name, soGraphSlotcarries no separatenamefield. - Module
Bootstrap - Per-target Module bootstrap metadata. Stamped into the engine
bootstrap state when the install path sees a
module_phase = bootstrapFunctionProto. - Owned
Bootstrap Input - Owned-form mirror of
BootstrapInput. Kept around because callers (and tests) may want an owned shape, but the new flatrun_bootstrappath stages each entry directly without parking it on a queue. - Pending
Async - Bookkeeping for an Op suspended on a
CommandIdperdocs/ENGINE.md§9.1. Stored inEngine.pending_async, keyed byCommandId.
Enums§
- Bootstrap
Kind - Discriminator carried over from earlier shapes. Module is the
only kind today; the enum is kept so external introspection that
matched on
BootstrapKind::Modulekeeps compiling. - Bootstrap
Status - Host-facing bootstrap lifecycle status. Returned by
Node::bootstrap_statusso the caller can decide whether to keep polling or surface a “wait for input” prompt. - Engine
Step - One step of work the engine performed during a poll cycle.
Engine::pollreturnsVec<EngineStep>capturing every event the host can observe. - OpDispatch
- Per-OpRef dispatch decision, pre-stamped at install time by
Engine::resolve_dispatch. Runtime invoke is one indirect probe againstGraphSlot.op_dispatch[idx]. Four variants:
Functions§
- make_
protocol_ dispatcher - Build a
RoleDispatcherfor a concreteProtocolRuntimeimpl. Called fromEngine::register_protocol_dispatcherand from any test/production setup that needs to register dispatcher entries on a fresh Engine.
Type Aliases§
- Stateless
Invoke Fn - Stateless syscall invoke fn pointer
Same input/output shape as a role-trait
dispatch_atomiccall; returnsDispatchResultfor uniform handling byinvoke_one.