jit: in-process ORC LLJIT is the default REPL backend (perf plan Phase 2) - #341
Merged
Conversation
…nger collides in one JITDylib
…es instead of redefining (ORC JITDylib rejects duplicates)
…dupe The redefinition path's filtered prev_slots + emit-name renaming merged with this branch's session_wraps threading; redefinition emits carry both. Validated: repl_jit_cross_line 12/12, repl_jit_regression 15/15, test_jit 7/7 (incl. the new redefinition trio on both backends through the merged run_decl), parity 16/16.
…urface Kept both harnesses in test_jit.ml (check_session + redefinition trio) under one suite; dune rule keeps MARCH_BIN + both source trees. Validated: cross_line 12/12, regression 15/15, test_jit 13/13, parity 16/16.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of docs/superpowers/plans/2026-08-23-interpreter-and-repl-jit-performance.md (sequencing Gate G2, Lane P). Per-line REPL compile latency drops from ~210-290 ms (clang subprocess + dlopen) to <1 ms.
Six commits, in dependency order:
Jit_orc.available— no-raise, cached libLLVM probemarch_orc_add_irno longer double-frees the ThreadSafeModule on the error path (LLVM's add consumes it unconditionally — verified against LLJIT.h)MARCH_JIT_BACKEND=clangrestores the old backend; unrecognized values fall back to clang as before; resolution is lazy so--compilenever dlopens libLLVMRepl_jit.t(a process with many REPL sessions — test suites, embedders — no longer collides in one JITDylib)$clo_wrapdedupe: second fragment declares instead of redefining, with wrap records committed only after the fragment actually compilesParity: every REPL/compiler parity test runs on BOTH backends (16 cases). Suites at head: compiler 932 / eval 272 / codegen 589 / stdlib 877 / stdlib_march 61 / jit 4 / snapshots 33 — all green (two transient rows in one run were external SIGKILLs from a sibling session's process sweep, re-verified green in isolation). AOT byte-identical by IR-oracle on a program that exercises the changed emitter paths.