AI & Computingpreprint2026-08-02

Typed SSA NativeIR for Semantics-Preserving JIT and Static AOT in Gray

Open access0 citations

Abstract

This paper presents Gray’s typed NativeIR, a bounded control-flow representation used to compile an eligible numeric subset of Gray bytecode to native code on Linux x86-64 and Apple Silicon AArch64. The initial representation records typed values, basic blocks, predecessors, terminators, source locations, runtime exits, calls, relocations, and cancellation obligations. A selective local-to-SSA pass computes local liveness, inserts explicit Phi nodes at joins, rewrites promotable loads and stores, removes trivial Phis, compacts value identities, and revalidates the result. The same verified function then feeds architecture-specific emitters for Live JIT execution or is serialized into a Static artifact and loaded without startup compilation. Unsupported signatures, bytecodes, control-flow shapes, calls, targets, and resource bounds reject the whole function to the existing VM; Static artifacts retain bytecode for the same fallback and for explicit GRAY JIT=0 execution. Fresh Apple Silicon verification at source commit 4283424 passed IR, builder, allocator, control-flow, double, direct-call, bounded-fallback, leaf, main-region, class-method, layout, and four-policy cancellation gates. Four seeded differential fixtures contain 2,051 fixed or generated source-level calls per policy and produced identical observable output in Live JIT, Live VM, Static AOT, and Static VM modes. Two deterministic AArch64 Static builds of an 18-function fixture were byte-identical; the native bundle contained 1,408 bytes of function code and five relocations. A separate 31-round measurement placed complete Static artifact construction at a 6.201 ms median on this host. Retained, CPU-pinned Linux evidence passed the corresponding x86-64 IR and differential gates. A shared exact-reduction proof applied on both targets provides an extensibility case study, not a general language comparison. Gray does not yet provide a formal semantic-preservation proof, a general owned-value IR, AArch64 Linux emission, or a NativeIR-fed standalone native publisher. The contribution is a portable, refusal-safe compiler backend for a declared subset, rather than a collection of untracked benchmark accelerators.

// Source

View paper (DOI)Open access versionOpenAlexZenodo (CERN European Organization for Nuclear Research)Published 2026-08-02

Authors: Annabella Proctor

Institutions: Skyworth (China)