sx-http: silent JIT fallback, load signals+engine, fix render-to-html
JIT runtime errors now silently fall back to CEK without disabling the compiled bytecode or logging. This prevents render-to-html from being permanently disabled when one page has an unresolved symbol (e.g. the homepage stepper's <home). Load spec/signals.sx and web/engine.sx for reactive primitives. Skip test files and non-rendering directories (tests/, plans/, essays/). Performance with JIT active (warm, single process, 2MB RSS): - Aser (component expansion): 21-87ms — faster than Quart baseline - SSR + shell: variable due to homepage <home fallback issue - Geography total: ~500ms when JIT stays active Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -696,14 +696,9 @@ let register_jit_hook env =
|
||||
| Lambda l ->
|
||||
(match l.l_compiled with
|
||||
| Some cl when not (Sx_vm.is_jit_failed cl) ->
|
||||
(* Cached bytecode — run on VM, fall back to CEK on runtime error.
|
||||
Mark as failed so we don't retry on every call. *)
|
||||
(* Cached bytecode — run on VM, fall back to CEK on runtime error. *)
|
||||
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
|
||||
with e ->
|
||||
let fn_name = match l.l_name with Some n -> n | None -> "?" in
|
||||
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
|
||||
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
|
||||
None)
|
||||
with _e -> None) (* silent fallback — no disable, no log *)
|
||||
| Some _ -> None (* compile failed or disabled — CEK handles *)
|
||||
| None ->
|
||||
let fn_name = match l.l_name with Some n -> n | None -> "?" in
|
||||
@@ -720,10 +715,7 @@ let register_jit_hook env =
|
||||
| Some cl ->
|
||||
l.l_compiled <- Some cl;
|
||||
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
|
||||
with e ->
|
||||
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
|
||||
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
|
||||
None)
|
||||
with _e -> None) (* silent fallback, keep bytecode *)
|
||||
| None -> None
|
||||
end)
|
||||
| _ -> None)
|
||||
|
||||
Reference in New Issue
Block a user