Cortex: Neural-Symbolic Programming for Energy-Efficient Code Execution

January 12, 2026 whitepaper introducing Cortex: a polyglot tree-sitter ingestion, 128-dim Mamba context monitor, SSA optimizer, and Cranelift/Metal execution prototype, with November 25, 2026 errata scoping its 5-language evaluation, 34.4x energy ratio, and in-house interpreter baseline.

Architecture visual for neural-symbolic compilation and deterministic runtime execution
Architecture visual for neural-symbolic compilation and deterministic runtime execution

Temporal & Archival Scope: Era 0 Historical Whitepaper (Originally dated January 12, 2026; verbatim historical summary followed below by dated November 25, 2026 Errata & Related Work Addendum) · Canonical OpenIE Chronicle Entry: https://blog.openie.dev/posts/wp-cortex-neural-symbolic-programming/ · Original Archival PDF: https://blog.openie.dev/papers/archive/03-Cortex-Neural-Symbolic-Programming.pdf

Provenance & Telemetry Hygiene: Signed Provenance · Self-Checked (automated OpenIE internal gates; not externally peer-reviewed) · Energy Class: est_j (measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered — Verification, Licensing & AI-Use Disclosure · Glossary & Non-Mixing Rules).

Part I: Contemporary Historical Summary (As Written in January 2026)

Historical Source Provenance (Original Date: January 12, 2026): David Jean Charlot, PhD · Open Interface Engineering. Preserved from our January 2026 systems runtime series (Download Original Jan 2026 PDF).

Abstract: Closing the Interpret-vs-Reason Gap

In January 2026 we asked why AI-assisted software workflows often incurred a double overhead: burning tens of joules in a cloud LLM to translate or inspect glue scripts across language boundaries, and then paying a dynamic-interpreter execution overhead on every run.

Cortex was an early neural-symbolic runtime prototype in Rust designed to ingest polyglot source files into a unified Static Single Assignment (SSA) intermediate representation, monitor execution context via an embedded 128-dimensional selective state-space model (Mamba), run scalar and elementwise tensor optimization passes, and lower hot paths to Cranelift native JIT or Apple Metal GPU compute shaders.

Four-Layer Cortex Pipeline

Layer 1: Polyglot Ingestion (21 tree-sitter Parser Grammars Wired + Usage-Based Type Inference)
   │      Benchmarked lowering on 5 languages: Rust, Python, Go, JavaScript, C (see Errata)
   ▼
Layer 2: Neural Context Tracker (128-dim Selective SSM + `infer` introspection primitive)
   │      Delta[k] = softplus(u[k] * W_Delta)   (~0.05 J modeled local state step vs. ~50 J cloud LLM)
   ▼
Layer 3: SSA IR PassManager
   │      Dead Code Elim (DCE) · CSE · Constant Folding · LICM · Elementwise Tensor Fusion
   ▼
Layer 4: Multi-Backend Execution Engine
          ├── Zero-Warmup AST/Bytecode Interpreter (one-shot tiny scripts)
          ├── Rayon `parfor` Work-Stealing CPU Pool
          ├── Cranelift Native JIT (~100 ms warmup)
          └── Apple Metal Compute Backend (fused GPU shaders)

1. Usage-Based Polyglot Lifting (96.0% Across 500 Programs in 5 Languages)

While the ingestion crate linked 21 tree-sitter language grammars (Superseded / corrected — see Nov 25, 2026 Errata below), Cortex evaluated bottom-up usage-based type specialization across a 500-program benchmark spanning 5 languages (100 programs per language), lifting and executing 480 of 500 programs (96.0%) without manual type annotations:

2. Multi-Backend Matmul & Composite Pipeline Benchmarks

On a 1000 x 1000 f32 matrix multiplication microbenchmark (2.0e9 FLOPs) measured relative to Cortex’s own unoptimized interpreter (Superseded / corrected — see Nov 25, 2026 Errata below):

Across composite polyglot pipeline tasks (lifting + local context check + native execution vs. cloud LLM + interpreted execution), the January 2026 paper reported modeled mean energy falling from 110 J to 3.2 J, summarizing the interval in prose as "35–100x" (Superseded / corrected — see Nov 25, 2026 Errata below).

Contemporary v0.1 Limitations Noted in January 2026


Arithmetic & Baseline Scope Errata (2026-11-25 Audit)

  1. Exact Task Energy Ratio (110 J / 3.2 J = 34.4x, Below Stated 35x Floor): Dividing the 110 J baseline numerator by the 3.2 J Cortex composite denominator yields 34.375x (34.4x), which falls slightly below the rounded "35–100x" headline interval printed in the January 2026 PDF. We report 34.4x explicitly.
  2. Scoping "21-Language" Ingestion vs. 5-Language Empirical Evaluation: Linking 21 tree-sitter grammar crates provided syntactic Concrete Syntax Tree (CST) parsing across 21 languages, not verified semantic SSA lowering across 21 languages. All 480 / 500 (96.0%) lift-and-execute validation was conducted strictly across the 5 languages in Table 1 (Rust, Python, Go, JavaScript, and C); the other 16 grammars were parser-only stubs in January 2026.
  3. Matmul Baseline Disclosure (In-House Interpreter, NOT Tuned BLAS / Accelerate / cuBLAS): Both the 19.5x (8,200 ms / 420 ms) Cranelift speedup and the 182.2x (8,200 ms / 45 ms) Metal speedup used Cortex’s own unoptimized scalar AST/bytecode interpreter (8,200 ms, ~0.24 GFLOPS) as the 1.0x baseline denominator—NOT a vendor-tuned linear-algebra library (Apple Accelerate / AMX, OpenBLAS, Intel MKL, or cuBLAS). At 2.0e9 FLOPs (2 * 1000^3), 45 ms on Metal corresponds to ~44.4 GFLOPS (a naive un-tiled shader), whereas tuned Apple Accelerate cblas_sgemm or Metal MPSMatrixMultiplication executes 1000 x 1000 f32 matmul in < 1 ms (> 2,000 GFLOPS). The table therefore measures internal interpreter-to-JIT/GPU lowering inside Cortex v0.1, not state-of-the-art GEMM throughput.
  4. Epistemic & Licensing Status (est_j, Private Prototype): Energy figures (41.0 J -> 2.1 J -> 0.9 J and 110 J -> 3.2 J) were analytical active-wattage envelope × wall-clock estimates (est_j). Archival PDF (#03) is public at /papers/archive/03-Cortex-Neural-Symbolic-Programming.pdf under CC BY-ND 4.0. The January 2026 Cortex prototype in openIE-dev/energy-efficient-agi is a private repository (unreproduced externally); our clean-room deterministic IR successor is public at openIE-dev/rce.

Chronological Evolution Within OpenIE Research

  1. Decoupling Verified Execution From Neural State (Reality Code Engine (RCE)): Examined the fragility of mixing heuristic SSM activations into an execution runtime by separating deterministic verified IR semantics (2,221 checks in openIE-dev/rce) from learned predictors.
  2. Hardware-Counter Compiler Memoization (RCE-Compile): Addressed Cortex’s ~100 ms JIT warmup tax via content-addressed build caching, measured at up to 448.5x warm-cache cut (chip counter, reported_j).
  3. Latent Predictive World Models (RCE-JEPA): Explored calibrated Joint-Embedding Predictive Architecture (JEPA) latent surprise signals gated by deterministic RCE invariants in place of Cortex’s hand-tuned 128-dim infer thresholds.

Changelog (2026-11-25)


Canonical Provenance, Primary Artifacts & Independent Replication