Recompile all 26 .sxbc with define-library wrappers + fix eval/JIT

All 26 browser modules recompiled with define-library/import forms.
Compilation works without vm-compile-adapter (JIT pre-compilation
hangs with library wrappers in some JIT paths — skipped for now,
CEK compilation is ~34s total).

Key fixes:
- eval command: import-aware loop that handles define-library/import
  locally without touching the Python bridge pipe (avoids deadlock)
- compile-modules.js: skip vm-compile-adapter, bump timeout

2621/2621 OCaml tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 00:08:00 +00:00
parent ac772ac357
commit 7b4c918773
48 changed files with 8884 additions and 5899 deletions

View File

@@ -200,6 +200,14 @@ let () =
(match Hashtbl.find_opt a "__host_handle", Hashtbl.find_opt b "__host_handle" with
| Some (Number ha), Some (Number hb) -> ha = hb
| _ -> false)
(* Records: same type + structurally equal fields *)
| Record a, Record b ->
a.r_type.rt_uid = b.r_type.rt_uid &&
Array.length a.r_fields = Array.length b.r_fields &&
(let eq = ref true in
for i = 0 to Array.length a.r_fields - 1 do
if not (safe_eq a.r_fields.(i) b.r_fields.(i)) then eq := false
done; !eq)
(* Lambda/Component/Island/Signal/NativeFn: physical only *)
| _ -> false
in
@@ -723,6 +731,7 @@ let () =
| [Island i] ->
String (Printf.sprintf "~%s" i.i_name)
| [Lambda _] -> String "<lambda>"
| [Record r] -> String (Printf.sprintf "#<%s>" r.r_type.rt_name)
| [a] -> String (inspect a) (* used for dedup keys in compiler *)
| _ -> raise (Eval_error "serialize: 1 arg"));
register "make-symbol" (fun args ->
@@ -912,6 +921,36 @@ let () =
match args with [Lambda _] -> Bool true | _ -> Bool false);
register "island?" (fun args ->
match args with [Island _] -> Bool true | _ -> Bool false);
(* R7RS records *)
register "record?" (fun args ->
match args with [v] -> record_p v | _ -> Bool false);
register "make-rtd" (fun args ->
match args with [name; fields; ctor_params] -> make_rtd name fields ctor_params
| _ -> raise (Eval_error "make-rtd: expected (name fields ctor-params)"));
register "make-record" (fun args ->
match args with [uid; arg_list] -> make_record uid arg_list
| _ -> raise (Eval_error "make-record: expected (uid args-list)"));
register "record-ref" (fun args ->
match args with [v; idx] -> record_ref v idx
| _ -> raise (Eval_error "record-ref: expected (record index)"));
register "record-set!" (fun args ->
match args with [v; idx; nv] -> record_set_b v idx nv
| _ -> raise (Eval_error "record-set!: expected (record index value)"));
register "record-type?" (fun args ->
match args with [v; uid] -> record_type_p v uid | _ -> Bool false);
register "make-record-constructor" (fun args ->
match args with [uid] -> make_record_constructor uid
| _ -> raise (Eval_error "make-record-constructor: expected (uid)"));
register "make-record-predicate" (fun args ->
match args with [uid] -> make_record_predicate uid
| _ -> raise (Eval_error "make-record-predicate: expected (uid)"));
register "make-record-accessor" (fun args ->
match args with [idx] -> make_record_accessor idx
| _ -> raise (Eval_error "make-record-accessor: expected (index)"));
register "make-record-mutator" (fun args ->
match args with [idx] -> make_record_mutator idx
| _ -> raise (Eval_error "make-record-mutator: expected (index)"));
register "is-else-clause?" (fun args ->
match args with
| [Keyword "else"] -> Bool true