From ac772ac3575d30eb3d3ae0f6f0b489bbd3f84bbb Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 3 Apr 2026 23:31:41 +0000 Subject: [PATCH] IO-aware eval for server dispatch + compile-modules timeout bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sx_server.ml: the "eval" command now uses cek_run_with_io instead of raw eval_expr. This handles import suspensions during eval-blob (needed for .sx files with define-library/import wrappers). compile-modules.js: timeout bumped 5min → 10min for sxbc compilation with define-library overhead. 2608/2608 tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/sx_server.ml | 4 +++- hosts/ocaml/browser/compile-modules.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hosts/ocaml/bin/sx_server.ml b/hosts/ocaml/bin/sx_server.ml index b38d7a6b..7755c566 100644 --- a/hosts/ocaml/bin/sx_server.ml +++ b/hosts/ocaml/bin/sx_server.ml @@ -1030,7 +1030,9 @@ let rec dispatch env cmd = (try let exprs = Sx_parser.parse_all src in let result = List.fold_left (fun _acc expr -> - Sx_ref.eval_expr expr (Env env) + (* Use IO-aware eval to handle import suspensions *) + let state = Sx_ref.make_cek_state expr (Env env) (List []) in + cek_run_with_io state ) Nil exprs in (* Use ok-raw with natural list serialization — no (list ...) wrapping. This preserves the SX structure for Python to parse back. *) diff --git a/hosts/ocaml/browser/compile-modules.js b/hosts/ocaml/browser/compile-modules.js index e2b6d096..2529e927 100644 --- a/hosts/ocaml/browser/compile-modules.js +++ b/hosts/ocaml/browser/compile-modules.js @@ -88,7 +88,7 @@ const t1 = Date.now(); const result = spawnSync(binPath, [], { input: fs.readFileSync(tmpFile), maxBuffer: 100 * 1024 * 1024, // 100MB - timeout: 300000, // 5 min + timeout: 600000, // 10 min stdio: ['pipe', 'pipe', 'pipe'], });