Repository navigation
Universal Chameleon Polyglot Engine
In conventional toolchains, crossing an FFI boundary (extern "C", JNI, Python C-API, N-API, cgo, P/Invoke) discards compile-time guarantees: null pointers, misaligned tensor strides, unpinned GC references, dangling callback arenas, and out-of-range integers silently corrupt host memory.
Implemented in compiler/stage1/lchameleon.src, Lume's Universal Chameleon Polyglot Engine eliminates unverified foreign boundaries across 9 ecosystems:
-
256 / 256certified obligations (160provenQF_LIAtheorems +96@boundWCET budgets,0runtime/refuted). -
160 / 160functions symbolically translation-validated (ltv) across1,781native boundary vectors (0rejected). -
0 / 2,392uncovered Masking MC/DC conditions (2,118native witnesses +256law conclusions +18lcert-proven infeasible). -
19 / 19native unit tests + dedicated C header preprocessor gate (tests/harness/c_adapter_gate.src).
Every foreign payload enters Lume as unverified[T] inside the / {ffi} capability effect and must pass a synthesized [I0003] QF_LIA refinement gate (plus FFI callback arena epoch guards preventing use-after-reset callbacks) before promotion to verified[T].
| Ecosystem ID | Target Runtime & ABI |
[I0003] Formal Boundary Contract & Zero-Copy Mechanism |
CLI Command |
|---|---|---|---|
c_abi |
C / C++ (SysV AMD64 / Win64 / AAPCS64) |
Built-in C header preprocessor (--preprocess expanding #define, typedef, enum, structs & Linux io_uring syscalls 425..427), @repr(c) layout, ptr != 0, alignment & [0..cap] bounds |
lume adapt c --preprocess <h> |
rust_cdylib |
Rust (cdylib / #[repr(C)] / extern "C") |
Affine own / &T Perceus lifetime parity, borrow exclusivity, and panic = "abort" FFI boundary isolation |
lume adapt rust <lib.rs> |
python_capi |
Python 3.12+ (PyObject* / DLPack) |
Py_INCREF/Py_DECREF balance + DLPack zero-copy NDArray tensor bridge (64 B alignment, shape_dim >= 1, monotone strides) |
lume adapt python <mod.py> |
node_napi_wasm |
Node.js / TypeScript (N-API v9 & WASM32) |
Linear memory page-bound verification (offset + len <= wasm_pages * 65536, [I0275]) & UTF-8 slice validation |
lume adapt js <index.d.ts> |
go_cshared |
Go (-buildmode=c-shared / cgo) |
runtime.Pinner enforcement forbidding unpinned Go heap pointers from crossing into Lume |
lume adapt go <pkg.go> |
java_jni |
Java / Kotlin (JNI & JDK 22+ Panama FFM) |
PushLocalFrame / PopLocalFrame capacity balance (<= 64) and MemorySegment byte bounds |
lume adapt java <Api.java> |
dotnet_pinvoke |
C# / .NET 8+ (P/Invoke & NativeAOT) |
GCHandle.Alloc(Pinned) blittable struct size/alignment verification and span bounds |
lume adapt dotnet <Api.cs> |
sql_relational |
SQL (PostgreSQL / SQLite / DuckDB) |
DDL/DML schema lifting to typed table[T] with exact base-10 decimal scale & ACID WAL invariants |
lume adapt sql <schema.sql> |
openapi_rpc |
OpenAPI 3.1 / JSON-Schema / gRPC | Authenticated TLS 1.3 transport + bounded payload contracts (0 < body <= max_bytes) |
lume adapt openapi <api.yaml> |
lume chameleon # Inspect all 9 verified ecosystems & [I0003] contract status
lume adapt c --preprocess include/api.h # Preprocess C macros/typedefs and emit fail-closed [I0003] bindings
lume adapt python model_bridge.py # Synthesize Python C-API + zero-copy DLPack tensor adapter
lume morph legacy_service.py # Transpile legacy C/Python/JS/Rust/Go/SQL into verified Lume (.src)When Lume passes a callback handle or arena-backed buffer to foreign C/Rust/Python code, lchameleon.src pairs pointer/alignment guards with monotonic arena epoch tokens:
@no_alloc
@bound(48)
pub fn chameleon_dlpack_ingest(data_ptr: int, ndim: int, numel: int, alignment: int, cb_epoch: int, live_epoch: int) -> int / pure
requires data_ptr > 0 and ndim >= 1 and ndim <= 8 and numel > 0 and alignment == 64 and cb_epoch == live_epoch
ensures result == numel and result > 0
= numel
Any null pointer, unaligned DLManagedTensor, negative byte count, or stale arena epoch (cb_epoch != live_epoch) fails closed with ERR:[I0003] at the foreign perimeter before pure Lume logic executes.
Beyond traditional FFI, lchameleon.src and compiler/stage1/lneural_cartridge.src implement LumePuter, compiling verified Lume functions directly into .safetensors neural weight cartridges (--target safetensors and --target lumeputer-rv32im-weights):
- Encodes program execution into
SwiGLU(K = 128) projections (swiglu_gate_proj,swiglu_up_proj,swiglu_down_proj),Gated-DeltaNetrecurrent state,RV32IM_Zbainstruction ROM (deltanet_rom), andRMSNormintegrity ballast (ballast_rmsnorm_guard) with an embeddedlcertproof certificate. - Verified in
lume safetensors-gate(G-SAFETENSORS):63 / 63argument vectors execute100.0%bit-identically across.safetensorsforward passes, nativex86-64, and theLumePuteremulator, while99damaged files and opcode/weight tamper attempts are deterministically caught.
lchameleon.src also houses Lume's verified operational physics and statistical process control engine (lume singularity / lume ote):
-
Dynamical Singularity Boundary (
$\Omega$ ): Dual-regime underdamped/overdamped 2nd-order step identification ($\zeta \in (0, 100]$ ), Operational Power Triangle ($S^2 = P^2 + Q^2$ , power factor$\cos\Phi$ ), counter-phase Singularity Boundary theorem ($\tau_{\max} = T_m / 4$ where transport delay drives phase margin to zero), Nyquist sampling guard, and$3\times$ cascade control loop bandwidth decoupling. -
Bayesian & Operations Research Kernels: Conjugate Beta-Binomial posterior SPC (
spc_beta_binomial_posterior_num), Page's tabular CUSUM shift detection (spc_cusum_upper_step_milli), Critical Path Method total float (ops_cpm_total_float_hours),$k$ -anonymity disclosure guard (analytics_k_anonymity_release_ok), and Pool-Adjacent-Violators (PAVA) monotonic isotonic regression (analytics_pava_monotonic_pair_hi).
stage2 == stage3) · OmniProof-v4 (1,682 Proofs · 372 Tests · 122 Domains) · Signed Qualification Dossier PASS (106/106 Probes · 21/21 Gates · 0/9,618 Uncovered MC/DC) · 118 [C0011] Constant-Time Crypto Kernels · 9-Ecosystem Chameleon FFI ([I0003]) · 27 Targets · Licensed under Apache-2.0
- Home
- Getting Started
- Core Architecture & Assurance
- LumeLabs & Community
- Dossiers & Reference Manuals