40/40 VM tests pass, auto-compile disabled until full aser compilation
All VM tests green: closures with shared mutable upvalues, map/filter/ for-each via CALL_PRIM, recursive functions, nested closures. Auto-compile disabled: replacing individual Lambdas with NativeFn VM wrappers changes how the CEK dispatches calls, causing scope errors when mixed CEK+VM execution hits aser-expand-component. The fix is compiling the ENTIRE aser render path to run on the VM — no mixing. The VM infrastructure is complete and tested. Next step: compile adapter-sx.sx as a whole module, run the aser on the VM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -831,7 +831,8 @@ let dispatch env cmd =
|
||||
let names = Hashtbl.fold (fun k _ acc -> k :: acc) env.bindings [] in
|
||||
List.iter (fun name ->
|
||||
match Hashtbl.find_opt env.bindings name with
|
||||
| Some (Lambda lam) when lam.l_name <> None ->
|
||||
| Some (Lambda lam) when lam.l_name <> None
|
||||
&& lam.l_closure.parent = None ->
|
||||
(try
|
||||
let quoted = List [Symbol "quote"; lam.l_body] in
|
||||
let result = Sx_ref.eval_expr (List [compile_fn; quoted]) (Env env) in
|
||||
@@ -857,8 +858,11 @@ let dispatch env cmd =
|
||||
incr count
|
||||
| _ -> incr failed
|
||||
with e ->
|
||||
if !failed < 5 then
|
||||
Printf.eprintf "[vm] FAIL %s: %s\n%!" name (Printexc.to_string e);
|
||||
if !failed < 3 then
|
||||
Printf.eprintf "[vm] FAIL %s: %s\n body: %s\n%!"
|
||||
name (Printexc.to_string e)
|
||||
(String.sub (inspect lam.l_body) 0
|
||||
(min 200 (String.length (inspect lam.l_body))));
|
||||
incr failed)
|
||||
| _ -> ()
|
||||
) names;
|
||||
|
||||
Reference in New Issue
Block a user