Problem and current evidence
The Y-combinator discussion motivates separating recursive problem structure from execution strategy. It does not justify unbounded recursion, automatic speedup or a second compiler.
Current default main a8ffd2b912c84197d08f963b05f9c7d8b30a3f8a has legacy call-order checks in src/compiler/osc_ir.c:282 and src/checker2/c2_check.c:318. Those are not evidence that current seeded .om lacks recursion:
- Seeded importer already implements primary -> expr -> term -> primary with an explicit depth limit of 16.
- Source-aware contract restricts imported units to 1..64 straight-line SSA results, no functions/branches/recursion. core.om implements that finite envelope.
- #621/#622 comments report reviewed candidates, not full source-to-native translation qualification. Retain existing owners and reviewed artifacts.
Scope
Extend existing .om semantics/interchange/realization to a deliberately bounded recursive profile. Do not build another recursion runtime or reroute new work through legacy .osc.
Work and acceptance
- With #625/#621 owners, freeze evaluation order, argument/return types, arithmetic/traps, a step/fuel bound, frame/depth/storage bounds and named exhaustion semantics. A depth bound alone is not a work bound. Distinguish terminating structural recursion from budget-bounded partial execution; report the latter as a scoped contract/refinement, never full equivalence for arbitrary inputs.
- Inventory existing .om direct/mutual recursion, call ABI and stack behavior with compiled controls before changing them. Reuse working support. First interchange profile may support direct recursion only; mutually recursive, higher-order, dynamic and effectful forms must explicitly qualify or refuse.
- Version additive function/control-flow/recursive records in the existing upper interface. Preserve old identities and historical decoding policy; reject unknown versions and malformed call graphs. Do not reuse old OSC profile IDs under new .om meanings.
- Realize admitted programs through the existing seeded .om path: use qualified native bounded calls, tail-call-to-loop lowering, or bounded explicit frames as evidence selects. Keep all bounds and observable behavior checked. No unconditional Y expansion.
- Submit source/upper/lowering/native relations to #623's independent validation boundary. A no-trap proof or a signed code hash alone is not translation equivalence.
- Differentially test bounded tree evaluation and tail-recursive accumulation against an independent reference. Cover zero/one/exact-limit/limit+1, deep and branching trees, missing base case, arithmetic edge cases, argument order and bad return continuations.
- Compiled mutants must detect removed fuel decrement, off-by-one frame checks and changed evaluation/return behavior. Compare outputs and declared traps before timing.
- Report elapsed time, actual steps, maximum frames/bytes and preparation cost versus a matched iterative .om baseline. Publish no-win cases. Feed fixtures/results into #624 and a .om tutorial.
Dependencies and ownership
#625 contract -> #621 versioned representation -> this realization slice with #623 validation -> #624 qualification. Dependencies mean specific consumed artifacts, not wholesale upstream issue closure. #622/#626/#627 adapters may advertise recursion only after their own profile qualifies. Runtime memoization is a separate experiment, not a prerequisite for basic correctness.
Direction and delivery
Drake, 2026-10-23: .osc is legacy; .om is the only forward source-language path. All new first-party production computation, examples and teaching fixtures for this work use handwritten seeded .om through the existing toolchain. Do not add .osc features, require users to pass through .osc, or disguise a C/Rust/Python compiler/runtime fallback. Existing legacy code is reference/migration evidence only. Preserve immutable historical receipts and explicitly version any interface/identity migration; a filename rename is not semantic qualification. Reuse #599 and architecture aien-dev/aien-architecture-mv#295/#298 ownership. Reconcile live branches, issue comments, ledger/worktree claims and applicable instructions before editing; main is not the complete active implementation. Keep existing owners and Renda publication/judge workflow. Tests run under the established local Spark policy; offline/host and physical-chip evidence remain distinct. Record exact source/tool/binary pins, commands, exits, failures, resource usage and independent final-source review. Missing execution is NOT_RUN; no completion from a plan, a branch or hash equality.