runtime: restore the three builtins that made elc unrebuildable #125

Merged
will.anderson merged 1 commits from fix/elc-rebuildable-compiler-builtins into dev 2026-08-16 00:50:44 +00:00
Owner

The committed elc binary could not be refreshed from its own source. Rebuilding failed with three implicit-declaration errors: el_mem_check, stdout_to_file, stdout_restore. The compiler's own source calls all three (compiler.el:472,479,574, codegen.el:4248) and two are registered in codegen.el's builtin_arity table — but none were defined in this runtime.

They were found intact in ui/examples/native-hello-ios/NativeHello/el_runtime.c — a divergent private copy of this runtime that still carried them. Ported verbatim.

Why it mattered: the canonical elc was frozen. Source gained @route dispatch codegen (emit_route_dispatch, codegen.el:3948) and the @manager boundary-beat seam, but no rebuilt binary could carry them — so neuron's soul, whose routes.el calls the compiler-synthesized el_route_dispatch, could not be built at all.

Verified after the fix:

  • elc rebuilds from current source, clean
  • self-hosting fixpoint byte-identical (stage3 == stage2)
  • the rebuilt elc emits el_route_dispatch (2 occurrences in the soul amalgam, previously 0) and injects engram_boundary_beat at @manager boundaries — the decorator seam is live rather than inert

Note: el_mem_check is itself the compiler's memory guard (ELC_MAX_MEM_MB, default 512MB, self-terminates before the OS OOM-killer). The runtime was missing the very guard that would have surfaced the compiler's memory blowup as a clean error instead of a 27GB host-killer.

**The committed `elc` binary could not be refreshed from its own source.** Rebuilding failed with three implicit-declaration errors: `el_mem_check`, `stdout_to_file`, `stdout_restore`. The compiler's own source calls all three (`compiler.el:472,479,574`, `codegen.el:4248`) and two are registered in `codegen.el`'s `builtin_arity` table — but none were defined in this runtime. They were found intact in `ui/examples/native-hello-ios/NativeHello/el_runtime.c` — a divergent private copy of this runtime that still carried them. Ported verbatim. **Why it mattered:** the canonical `elc` was frozen. Source gained `@route` dispatch codegen (`emit_route_dispatch`, codegen.el:3948) and the `@manager` boundary-beat seam, but no rebuilt binary could carry them — so neuron's soul, whose `routes.el` calls the compiler-synthesized `el_route_dispatch`, could not be built at all. **Verified after the fix:** - `elc` rebuilds from current source, clean - self-hosting fixpoint **byte-identical** (stage3 == stage2) - the rebuilt `elc` emits `el_route_dispatch` (2 occurrences in the soul amalgam, previously **0**) and injects `engram_boundary_beat` at `@manager` boundaries — the decorator seam is live rather than inert Note: `el_mem_check` is itself the compiler's memory guard (`ELC_MAX_MEM_MB`, default 512MB, self-terminates before the OS OOM-killer). The runtime was missing the very guard that would have surfaced the compiler's memory blowup as a clean error instead of a 27GB host-killer.
will.anderson added 1 commit 2026-08-16 00:50:29 +00:00
runtime: restore the three builtins that made elc unrebuildable
El SDK CI - dev / build-and-test (pull_request) Failing after 3m52s
598915cc61
The committed elc binary could not be refreshed from its own source. Rebuilding
failed with three implicit-declaration errors: el_mem_check, stdout_to_file,
stdout_restore. The compiler's own source calls all three (compiler.el:472,479,574
and codegen.el:4248) and two are registered in codegen.el's builtin_arity table —
but none were defined in this runtime.

They were found intact in ui/examples/native-hello-ios/NativeHello/el_runtime.c,
a divergent private copy of this runtime that still carried them. Ported verbatim.

Consequence of them being missing: the canonical elc binary was frozen. Source
gained @route dispatch codegen (emit_route_dispatch, codegen.el:3948) and the
@manager boundary-beat seam, but no rebuilt binary could carry them, so
neuron's soul — whose routes.el now calls the compiler-synthesized
el_route_dispatch — could not be built at all.

Verified after the fix:
  - elc rebuilds from current source, clean.
  - Self-hosting fixpoint byte-identical (stage3 == stage2).
  - The rebuilt elc emits el_route_dispatch (2 occurrences in the soul amalgam,
    previously 0) and injects engram_boundary_beat at @manager boundaries,
    i.e. the decorator seam is live rather than inert.

el_mem_check is itself the compiler's memory guard (ELC_MAX_MEM_MB, default
512MB, self-terminates before the OS OOM-killer fires) — so the runtime was
missing the very guard that would have surfaced the compiler's memory blowup
as a clean error instead of a 27GB host-killer.
will.anderson merged commit d545b69614 into dev 2026-08-16 00:50:44 +00:00
Sign in to join this conversation.