Repository navigation
v0.2.0-alpha
·
127 commits
to main
since this release
Added
- Phase 5 JIT (spec §19.2): new
prima-jitcrate compiles numeric scalar MFn bodies (ExprDAG → bytecode → cranelift IR → native) with cranelift; the interpreter auto-compiles a numeric MFn after 100 numeric calls (or on the first call with the@jitannotation), and runs it natively (f(to_f64(101))after a1..100warm-up loop goes native). jit(...)builtin: returns a callableValue::JitFunctionfor an MFn name, a symbolic expression, orgrad(f)— single-output forward compilation, multi-variable reverse-mode gradient, with an interpreted fallback when compilation is unavailable (spec §19.2 composable optimization).- Automatic differentiation (spec §19.4 stages 2–3): forward-mode dual numbers (
ad::forward_derivative) and reverse-mode tape (ad::Tape) over numeric scalar DAGs; the tape powersjit(grad(f)). - Optimization pipeline (spec §10.2):
core::optconstant folding + CSE (hash-consing shares subexpressions); interpreter tail-call optimization for hostfnbodies ending in a directreturn f(args)(trampolined, constant stack space). - C ABI export:
prima compile --emit-c-abibuilds a real shared library (cdylibshell crate re-exporting@c_api::externfunctions via the interpreter) plus its C header (spec §18.4/§19.3). prima_runtime::capi::call_file_export: thread-cached evaluation of a.pramodule followed by an exported-function call, powering the C ABI wrappers.- Criterion benchmark
bench_jitcomparing interpreted vs compiled (JIT) evaluation ofx^4 + sin(x)*x + exp(x)(≈11× faster native; spec §19.2 acceptance). - Reference examples
examples/jit.praandexamples/autodiff.prafor hot-path JIT and automatic differentiation. - Release workflow now also builds a selection of Tier-2-with-host-tools targets:
x86_64-unknown-linux-musl,aarch64-unknown-linux-musl,riscv64gc-unknown-linux-gnu,armv7-unknown-linux-gnueabihf,powerpc64le-unknown-linux-gnu,s390x-unknown-linux-gnu.