From 62d8602de4fc176ccb7a4ebc30cffa48e9f481d8 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 29 Mar 2026 19:54:13 +0000 Subject: [PATCH] JIT: skip recompilation for known-failed closure names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New closure instances of functions like parse-loop get l_compiled=None even though a previous instance already failed. Now check _jit_warned by name and immediately sentinel-mark new instances of known failures. The first failure is always logged. Subsequent instances are silently sentinel-marked — no recompilation, no log spam, no suppressed errors. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/sx_server.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/ocaml/bin/sx_server.ml b/hosts/ocaml/bin/sx_server.ml index f86b573b..0b168dac 100644 --- a/hosts/ocaml/bin/sx_server.ml +++ b/hosts/ocaml/bin/sx_server.ml @@ -728,6 +728,8 @@ let register_jit_hook env = | Some _ -> None (* compile failed or disabled — CEK handles *) | None -> if !_jit_compiling then None + else if Hashtbl.mem _jit_warned fn_name then + (l.l_compiled <- Some Sx_vm.jit_failed_sentinel; None) else begin _jit_compiling := true; let t0 = Unix.gettimeofday () in