From a62b7c8a5ecfde216bbea8192526aeac8ae55a76 Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 19 Mar 2026 19:37:23 +0000 Subject: [PATCH] Disable auto-compile until CEK fallback is robust The vm-compile replaces Lambda values with NativeFn wrappers. When the VM can't execute (missing env vars, unsupported ops), it falls back to cek_call. But cek_call needs proper Env values that the snapshot doesn't provide. Fix needed: VM closures must capture the LIVE env (not snapshot), or the CEK fallback must construct a proper Env from the globals. Disabling until this is resolved. Co-Authored-By: Claude Opus 4.6 (1M context) --- shared/sx/ocaml_bridge.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shared/sx/ocaml_bridge.py b/shared/sx/ocaml_bridge.py index da17dd5..076b742 100644 --- a/shared/sx/ocaml_bridge.py +++ b/shared/sx/ocaml_bridge.py @@ -265,11 +265,9 @@ class OcamlBridge: _logger.info("Loaded %d definitions from .sx files into OCaml kernel (%d skipped)", count, skipped) - # Auto-compile disabled for now — compiler needs more features - # (closures, scope ops, etc.) before it can safely replace - # live functions. Infrastructure is ready: - # await self._send('(vm-compile)') - # await self._read_until_ok(ctx=None) + # VM auto-compile ready but disabled until compiler handles + # all SX features and CEK fallback works correctly. + # Enable with: await self._send('(vm-compile)') except Exception as e: _logger.error("Failed to load .sx files into OCaml kernel: %s", e) self._components_loaded = False # retry next time