Skip to main content

Module validate_bootstrap_composition

Module validate_bootstrap_composition 

Source
Expand description

Structural check for the bootstrap-as-function composition tree.

Every Module’s bootstrap recording emits its own FunctionProto stamped MODULE_PHASE_BOOTSTRAP. A parent Module that composes children via ModuleCall::bootstrap(g) records a CALL NodeProto into its own bootstrap pointing at the child’s "<child>__bootstrap" FunctionProto. This pass walks the call graph rooted at the target’s bootstrap and surfaces:

  • CompileError::BootstrapCompositionGap when a Call points at a bootstrap function name that has no matching FunctionProto in the model — the engine’s FunctionCall dispatch would refuse to seed a CallContext for a missing target.
  • CompileError::BootstrapCompositionCycle when the function-call graph is not a DAG. Bootstrap completion is one-shot; a cycle in the composition tree wedges the engine in bootstrap_pending forever.

Runs at the top level of the compile pipeline — before inlining or partitioning can rearrange the function table — so the error surfaces against the recorded composition shape the author wrote.

Functions§

validate_bootstrap_composition
Walk the bootstrap-call graph rooted at <target>__bootstrap and verify every reachable Call resolves to an existing FunctionProto.