Formally Verified Speculation and Deoptimization in a JIT Compiler
summary
A formal model defines a JIT’s middle end, an RTL-like IR and two concrete speculative ops: the anchor instruction which marks safe deoptimization points and the assume instruction which checks hypotheses and triggers deoptimization. Each optimization pass is proved correct with backward simulations, inlining proves correct by synthesizing missing stack frames, and non-determinism from speculation is handled so standard passes like constant propagation reuse forward-to-backward proofs. An OCaml extraction plus an unverified LLVM backend runs examples and shows measurable speedups though native codegen is not verified.
AI-written summary · about
chapters (23)
- 0:00Intro
- 0:15JIT COMPILATION
- 1:09FORMALLY VERIFIED STATIC COMPILATION
- 1:55RUNNING A JIT COMPILER
- 3:32SPECULATIVE OPTIMIZATIONS IN JIT COMPILERS
- 4:19SPECULATIVE OPTIMIZATIONS - EXAMPLE
- 5:16EXECUTING A PROGRAM WITH AJIT
- 6:08DESIGN AND VERIFICATION CHALLENGES
- 7:10JIT COMPILERS ARE COMPLEX SOFTWARE
- 8:02MODELING SPECULATION IN COQ
- 8:49JIT BEHAVIOR
- 10:04THE TWO SPECULATIVE INSTRUCTIONS OF CORER
- 11:28INSERTING SPECULATION
- 13:04ON-STACK REPLACEMENT: SYNTHESIZING STACKFRAMES
- 14:17PROVING OPTIMIZATIONS CORRECT IN A STATIC COMPILER
- 15:16INSERTING NEW SPECULATIONS
- 16:15LOUD SEMANTICS
- 17:36A MECHANIZED MIDDLE-END OPTIMIZER WITH SPECULATION
- 18:34NESTED SIMULATIONS FOR DYNAMIC OPTIMIZATIONS
- 19:30SPECIFYING A CORRECT JIT
- 20:20EXTRACTING THE JIT TO OCML
- 21:19RUNNING COREJIT
- 22:05A MECHANIZED JIT IN COQ
related talks
29mTowards Formally Verified Just-In-Time Compilation
24mFormally Verified Native Code Generation in an Effectful JIT: Turning the CompCe...
19mFormally Verifying Optimizations with Block Simulations
18mPreservation of speculative constant-time by compilation
14mCoSSJIT: Combining Static Analysis and Speculation in JIT Compilers
18mPreservation of Speculative Constant-time by Compilation
01h 06mVerifying a compiler through equational means
25mExorcising Spectres with Secure Compilers
