pub fn try_main_cfg_fabric(src: &str) -> Result<ProgramCfgFabric, LoweringError>Expand description
Lower the top-level ## Main through the CFG engine.
★ WHY THIS EXISTS. The fabric lowers branchy control flow — that is what the CFG engine is — but a
branchy ## Main could not reach it. The combinational output-tape path refuses a Main with a branch
(“a conditional Show cannot ride the combinational output tape”), and the CFG path is addressed BY
FUNCTION NAME, while the top level is not a named function at all. So the capability was present and
unreachable for exactly the programs most people write: 80 of 113 source-emittable ops reach the
fabric per-program, and the missing third is not missing tiles, it is a missing route.
The top level is a region of the same code array that functions index into, starting at pc 0 with
no parameters, so the region bound below — “up to the first function entry, else the end” — already
describes it correctly. Nothing about the lowering changes; only how the region is named.
★ WHERE IT STOPS TODAY, MEASURED. A branchy Main now REACHES the lowering and refuses at
UnsupportedOp("Show") rather than at “function not found” — the route is real and the remaining
gap is one tile. The CFG engine lowers functions that RETURN a value (Term::Return), while Show
is an in-block side effect the combinational output-tape path models and this one does not. Closing
it is a CfgBlock.shows: Vec<Src> (serde-skipped when empty, so the chip serializer’s bytes do not
move), a Op::Show arm, and a sibling evaluator returning the shown SEQUENCE instead of the single
i64 eval_program_cfg_fabric returns — with the equivalence obligation being the VM’s output
stream, not just its final value. That is a feature with a proof to discharge, not a patch.