Skip to main content

LuaJIT runtime

This reference was audited against v2 commit 87824c4a82f4bb513874f2ede140ae36a67f48cc on 2026-10-12. The configured fork revision is 6b832995dc4faecd2e3473683df51bd0a9d47e09 with serialization profile ser1 (private dump version 0x80). The runtime and cloud compiler must use compatible revisions/profile; older cloud bytecode must be rebuilt when that profile changes.

Libraries​

LibraryAccessReference
Lua base functions, string, table, math, coroutineNormal globals; approved tables also resolve through requireLua 5.1 manual
bitGlobal bit or require("bit")LuaJIT BitOp
jitGlobal jit or require("jit")JIT controls
ffirequire("ffi"); no global ffi is createdFFI API

LuaJIT adds Lua language extensions. The client does not open io, os, or debug. jit.util is disabled. Direct load, loadstring, loadfile, dofile, and string.dump are unavailable. These restrictions apply equally to local and cloud scripts.

Module loading​

require("traceless") returns the shared custom root. Project modules are resolved by bundle name before approved built-ins, with a cache for each script instance. The names debug and jit.util are always denied, including matching project files. External filesystem/native searchers, preloads, and the stock package table are unavailable.

require permits the approved ffi, bit, jit, string, table, math, and coroutine tables. Module returns are cached; nil becomes true, while false can lead to re-execution on a subsequent require. Circular loading raises an error. Unload/replacement discards the instance's project-module cache.

Shared state​

Cloud and local projects share one Lua state. Globals, FFI declarations, built-in tables, and the traceless root can affect other scripts. Keep project state local and avoid replacing shared functions or codec settings without coordinating their use.

FFI and unsafe native access remain unrestricted. Library removal and cloud validation are not an isolation boundary against native access; see FFI and security.

Script metadata​

The runtime refreshes the shared __traceless global for the current script invocation. Capture its scalar values during the invocation instead of treating the global as a persistent identity for another callback or coroutine.

FieldTypeAvailability
identitystringScript storage/control identity
localbooleanLocal developer project flag; read as __traceless["local"]
versionintegerCurrent script version
runtime_idstringConfigured runtime compatibility ID
script_iddecimal stringCloud only; preserves unsigned 64-bit precision
account_idintegerCloud only
delivered_atdecimal stringCloud only; delivery timestamp
watermark64-character hexadecimal stringCloud only; inspection value populated after native validation

Metadata is descriptive and is not a callable validation or authentication API.