- Odin 52.1%
- C++ 42.6%
- Luau 1.8%
- Lua 1.7%
- Python 0.8%
- Other 1%
| .agents/.memcache | ||
| .github | ||
| analysis | ||
| ast | ||
| bytecode | ||
| cli | ||
| codegen | ||
| common | ||
| compiler | ||
| config | ||
| cpp | ||
| require | ||
| tests | ||
| testsupport | ||
| vm | ||
| .gitignore | ||
| LICENSE.txt | ||
| lua_LICENSE.txt | ||
| Makefile | ||
| ols.json | ||
| README.md | ||
| todo.md | ||
Luau
This repository hosts the internal Luau implementation. Production code is the root implementation; the upstream C++ reference lives under cpp/ and is kept for validation/oracle work only.
Ground rules
- Preserve Luau's existing intent: fast, small, safe, embeddable language runtime and tools.
- Keep every committed slice at zero warnings and errors.
- Keep components logically separate. Do not create monolith package files.
- Keep dependencies in the same direction as the current C++ target graph.
- Keep docs current with any command, package, API, or behavior change.
- Commit only coherent, verified slices.
Roblox boundary
Roblox-specific host surfaces are intentionally out of scope here: Roblox services/globals, Studio-only APIs, engine security contexts, DataModel integration, RBX-prefixed host hooks, and native-only Roblox execution paths. Keep Luau language/runtime parity, but skip behavior that requires Roblox engine embedding.
Package map
The package layout mirrors the existing C++ component seams:
| Package | Mirrors | Allowed dependencies |
|---|---|---|
common |
Luau.Common |
none |
bytecode |
Luau.Bytecode |
common |
ast |
Luau.Ast |
common |
compiler |
Luau.Compiler |
common, ast, bytecode |
config |
Luau.Config |
common, ast, bytecode, compiler, vm |
analysis |
Luau.Analysis |
common, ast, config |
vm |
Luau.VM |
common |
require |
Luau.Require |
common, config, vm |
codegen |
Luau.CodeGen bytecode analysis front-end, public bytecode type-info/analysis accessors, public IR, IR builder, register-set, and x64 call-wrapper state accessors, IR core/helpers including VM-register def/use callback visitors, builder storage, translation helpers, IR dumps, scalar constant folding, scalar arithmetic/conversion/truthy-select/type-name compare const-prop peepholes, public optimizer/dead-store state accessors, pure arithmetic/conversion/vector value reuse, typed entry-argument and predecessor tag facts, linear const-prop block creation, dead-store marking for overwritten VM register stores and unused userdata buffer writes, state-preserving pure/check IR classification, side-effect command fact repair, tag/scalar/VM-register load-link/pointer/table TValue split-store/upvalue/known-array-size/array/hash-slot/vector-component/vector-TValue const-prop, vector tag peepholes, guard/barrier reuse, try-num-to-index, buffer length cache reuse/dynamic range merge, buffer load/store conversion facts, new-table/userdata tag facts, fastcall result-tag facts, and branch/loop folding, public C API-shaped metadata wrappers plus compile option/flag and default/option/flag module-id overloads, module-id byte/hash helpers, allocation-callback context create wrappers, get-assembly, target/config support queries, and perf-log accessors, execution-callback/native-execution/function-disable/userdata-remapper context accessors and state-owned callback binding, VM bind-result accessors, compile flag/counter/result/failure/stat plus public compilation/block-linearization/lowering-stat aggregation with owned function-stat merge/bit-byte utility/support/RNG target dispatch/host CPU probing/perf-log/userdata-remapper/host-IR-hook field helpers plus remapper-aware bytecode type-info loading, final x64 helpers, value tracking, x64 condition/operand and emit-common layout/address/node-cache/state-exit/number-branch/runtime-helper-call/barrier-GC/interrupt-fallback/return helpers, x64 frexp/modf builtin and return/call/setlist/forgloop-instruction helper emission, initial x64 IR load/store/split/vector/address/integer/int64/numeric/float/select/vector/compare/CMP_ANY/branch/runtime-table/fastgettm/conversion/bit-op/libm/type/upvalue-helper/buffer-read-write/int64-bit/fastcall/runtime-helper/import/concat/upvalue/guard/slot/node/address-helper/buffer-length/compare-check/runtime-control/instruction-fallback/coverage/newclosure/VM-exit-handler/counter helper lowering plus lower-function pipeline/lowering-driver/randomized NOP padding/module-helper/entry-gate assembly/code-block unwind/code-allocation layout/state model/opt-in heap or virtual executable allocation byte storage with page callbacks, reserved unwind prefixes, per-new-block unwind callbacks, storage bridge into pure OS unwind registration callbacks, modeled live-allocation ownership, pure OS unwind registration callback records for Windows/DWARF2 metadata, and header-function metadata packing/native proto exec-data creation/storage/callback-state memory-counter-target helpers plus callback-frame accessors with native-module ref release, module-ref/compile-result callback-state binding, batch VM native-proto binding/cleanup, and execution-callback table storage/shared native-module metadata storage/allocation-backed native-module binding/metadata-only x64/A64 native module compile helpers/allocation-backed compile-bind helpers with bound stats and perf-log emission/NativeContext slot table storage/helper-slot initialization/public slot accessors/metadata-only CodeGen context for C++ default sizing and host-page-size allocation defaults, owned create/destroy, header gates, shared modules, modeled allocation, storage-kind selection, allocation-backed binding, native-execution enable toggles, public Host/A64/x64 context compile dispatch wrappers with probed Host CPU features, and context-owned userdata remapper wiring, public Host/A64/x64 assembly target dispatch, module-wide x64 get-assembly wrapper with binary blob output, function stats, nested bytecode summary rows, optional type logging, source annotations, IR detail flags, x64/A64 assembly builder accessors, and spill stats, x64 assembly builder label/data/logging/base binary/mov/unary/shift/lea/test/control/stack/bit-scan/byte-swap/imul-immediate/padding/AVX binary-unary/move/conversion/rounding/ternary/FMA encoding helpers, x64 register/allocation state bookkeeping, x64 call-wrapper argument shuffling, and initial A64 condition/register/address plus emit-common register/stack/TValue layout, condition/add-offset/abort/fallback, frexp/modf builtin helper emission, initial A64 IR scalar/TValue/environment load, scalar/vector/split store, integer arithmetic/division/remainder/sign-extension, scalar numeric/float arithmetic, numeric/vector select rows, vector arithmetic/map/dot/extract rows, compare/CMP_ANY rows, branch/control rows, runtime table/string/userdata/import/concat/upvalue/check/guard/slot/node/buffer/userdata-tag/compare-check/runtime-control/bit-op/libm/type/typeof/findupval/instruction-fallback/coverage/newclosure helper rows, scalar/vector conversion rows, stack adjustment and fastcall helper rows, VM-exit finish handlers with fallback-yield sentinel pinning, lower-function pipeline, module-wide A64 get-assembly wrapper with binary blob output, function stats, nested bytecode summary rows, IR/type text output, and assembly text with bounded mnemonic rows, per-function outlined-code trimming, plus explicit .word fallback, module-helper assembly, entry-gate assembly, header-function metadata packing, randomized NOP padding, and array/hash/closure address lowering, A64 register/allocation state bookkeeping, and scalar assembly builder encoding/text coverage for move/immediate, arithmetic, bitwise, shift, bitfield, multiply/divide/remainder, labels, branches, basic control rows, load/store/pair rows, condition-select rows, scalar floating-point move/arithmetic/compare/select rows, SIMD lane/vector compare/bit rows, floating-point rounding/conversion rows, and constant-data ADR rows, with current public A64 builder and outlined-helper text pinned against raw .word fallback |
common, bytecode |
cli |
CLI tools | compose libraries only |
cli/luau |
luau smoke runner |
compiler, vm, require |
cli/luau-compile |
luau-compile smoke dumper |
bytecode, compiler |
cli/luau-ast |
AST parser/pretty-printer smoke tool | ast |
cli/luau-bytecode |
bytecode summary smoke tool | common, bytecode, compiler |
cli/luau-conformance |
conformance smoke runner | compiler, vm |
cli/luau-analyze |
analysis smoke runner | analysis, ast, config |
testsupport |
shared test support | test-only imports |
Do not add reverse edges. In particular, vm and future codegen work must not import ast, compiler, config, or analysis; ast and compiler must not import runtime packages.
common mirrors Luau.Common for assert handling, bytecode enum/wire/utils helpers, core containers including SmallVector/VecDeque/DenseHash/InsertionOrderedMap copy-shape helpers, Variant type-id/valueless helpers, string/hash helpers including format/append wrappers and PairHash-style combination, a shared fast-flag/fast-int registry, the C++ analysis experimental-flag filter, a defer-based ScopedSeenSet equivalent, and TimeTrace clock/event/provider/scope/flush primitives with luau-analyze trace output. C++ macro/RAII-only surfaces are represented by Odin compiler and defer idioms rather than fake compatibility shims.
cli/luau-analyze mirrors the upstream analyzer CLI surface for source-file collection, --formatter=plain, --formatter=gnu, --mode=strict, --timetrace, --fflags=, -jN, and --logbase= while reporting the current executable Frontend checked-module results: parse errors, a deferred new-solver spine with an AST-root ConstraintGenerator that owns module scope setup, module function/root generalization constraints, generator-owned primitive/local/global/vararg expression maps, generator-routed call expressions with original-call-type maps, result packs, argument expected-type maps, and concrete Function_Check_Constraint expected-argument flow, generator-routed string receiver/table sort/foreach/require special calls, generator-routed local/global/property/dynamic-index assignment lvalues, generator-owned AST/scope/type/type-pack map writers, expected-type stack propagation for annotated locals/returns/call args/callbacks/if-expression branches/table-literal items/unannotated callback function signatures, Push_Type_Constraint/Push_Function_Type_Constraint expected-type propagation into grouped/if expressions, table literals, grouped/unary/binary/type-assertion/if/interpolated/instantiate/error expression recursion, and callback parameters, explicit generic function Type_Instantiation_Constraint emission, property/index read/write constraints with constant-string index lowering, and force-new-solver audit coverage for local, assignment, return, vararg, and call expression maps/packs, a deterministic worklist solver for generated subtype, pack-subtype, root generalization, queued reduction of type-function blockers for nested pending expansions, simple function-call, concrete function-check, expected-type push, explicit generic-function instantiation, same-named explicit generic type assignability for UDTF-created generic function signatures, first C++-shaped nonstrict checked-call and checked-argument-count diagnostics over direct, multi-argument, variadic, optional, assignment-flow, and dotted table-property checked function arguments plus function-definition diagnostics for sequencing conflicts, nil diagnostics for uninitialized locals, no-value nonstrict local annotations, nonstrict Unknown_Require suppression, and literal-local/function-expression/if-expression checked-call diagnostics, table/extern member lookup, table method self receiver binding, dynamic indexer lookup, unsealed/free table member growth including open-table property/indexer inference before function generalization, metadata name, primitive, unpack, equality including structural singleton type equality in UDTF, UDTF typeof(type) and non-poisoning tab-separated print runtime messages, final-expression pack spreading plus vararg/call argument tail preservation, fixed generic-pack call-result suffix binding, source-backed base/math/bit32/coroutine/buffer/utf8/os/vector/debug/integer/table builtins plus active C++ type-function type/types source fragments under drift coverage, user-defined type-function types.generic type/pack values, type:name(), type:ispack(), read/write indexer methods, function-generic arrays with C++-style generic-pack ordering/duplicate/scope/type-position errors and generic-type scope errors, and extern parent accessors for named generic/table/function/extern type objects, broader stdlib table/string/math/coroutine/utf8 helpers, stdlib string receiver methods, ipairs/pairs/next and table-valued generic-for iterator typing, protected-call/select result-pack typing, and first-pass simplify constraints, TypeChecker2 post-pass diagnostics for the covered visitor surface, modeled analyzer fast-flag overrides with C++-style warnings for unknown flags, stable generated generic names in --annotate for inferred strict function parameters/returns, fixed generic-pack call-result local annotations, and lint diagnostics. Full C++ new-solver inference/constraint-dispatch parity beyond those solved constraints, broad union/intersection/refinement/member edge cases, full alias expansion/reduce/type-function push paths, and broader --annotate output remain analysis parity work and fail closed instead of faking typed output.
Set LUAU_ANALYSIS_REQUIRE_NEW_SOLVER=1 when running luau-analyze to make any checked module that does not complete the new-solver pipeline report Constraint_Solving_Incomplete_Error; this is a parity-harness knob for exposing reduced-core fallback gaps.
analysis/parity_corpus_test.odin pins the current C++ oracle commit and starts the shared analyzer parity corpus with representative upstream TypeInfer and user-defined type-function rows. Add new C++ gap repros there before closing each analysis tranche.
CodeGen public metadata wrappers now include default support/assembly/native-module/context-create option queries, compile, module-id compile, compile-and-bind callback overloads, compile-and-bind VM native-proto option/flag overloads, state target/context/options/module/bytecode/native-context/header-function accessors, support-config field accessors, JIT RNG helpers, NativeContext slot/fast-function/libm-initializer helpers plus context-owned partial-slot readiness state, VM-owned scalar math, bit32, integer, vector, buffer/table/userdata identity raw-equality, scalar tonumber fastcall installation with active-frame result-capacity guards for modeled multi-result and generated-result fastcalls, and partial global/table opcode fallback installation, shared-code allocator wrappers, context create-config/result field accessors, option-field accessors for compile flags, counter recording, NOP padding, host hooks, userdata type names, allocation storage callbacks/unwind callbacks, native-module target/features/storage options, assembly options, result string helpers, result/stat/native-module-ref accessors, native compile metadata/allocation-backed result and code-allocation model/allocation/data/storage accessors, assembly-result/function-stat/lowering-stat accessors, function bytecode summary accessors, function-assembly stat summary/count/clone helpers, native proto exec-data/callback-state/native-bind-result/native-proto metadata accessors, unwind-registration lifecycle/callback-context/storage-bridge/option/record accessors, execution-callback context/enter/disable/destroy/memory/counter accessors, and nil-safe public destroy wrappers over bound bytecode. Transient flag overloads replace only compile flags and preserve non-flag compile options such as counter metadata. Shared-context binding validates the requested Host/A64/x64 target against the context header before state mutation. The package also mirrors the small CodeGenUtils and remaining C++ CodeGen fast-flag seams, including integer FASTCALL2K bytecode constants gated by both LuauCodegenInteger2 and LuauCodegenIntegerFastcall2k. These wrappers still do not integrate with a live lua_State stack or native dispatch.
Current implementation priority is full non-native VM parity before more native work. Native execution, executable memory, OS unwind registration, live native entry, unmodeled raw/call helper slots, and native-only conformance remain deferred until VM parity has no known non-native gaps.
Interpreter diagnostics preserve C++ source-prefix behavior for invalid table assignment keys, length-operator type errors, native argument errors, string pattern errors, table move wraparound/readonly errors, buffer bit-count/size errors, os.time date-field errors, protected-metatable mutation, invalid __tostring/__len results, metatable-chain loops, and buffer bounds errors raised through Lua frames, while direct pcall(native, ...) helper failures and rawset invalid-key failures stay raw like the C API helper path. Invalid coroutine.close running/normal state errors carry C++ source prefixes when raised through Lua frames. lua_tointegerx-style integer arguments match C++ cast behavior for NaN, infinities, and out-of-i32-range numbers, so callers report range/empty behavior instead of type errors. Vector indexing splits C++ CLI vs conformance behavior: normal VM/CLI vector metatables expose component fields only, while the conformance harness opts into Magnitude, Unit, Dot, and Cross helpers. error(message, level) counts intervening native frames like C++ luaL_where, so native-frame levels add no source prefix. Default tostring for reference values uses C++-style 16-hex-digit 0x shapes, with coroutine wrappers stringifying as function. Host loadstring stores default and plain custom chunk names in C++ display form ([string "..."]) while preserving explicit = and @ prefixes. Weak kv tables preserve C++ closure-referenced mutual cycles while still clearing ordinary weak table cycles and one-way weak references. Return-tailcall execution keeps tail caller debug frames visible for debug.info, getfenv, and setfenv level lookups while still avoiding host stack growth. debug.info/debug.traceback level lookups inside resumed coroutine threads stop at the coroutine stack base, debug.traceback skips native frames like C++ while preserving level counting, and xpcall error-handler tracebacks preserve live handler frames before the captured error stack, including resumed coroutine handlers. coroutine.wrap error propagation adds C++-style caller prefixes for string errors while direct dead-wrapper resumes stay raw. The luau CLI reports uncaught compile/runtime errors with C++-style message and stacktrace output, including blank messages for non-string/non-number error objects.
VM-owned native FASTCALL coverage pins the C++ setmetatable fast path to fresh live-table metatable installation; nil-clearing, replacement, protected, readonly, stale, and unsupported inputs stay on interpreter fallback.
CodeGen public allocator/value-location/lowering-state and architecture-helper accessors expose x64/A64 register metadata, condition helpers, operand/address helpers, label helpers, assembly-builder operation wrappers, register allocation, alloc/reuse/take/free operation wrappers, spill metadata, value-location mutators/lowering hooks, lowering output options, block labels, interrupt/exit handlers, and current-next-block metadata without adding native dispatch.
CodeGen x64 public assembly-builder wrappers now include nil-safe constant/data helpers for i32, i64, f32, f64, u32x4, f32x4, f64x2, raw bytes, text truncation, and log-text append; scalar mov/mov64/movsx/movzx, base binary add/sub/cmp/and/or/xor, unary arithmetic, imul, test, shift/rotate including sal, lea, bsr, bsf, bswap, setcc, cmov, push, pop, cdq, and cqo forms; plus AVX arithmetic/compare/sqrt/ucomi, move, conversion, rounding, ternary, and FMA wrappers for existing internal encoders. These wrappers pre-validate public operands and return ok=false, err=nil for invalid combinations instead of reaching assert-heavy internal encoders.
CodeGen A64 public assembly-builder wrappers now include nil-safe scalar move/immediate, integer arithmetic, compare/select, multiply/divide/remainder, bitwise/bitmask plus mask-support query, shift, bitfield, load/store, pair load/store, scalar floating-point move/immediate/arithmetic/compare/select, SIMD lane/compare/bit, floating-point rounding/conversion, pairwise add, fused multiply-add, FMOV immediate support query forms, and text-row/range/log-append/truncation/rebuild helpers. These wrappers pre-validate public operands and return false or ok=false for invalid combinations instead of reaching assert-heavy internal encoders.
CodeGen shared-code allocator wrappers expose init/destroy, identified and anonymous module counts, identified lookup/insert, anonymous insert, allocation-storage-backed insertion, and native-module-ref metadata accessors for refcounts, module ids, base/code-allocation addresses, allocation storage, native proto lookup, and sorted native-proto slices. Allocator initialization uses nonzero internal capacities so the initialized empty state stays stable across map and dynamic-array behavior; this is still metadata-only and does not dispatch native code.
CodeGen assembly, lowering, header-function metadata, native compile result, and native bind-result helpers deep-clone owned text, binary/code/data blobs, unwind/code blocks, native proto exec-data, nested lowering stats, function stats, bytecode summary rows, callback-state module refs, and allocation-backed native-module refs so callers can retain results independently of source storage. Public clone wrappers are nil-safe and return initialized empty/default results.
VM opaque native-proto metadata now supports CodeGen-independent enter/disabled-enter/disable/destroy/close callbacks, userdata type-name mapping, memory-size traversal, and native-counter traversal over function trees. The VM bytecode loader stores function type-info payloads and remaps v3 tagged userdata type bytes through that mapping seam. Lua execution uses explicit VM-frame trampolines for recursive self-calls and self-recursive protected calls so pcall recursion does not consume the host stack. VM also owns a C++-layout scalar TValue mirror plus atomic slice marshal helpers, memory-tracked call-frame buffers with opaque frame/static/generated-result string handles, frame-owned buffer/table/userdata/closure handles, dedicated import/closure constant records, dedicated active-frame environment table records, generated-result buffer/table/userdata/closure records, active closure context snapshots, live-validated object-result readback, live-validated select-vararg object copies, select-vararg payloads, and exact preallocated/state-tracked native library table initialization, and root C-ABI scalar math, bit32, integer, vector, type, default-name scalar/table/function/thread/buffer plus userdata __type typeof, select-vararg, state-required live-validated buffer/table/userdata/closure identity raw-equality, state-required table rawget, table unpack with active-frame result-capacity checks and string/buffer/table/userdata/closure object results, active-frame result-capacity checks for multi-result math/string.byte fastcalls, active-frame ownership checks for generated-result FASTCALL writes, generated-record rollback on failed native value writes, allocated FASTCALL string-result rollback on allocator failure, NativeContext helper outputs, and generic-for iterator helper result spans, state-required boundary-preserving growth-capable table rawset/insert, state-required table/vector/userdata getmetatable nil/metatable/__metatable results, tonumber, nil/boolean/string plus number/integer allocated-result tostring, string.char, positive in-range string.sub, string.len, string/table rawlen, table setmetatable, and state-required live-validated numeric buffer FASTCALL bodies for nil, boolean, number, integer, vector, string, buffer, table, userdata, and closure-dependent native-stack bridge work. VM still imports no CodeGen code and does not dispatch native code.
VM native helper bodies now include sidecar-marked partial luaH_getn table-boundary support, partial luaH_new table allocation and luaH_clone shallow table copy through generated-result records with allocator-failure record-claim rollback, partial luaH_resizearray grow/promote and nil-shrink support, partial luaF_close active-frame no-upvalue closing, partial forgPrepXnextFallback function-only validation, partial forgLoopNonTableFallback active-frame generator calls with atomic result writeback, partial executePREPVARARGS live-validated active-frame fixed-arg/select-vararg setup, partial executeGETVARARGSConst/executeGETVARARGSMultRet live-validated select-vararg copying, partial executeSETLIST live-table/live-source native-frame array writes, partial executeGETGLOBAL/executeSETGLOBAL active-environment string-key reads/writes through dedicated live table records, partial executeGETTABLEKS string-keyed table reads through the live-validated luaV_gettable subset, partial executeSETTABLEKS string-keyed table writes through the live-validated luaV_settable subset, partial executeNAMECALL string-keyed method reads plus self-copy through the live-validated luaV_gettable subset, partial executeDUPCLOSURE closure-constant duplication with active-function PC bounds plus active-closure environment and value/upvalue capture validation, partial executeFORGPREP live plain-table iterator setup plus callable table/userdata preservation, luaC_step collection through the current stop-the-world collector, stop-the-world GC write-barrier no-ops, and sidecar-marked partial luaV_doarith* number/string-coercion/vector arithmetic, luaV_dolen string/raw-table length, luaV_concat live-validated string/number sequence concatenation that rejects native integer operands like C++ luaV_tonumber, luaV_gettable raw-table and table/userdata table-valued __index scalar/object-result, luaV_settable plain-table and table/userdata table-valued __newindex grow/write with allocation preflight for growth/promotions, and luaV_equalval buffer/table/userdata identity equality helpers where no __eq call is needed; getImport, luaV_gettable, and generic-for iterator helper outputs require active-frame result slots before minting generated records, stateful helper table-record paths require live VM state before table access and validate native buffer/table/userdata/closure records, table/buffer/select FASTCALL bodies require live VM state before reading, writing, copying, or changing metatables through native records, object identity raw-equality requires live VM state before comparing frame-owned records, and native TValue-to-VM object conversion plus native call-frame result readback require live VM state before PREPVARARGS args, select-vararg copies, SETLIST sources, GETGLOBAL/SETGLOBAL environment records, GETTABLEKS/SETTABLEKS/NAMECALL receivers and values, generic-for generator args/results, DUPCLOSURE captures, concat operands, FASTCALL object keys/values, closure constants, known object result reuse, or native results cross back into VM values. The Luau table.clone library native uses the same shallow-copy core. CodeGen adapter installers expose these helpers without making incomplete helper tables ready for native dispatch; the public aggregate VM-owned slot installer wires every currently modeled VM helper, opcode fallback, GC helper, and fastcall table entry while deliberately leaving raw-slot/call helpers unmodeled, and CodeGen sidecar readiness keeps partial helper slots fail-closed even after their pointers are installed.
The conformance runner defaults to a 2 GiB post-setup VM heap-growth cap so upstream scripts that intentionally allocate a 1 GiB buffer can run under the harness; pass --memory-limit=0 to disable the cap or a smaller byte count to stress VM memory-limit behavior. The frontend compile/load cap remains 256 MiB by default. The runner also applies script-specific C++ conformance options such as optimization level 1 and coverage level 2 for coverage.luau.
The current Analysis helper scaffold also includes the C++ Generalization direct type/type-pack/seal helpers, FreeTypeSearcher, TypeCacher, generalize orchestration, and prune-unnecessary-generics helpers, Instantiation2 Replacer, Replacer_DEPRECATED, and callback-backed generic substitution, old-instantiation ReplaceGenerics/instantiate, and GenericTypeFinder type/type-pack seams.
Current scope
commonhas initial assert-handler, fast-flag/fast-int, bytecode constants/helpers, bytecode wire-reader, string/hash utilities, bounded allocator utility, DenseHash map/set, SmallVector, VecDeque, insertion-ordered map, and Variant helpers.bytecodehas initial builder-core support:String_Ref,Table_Shape, import id packing, Lua-compatible string hashing, version selection including bytecode v7 table constants and v8 integer constants, function boundaries, owned string table entries, constant/string/proto tables, debug/type metadata, instruction emit helpers, labels, jump patching/folding/expansion, binary function/blob writer, dump helpers, bytecode stability fixtures, CFG block reconstruction, graph producer analysis, graph instruction import/export, graph-to-builder function writing, and bytecode graph core types/helpers.codegenhas bytecode-summary/function-gathering helpers, public bytecode type-info/analysis, IR, and IR builder state accessors, loaded bytecode type-info decoding/refinement, bytecode block construction, opcode-level bytecode type propagation, packed IR data storage, IR utility/analysis helpers, fixed register sets, CFG/liveness/dominator/IDF helpers, IR builder storage helpers for constant deduplication, block creation, safe-env checks, bytecode block rebuilding, fastcall fallback scaffolding, same-block IR cloning, full function-IR build orchestration and opcode dispatch over the current helper matrix, plus IR translation helpers for argument type checks, primitive load/move/jump opcodes, equality/relational branch fallback IR,JUMPXEQK*nil/boolean/number/string branches, shortcut equality boolean-result IR, unarynot/minus/length IR,NEWTABLE/DUPTABLEallocation IR, upvalue/close-upvalue IR, numeric-for loop IR,FORGPREP_NEXT/FORGPREP_INEXT/ipairsFORGLOOPIR, table array get/set IR forGETTABLEN/SETTABLEN/GETTABLE/SETTABLE, cached import IR, table string-key get/set IR, vector component string-key access IR, userdata string-key fallback IR, global slot get/set IR, table/vector/userdata namecall IR, host-hook short-circuit wiring for vector/userdata access, namecall, and userdata metamethod paths, concat/select IR, capture IR, simple vararg/closure fallback IR,NEWCLOSUREcapture body IR, direct builtin IR bodies for scalar math, min/max/clamp/type/typeof/isnan, lerp/vector helpers, bit32, vector.create, table.insert, string.len, buffer read/write, and integer library fastcalls, public C API-shaped metadata wrappers with compile option/flag/module-id overloads, public compile result/failure/stat helpers, and bounded x64 helper coverage for emit-common layout/addressing/number branches/runtime helper calls/barrier-GC/interrupt-fallback/return calls, return/call/setlist/forgloop-instruction result handling, initial load/store/split/vector/address/integer/numeric/float/select/vector/compare/CMP_ANY/control-branch/runtime table-length/setnum/new-table/clone/string-length/number-index/fastgettm/userdata/conversion/fastcall/runtime-helper/import/concat/upvalue/read-only/metatable/safe-env/array-slot/node-check/buffer-length/compare-check/runtime-control/instruction-fallback/coverage/newclosure/VM-exit-handler IR lowering, register operands, call-wrapper argument shuffling, assembly-builder labels/data/logging/text helpers, nil-safe public x64 constant-data/scalar/binary/control/stack/bit-scan/condition and AVX arithmetic/compare/sqrt/ucomi/move/conversion/rounding/ternary/FMA operation wrappers, scalar/AVX byte encoding, lower-function pipeline, randomized NOP padding, helper/entry assembly, module-wide x64 get-assembly text/binary-blob/function-stat/bytecode-summary/optional-type-log/IR-detail-flag orchestration, native proto exec-data creation/storage plus callback-state memory/counter/entry-target helpers, metadata-only x64/A64 native module compile helpers that lower functions into proto exec-data plus code/data bytes, allocation-backed compile/bind helpers that place those bytes into modeled heap or opt-in virtual executable allocation storage, insert shared native modules, report bound-function stats for new or reused modules, and emit perf-log rows for newly inserted modules, shared native-module metadata/refcount storage with rebased native proto lookup, callback-state binding by bytecode id/all-proto order, and allocation-backed ownership of copied allocation bytes, pure NativeContext slot/fastcall table storage and C-ABI libm helper-slot initialization matching x64 helper offsets, metadata-only CodeGen context storage for header gates/shared modules/modeled allocation/storage-kind selection/allocation-backed binding, pure DWARF2/Windows x64 unwind metadata data builders with entry-gate record hookup plus code-block-local/header-function metadata packing, and public callback-backed unwind registration lifecycle/storage-bridge wrappers. It also has initial A64 IR scalar/TValue/environment load, scalar/vector/split store, integer arithmetic/division/remainder/sign-extension, scalar numeric/float arithmetic, numeric/vector select, vector arithmetic/map/dot/extract, compare/CMP_ANY, branch/control, runtime table/string/userdata/import/concat/upvalue/check/guard/slot/node/buffer/userdata-tag/compare-check/runtime-control/bit-op/instruction-fallback/coverage/newclosure helper rows, scalar/vector conversion rows, stack adjustment and fastcall helper rows, VM-exit finish handlers, lower-function pipeline, randomized NOP padding, module-wide get-assembly binary/function-stat/bytecode-summary wrapper, module-helper assembly, entry-gate assembly, header-function metadata packing, and array/hash/closure address lowering plus A64 assembly builder move/immediate and remainder rows alongside the existing scalar/branch/load/store/FP/SIMD/data ADR rows. Virtual executable storage is opt-in for metadata/header/native-module bytes and not wired into VM dispatch; liveNativeContextVM helper/opcode hookup and executable native dispatch are not claimed yet.- CodeGen context helper coverage also includes C++ default block/max-size fast-int mirrors, owned x64/A64 shared or standalone context creation/destruction plus public shared-context and Host/A64/x64 target wrapper helpers, native-execution enable toggles, header-gate perf-log emission, public native-module-ref/compile-result perf-log wrappers, native-proto callback-state wrappers with metadata-only enter-target and call-frame native-flag clearing, stack-level disable-function metadata, bound-module ref release on destroy, an isolated VM adapter that installs CodeGen callbacks into VM-owned opaque native proto records, routes userdata type-name mapping through the context remapper, and closes the execution callback table during VM native-proto teardown without a VM->CodeGen dependency, CodeGen-side VM native memory/counter traversal wrappers, and context-level userdata remapper storage/tag mapping wired into bytecode type-info loading.
- CodeGen assembly options expose C++-shaped field accessors plus enum-backed IR prefix/detail switches for use-info, CFG info, and register-flow info, and hide outlined assembly text by default like C++.
- CodeGen public result helpers include nil-safe result/stat/native-module-ref accessors, code-allocation data/storage accessors, header-function/context/unwind accessors, assembly-result/function-stat/lowering-stat accessors, function bytecode summary accessors and deep-clone helpers, callback-state/native-bind-result/native-proto metadata accessors, nil-safe public destroy wrappers, compilation-stat aggregation, and deep-clone helpers for proto failures, compile results, context compile results, and standalone or module-backed native callback bind results so metadata owners can outlive source result storage.
codegenx64 and A64 assembly output also supports source annotations and per-function outlined-code trimming wheninclude_outlined_codeis disabled, matching the C++ text-output shape without removing generated fallback code bytes.codegenincludes byte-exact pure data builders for DWARF2 and Windows x64 unwind metadata with nil-safe public builder/function/code accessors, entry-gate record hookup, code-block-local unwind packing, pure code-allocation layout/state model math, pure allocation byte storage for copied data/code payloads, virtual-storage allocation/free callbacks, modeled live-allocation ownership through storage/native-module destruction, allocation-storage-backed native-module binding, and pure header-function assembly/unwind-offset metadata; OS registration and executable code allocation are still out of scope.codegenA64 register-allocation coverage pins direct restore-register paths and ecbdata extra-spill slots while remaining metadata/lowering-only, with no executable native dispatch.asthas initial source positions/locations, arena-backed name allocation, lexeme enum values, internedAst_Name_Table, lexeme helpers, lexer tokenization for comments, strings, interpolation, names, numbers, attributes, and operators, quoted/multiline string fixup helpers, parser-facing parse option/result containers, AST node data types for locals, expressions, statements, attributes, generics, and type annotations, plus a parser skeleton for empty chunks, hot/comment capture, locals, local/function-argument/return/for-loop type annotations, type assertion expressions, explicit type instantiation expressions/calls, attribute lists on function statements/expressions and declared function types,declareglobals/functions/classes/extern types,constdeclarations, assignments, const assignment rejection, compound assignments, call statements, function/local-function statements, returns,if/else,do,while,repeat, numeric/genericfor,break/continue, names, nil/boolean/string/number literals, integer-suffix literals, top-level and function varargs with type-pack annotations, grouped/dotted/indexed expressions, table constructors, function/method calls including table/string argument sugar, generic function bodies, function expressions, interpolated string expressions, type functions,ifexpressions, unary expressions, binary precedence/associativity, andtype/export typealiases with simple references,typeof, singleton/optional/grouped types, table property/indexer/array types, generic type parameters, generic type-pack parameters including parenthesized empty/tuple arguments, generic default type/type-pack diagnostics, type-pack misuse diagnostics, function types with named arguments, function-type syntax diagnostics, unions, and intersections. It also has C++-matching visitor traversal with type annotations disabled by default, plus an initial pretty-printer API for parsed chunks/source with typed or type-stripped output, statement semicolon preservation, number literal spelling preservation including separators/hex/binary/integer suffixes, decimal overflow literals such as1e500, parseable chained unary-minus spacing, table literal and table type comma/semicolon/trailing separator preservation, table/string call argument sugar preservation, statement and if-expressionelseifspelling preservation, for-loop annotation output, optional-marker and leading union/intersection separator preservation, variadic, empty type-pack, and explicit empty type-argument syntax, function/declaration/type-function attributes, explicit type instantiation syntax, string literal quote/raw/interp style preservation with quoted fallback for raw strings that begin with newline bytes, valid table type string properties/array shorthand/indexer order, validdeclare class/declare extern typeoutput including string properties/indexers, and explicit parse/recovery errors.astassigns C++-matching debug names to function expressions stored in table record fields such as{foo = function() end}, which keeps runtimedebug.info(func, "n")results aligned with Luau.confighas initial.luaurcconfig data model and parser support for language mode, lint masks/fatal compat settings, lint/type error flags, globals, aliases with location metadata,//comments, trailing commas, and explicit syntax/unknown-key errors; it also has.config.luausource execution through the compiler/VM, VM sandboxing plus default instruction and memory budgets, owned table/value serialization for string/number/boolean/nested-table config data, and table-to-Configextraction for theluausection. Config execution is CPU-bounded at VM opcode safepoints and selected native-loop safepoints, front-end bounded through a compile/bytecode-load allocator cap, and VM memory-bounded for logical VM-owned heap, runtime string records, string iterators, call-stack frames, open-upvalue records, and common native transient byte/error/debug builders such as string concat/case/sub/char/reverse/rep/pack,utf8.char,table.concat,tostring/print,string.format,string.gsuboutput and capture arrays,os.datestring formatting, vector index errors, and explicitdebug.tracebackoutput; selected large result/call arrays and copies (string.byte,string.find/match/gmatch,string.unpack,utf8.codepoint,table.unpack,assert,select, protected calls, function returns, callable table/userdata calls,debug.info) are capped.analysishas initialFile_Resolver/null file resolver helpers,Config_Resolver/null config resolver helpers,Source_Code,Module_Info,Source_Module,Source_Node,Frontend,Frontend_Options, source-graphFrontend_Module_Resolver,Module_Resolver/null resolver helpers, and type graph data-model scaffolding. It reads source and config through TypeCheckLimits-aware host callbacks, supports C++-shaped require suggestion payloads, path suggestion helpers, RequirePath autocomplete entry conversion, autocomplete keyword result helpers, string-parameter autocomplete helper dispatch, and FragmentAutocomplete data/location/region/ancestry/document-offset/parse-fragment/closest-scope helpers, preserves human-readable names, source type, optional environment names, AST arena/name-table ownership, parse errors, hot/comment locations,--!strict/--!nonstrict/--!nocheckmode metadata with config-mode fallback, config-sourced parse options with forced comment capture, comment hit-testing helpers, and C++-shaped module log callback setters. It also tracesrequire(...)dependencies through resolver callbacks, local aliases, indexed module paths, andtypeof(require(...)), resolves tracedModule_Infofor AST expressions, records require locations/reverse dependents, ignores missing dependencies without creating fake modules, returns dependency-first single-root and batch parse queues with cycle detection, exposes owned require-cycle paths and immediate required-script queries, classifies precomputed lint warnings into errors/warnings with C++Frontend::classifyLintsrules, filters lint options for hotcomments and mode, runs syntax-onlyUnknownGlobal,DeprecatedGlobal,DeprecatedApi,GlobalUsedAsLocal,UnknownType,FormatString,TableOperations,SameLineStatement,MultiLineStatement,ForRange,ImplicitReturn,UnreachableCode,UnbalancedAssignment,LocalShadow,UninitializedLocal,BuiltinGlobalWrite,DuplicateLocal,DuplicateFunction,DuplicateCondition,TableLiteral,PlaceholderRead,FunctionUnused,LocalUnused,ImportUnused,MisleadingAndOr,CommentDirective,IntegerParsing,ComparisonPrecedence, andRedundantNativeAttributelint traversals with C++ silencing/traversal/deprecated-global/deprecated-builtin-api/direct-deprecated-function-attribute/source-deprecated-declaration/format-pack-pattern-date/table-library-operations/table-indexer-operation/for-range/fallthrough/unreachable/assignment/self/shadow/uninitialized-local/builtin-global-write/unknown-global/global-used-as-local/unknown-type/underscore/duplicate-function/duplicate-condition/table-literal/placeholder-read/function-unused/local-unused/import-unused/and-or/comment-directive/number-parse/comparison-precedence/native-comment behavior, and supports dirty propagation, stale-aware source-module lookup, stats clearing, and full cache clearing/reuse. The type graph scaffold includesType/TypePackvariants, stable arena-owned ids with singleton stats/type-function instance/user-function-data/freeze helper parity, TypedAllocator-style block storage, C++-matching Unifiable shared free counters and split type/type-pack error counters, built-in primitive/singleton/pack types, global type scopes, global binding/property-documentation helpers, bound following with mapper-aware and empty-head pack tail following, Txn_Log-aware type-pack query helpers, type-pack iterator/flatten/tail/variadic/never/slice/persist/level helpers, C++-shaped clone/shallow-clone/incremental-clone helpers, Generalization direct free-type/free-pack/seal helpers, FreeTypeSearcher, TypeCacher, generalize orchestration, and prune-unnecessary-generics helpers, Quantify free-type/free-pack/table generalization, Tarjan/Substitution helpers for SCC-aware type/type-pack replacement, module public-interface cloning helpers, generic type-alias instantiation, ApplyTypeFunction argument substitution, Anyification free-to-any substitution, name/definition/metatable helpers, primitive/union/intersection/table/generic/singleton/length predicates, extern hierarchy/property lookup helpers, ordered/hashableType_IdsandType_Pack_Ids,Not_Null,Type_Or_Pack, TypePairHash pointer-pair helpers, WithPredicate and magic-function context payloads, TypePath traversal/string helpers, ToString option/result/function-name/type/type-pack/constraint stringification helpers, ToDot graph-output helpers, AstJsonEncoder constant/simple/compound/if/interp/error/type-assertion/control-statement/declaration/table-type/function-type/misc-type/root-comment JSON helpers, type/property tag and property mutation helpers, BuiltinDefinitions call matcher/function-constructor/magic-attachment helpers, TypeInfer fallthrough/call-error helpers, IostreamHelpers-style debug string helpers, JsonEmitter-style snapshot output helpers, DcrLogger schema/snapshot logging helpers, Predicate storage helpers, Refinement arena helpers, Documentation and AutocompleteTypes data shapes, AstQuery ancestry/find-node/scope/binding/type/documentation-symbol helpers, ExpectedTypeVisitor propagation helpers, IterativeTypeVisitor-style work-queue traversal, recursive GenericTypeVisitor-style traversal, TypeFunctionRuntime graph storage, TypeFunctionRuntimeBuilder serialize/deserialize helpers, TypeFunction reduction-result and guess-result storage, TypeFunctionReductionGuesser classifier/substitution helpers, builtin type-function registry/scope binding helpers, IterativeTypeFunctionTypeVisitor-style work-queue traversal, TypeFunctionError structured diagnostics/stringification, Polarity helpers, structural type/pack equality, Normalize storage/predicate helpers, Simplify relation/exact truthy-falsy helpers, SubtypingVariance, SubtypingReasoning merge helpers, SubtypingResult composition/path helpers, SubtypingEnvironment mapped bounds/substitution helpers, mapped generic-pack environment helpers, SubtypingUnifier can-unify and deprecated pack-occurs helpers, OverloadResolver result-selection helpers, Unifier variance/options, UnifyResult composition helpers, Unifier2 compatibility/irresolvable predicates, Widen singleton helpers, and unifier diagnostic search helpers, metamethod operator maps, ControlFlow flags, NativeStackGuard/RecursionCounter helpers, TypeCheckLimits/cancellation scaffolding, Set, OrderedSet, TopoSortStatements, and AstUtils helpers, LValue/refinement-map helpers, Def/DataFlowGraph storage and DataFlowGraphBuilder visitor helpers,Txn_LogandUnifierSharedStatescaffolding, TypeUtils literal/record/group/optional/truthy-falsy/builder/generic-containment/blocked predicates plus blocked literal-argument discovery, interior-free tracking, parameter-extents/extend-type-pack/occurs-check/reduced-union/nil-stripping/matching-table/metatable-property/approximate-return helpers,Symbolequality/order/hash/text helpers,Binding,Scopelookup/type-binding/DefId/refinement inheritance/interior-free helpers, checkedModulestorage maps,Constraint/Constraint_Setpayloads with C++ maybe-mutated-type traversal, deferred subtype/pack-subtype reason metadata, a deterministic FIFO solver spine for generated reduced-checker constraints, ConstraintSolver inference/blocked-id/record/instantiation-signature/saturate-argument helpers, TypeChecker2 reasonings/no-return/error-call/end-location/nil-strip/base-identifier/type-function-finder helpers, and C++-orderedType_Errordiagnostic variants with code/summary/stringification helpers for common errors; generic type-alias references instantiate supplied and default arguments in the reduced checker. It intentionally does not claim type-function Lua evaluation/reducer registration, builtin reducers, full reduction guessing algorithm, executable overload resolution, executable simplify/intersection/union reduction, full normalization, full C++ constraint solver, inference, broad executable subtyping beyond the reduced spine, full linter, autocomplete execution, or typechecking parity yet. Config changes require hosts to mark affected modules dirty, matching the cached frontend model.- Analysis Type.cpp helper coverage also includes union subset checks, union flatten/filter-map helpers, and primitive-in-intersection lookup.
- Analysis Type.cpp helper coverage also includes C++-shaped union/intersection type iterators and
freshTypescope/polarity construction. - Analysis Txn_Log helper coverage also includes the C++-shaped empty read-only log helper, pending type/type-pack
toString/dumphelpers, direct variantishelpers, andconcatAsUnionmerging with free-type cycle pruning, unionized conflicting type changes, type-pack change propagation, and radioactive state carryover. - Analysis checked
Modulestorage includes C++-shaped TypeArena owner pointers, lint-result ownership, and record/lookup helpers for AST expression types, type packs, expected types, resolved annotation types/packs, original call types, overload-resolved types, for-in next types, compound-assignment result types, and AST scopes. - TypeUtils helper coverage also includes callback-backed Normalizer error-suppression checks for types and type packs.
- TypeChecker2 helper coverage also includes internal type-function where-clause diagnostics, lookup helpers, expected-type helpers, and pack flattening without claiming checker execution.
- TypeChecker2 helper coverage also includes callback-backed error-suppression wrappers that report normalization-too-complex diagnostics.
- TypeChecker2 helper coverage also includes pack reconstruction and innermost-scope lookup helpers.
- TypeChecker2 helper coverage also includes missing-table-key case-suggestion diagnostics for table and extern properties.
- TypeChecker2 helper coverage also includes nonviable-overload error reporting/suppression selection.
- TypeChecker2 helper coverage also includes maybe-report-subtyping-error suppression behavior.
- TypeChecker2 helper coverage also includes reportError/reportErrors storage with missing-key rewrite.
- TypeChecker2 helper coverage also includes optional-union nil stripping with
Optional_Value_Accessreporting. - TypeChecker2 helper coverage also includes break/fallthrough and binding-type lookup helpers.
- TypeChecker2 helper coverage also includes callback-backed
testIsSubtyperesult/error reporting for types. - TypeChecker2 helper coverage also includes callback-backed
testIsSubtyperesult/error reporting for type packs. - TypeChecker2 helper coverage also includes callback-backed for-in iterator subtype reporting.
- TypeChecker2 helper coverage also includes callback-backed
explainErrorsuppression and mismatch reporting for types and packs. - TypeChecker2 helper coverage also includes direct
explainReasoningspath traversal, relation formatting, suppression, and internal-path diagnostics for types and packs. - TypeChecker2 helper coverage also includes property lookup result payload helpers.
- TypeChecker2 helper coverage also includes callback-backed
hasIndexTypeFromTypecore shape lookup for table, extern, union, intersection, primitive, and indexer cases. - TypeChecker2 helper coverage also includes callback-backed
lookupPropsweeps overNormalized_Typecomponents, including extern-shape normal forms, functions, tables, strings, tyvars, and inhabitance-limit handling. - TypeChecker2 helper coverage also includes callback-backed
checkIndexTypeFromTypediagnostic selection for normalization failure, missing union properties, property access violations, table extension, and unknown properties. - TypeChecker2 helper coverage also includes callback-backed
reportErrorsFromAssigningToNeverproperty-narrowing diagnostics for index-name assignments. - TypeChecker2 helper coverage also includes callback-backed
suggestAnnotationstraversal/reporting for type-function return annotations. - TypeChecker2 helper coverage also includes
checkTypeInstantiationdiagnostics for non-function instantiation and generic argument count mismatches. - TypeChecker2 helper coverage also includes type-reference parameter validation for type-before-pack ordering, default arguments, empty explicit packs, swapped generic-pack references, unknown symbols, and generic parameter count diagnostics.
- TypeChecker2 helper coverage also includes generic type/type-pack duplicate diagnostics plus default type/type-pack visitor dispatch.
- TypeChecker2 helper coverage also includes callback-backed type/type-pack annotation visitor traversal for references, tables, functions,
typeof, unions, intersections, groups, explicit/variadic/generic packs, and generic-pack symbol diagnostics. - TypeChecker2 helper coverage also includes
DebugLuauMagicTypesannotation lookup and type-reference visitor behavior for_luau_print,_luau_force_constraint_solving_incomplete, and_luau_blocked_type. - TypeChecker2 helper coverage also includes callback-backed top-level expression/statement dispatch seams matching C++ TypeChecker2 visitor kind handling, with optional AST-scope stack push/pop behavior.
- TypeChecker2 helper coverage also includes explicit stack-pusher tokens for module AST scopes.
- TypeChecker2 helper coverage also includes callback-backed singleton literal checks for boolean and string constants, including suppression behavior and forwarded subtype errors.
- TypeChecker2 helper coverage also includes release-path no-op visits for nil, number, and integer constants whose C++ checks are assert-only.
- TypeChecker2 helper coverage also includes callback-backed call-argument type-pack construction with self-argument insertion, expected parameter propagation, and final pack flattening.
- TypeChecker2 helper coverage also includes call function-type preparation with original-call lookup, optional-call diagnostics, and selected-overload discovery.
- TypeChecker2 helper coverage also includes a callback-backed call-check orchestrator that wires function preparation, selected-overload application, argument-pack construction, magic short-circuiting, and overload diagnostics.
- TypeChecker2 helper coverage also includes callback-backed selected-overload subtype result reporting for calls.
- TypeChecker2 helper coverage also includes call potential-overload and ambiguous-success diagnostics.
- TypeChecker2 helper coverage also includes incompatible call-overload reporting for error vectors and multiple nonviable overloads.
- TypeChecker2 helper coverage also includes call overload arity and non-function fallback diagnostics.
- TypeChecker2 helper coverage also includes global-expression binding diagnostics with once-per-global warning suppression.
- TypeChecker2 helper coverage also includes callback-backed index-name expression visiting with optional-nil stripping and index-check dispatch.
- TypeChecker2 helper coverage also includes callback-backed metatable indexer lookup for index expressions.
- TypeChecker2 helper coverage also includes dynamic index-expression diagnostics for table, metatable, extern, union, intersection, optional, never, and suppressing types.
- TypeChecker2 helper coverage also includes index-expression visitation with constant-string fast path and dynamic-index diagnostic dispatch.
- TypeChecker2 helper coverage also includes unary expression checks for number negation, length checks, optional/non-table diagnostics, normalization complexity, and
__unm/__lenmetamethod validation. - TypeChecker2 helper coverage also includes available-overload extra-information diagnostic formatting.
- TypeChecker2 helper coverage also includes binary comparison-op and comparison-exception predicates.
- TypeChecker2 helper coverage also includes binary metatable-match predicates for equality, unions, and non-table fallback comparisons.
- TypeChecker2 helper coverage also includes binary metamethod expected-function construction with swapped comparison args and boolean/fresh returns.
- TypeChecker2 helper coverage also includes binary metamethod return diagnostics for comparison boolean returns and required value returns.
- TypeChecker2 helper coverage also includes absent binary-metamethod fallback diagnostics for metatable and no-metatable table paths.
- TypeChecker2 helper coverage also includes primitive binary numeric and concat subtype checks.
- TypeChecker2 helper coverage also includes callback-backed binary expression post-check orchestration for free-type inference diagnostics, disjoint comparisons, metamethod selection, primitive arithmetic/concat, and relational fallbacks.
- TypeChecker2 helper coverage also includes function-expression post-check diagnostics for normalized function shapes, annotated arguments, never-parameter contributors, implicit returns, and annotation suggestions.
- TypeChecker2 helper coverage also includes type-assertion visitor dispatch plus suppression, inhabitance, and unrelated-type diagnostics.
- TypeChecker2 helper coverage also includes type-alias statement visitation with invalid recursive-alias diagnostics and generic/type child traversal callbacks.
- TypeChecker2 helper coverage also includes type-function statement body visitation callbacks.
- TypeChecker2 helper coverage also includes function/local-function statement visitation callbacks plus optional function statement subtype reporting.
- TypeChecker2 helper coverage also includes declare function/global/extern statement annotation visitation.
- TypeChecker2 helper coverage also includes block, if, while, repeat, break, continue, and expression statement visitation callbacks.
- TypeChecker2 helper coverage also includes numeric for-statement annotation/bounds/body visitation plus number subtype checks.
- TypeChecker2 helper coverage also includes generic for-in annotation/value/body visitation plus iterator-pack reconstruction callbacks.
- TypeChecker2 helper coverage also includes compound-assignment fake-binary visitation plus result-to-variable subtype reporting.
- TypeChecker2 helper coverage also includes assignment statement l-value/r-value visitation, literal subtype checks, binding follow-up checks, and never-assignment diagnostics dispatch.
- TypeChecker2 helper coverage also includes local declaration value visitation, annotation checks, multireturn pack expansion, and count-mismatch diagnostics.
- TypeChecker2 helper coverage also includes return-statement expected-pack checks, literal checks, pack reconstruction, and r-value visitation.
- TypeChecker2 helper coverage also includes group-expression context forwarding plus current C++ no-op local/varargs expression visitors.
- TypeChecker2 helper coverage also includes call-expression function/argument visitation with
typeofcontext preservation,assertfirst-argument conditional context, and callback-backedvisitCalldispatch. - TypeChecker2 helper coverage also includes table-expression key/value visitation with default type context.
- TypeChecker2 helper coverage also includes unary-expression operand visitation with
notcondition-context preservation and callback-backed post-visit checks. - TypeChecker2 helper coverage also includes binary-expression child visitation with logical/equality condition-context preservation, optional l-value lhs visitation, and callback-backed post-visit checks.
- TypeChecker2 helper coverage also includes function-expression generic/default, argument annotation, vararg annotation, body, and return annotation traversal callbacks.
- TypeChecker2 helper coverage also includes if-expression condition/branch visitation with conditional type context.
- TypeChecker2 helper coverage also includes error-statement expression and statement child visitation.
- TypeChecker2 helper coverage also includes explicit type-instantiation expression visiting and
checkTypeInstantiationdispatch. - TypeChecker2 helper coverage also includes interpolated-string and error-expression child visitation.
- TypeChecker2 helper coverage also includes callback-backed literal/table subtype checks for group/if/or expressions, table property expectation propagation, indexer expectation propagation, missing-property diagnostics, and unexpected array-like table item diagnostics.
- AstJsonEncoder helper coverage also includes assignment and compound-assignment statement JSON output; full remaining AST/type JSON remains future work.
- AstJsonEncoder helper coverage also includes function expressions, function/local-function statements, function attributes, and generic type/type-pack parameters; full remaining AST/type JSON remains future work.
- AstJsonEncoder helper coverage also includes type alias statements with generic type and generic type-pack defaults; broader type-node JSON remains future work.
- AstJsonEncoder helper coverage also includes grouped, union, intersection, optional, and singleton bool/string type nodes; broader type-node JSON remains future work.
- AstJsonEncoder helper coverage also includes table-property/indexer and function type nodes; remaining declaration JSON gaps are future work.
- AstJsonEncoder helper coverage also includes
typeof, error type, and generic type-pack nodes; remaining declaration JSON gaps are future work. - AstJsonEncoder helper coverage also includes declare global/function/class/extern-type statements and declared class properties.
- AstJsonEncoder helper coverage also includes expression and statement error nodes.
- AstJsonEncoder helper coverage also includes explicit type-instantiation expressions and type-function statements with their function body payloads.
- AstJsonEncoder helper coverage also includes the C++ root/commentLocations wrapper for parsed AST JSON output and a public Ast_Node dispatch helper;
luau-ast --jsonexposes that JSON path while keeping pretty-printer output as the default. - TypeAttach helper coverage includes rehydration from supported
TypeandTypePackscaffold nodes back into AST annotation nodes, covering primitive/singleton/generic/free/bound/union/intersection/lazy/negation/type-function-instance, table, function, metatable, and extern shapes, plus AST attach traversal for locals, loop variables, function arguments, and function return annotations from checked-module scope bindings. - ConstraintSolver helper coverage also includes table-property lookup result storage and non-owning constraint borrowing; the current executable solver spine has a deterministic worklist for generated subtype and pack-subtype constraints, dependency blocking, unresolved free/blocked/type-function blockers, and
Constraint_Solving_Incomplete_Errorreporting for unsupported or still-blocked constraints, while full C++ inference dispatch remains future work. - NonStrictContext helper coverage includes Def-to-Type map storage, phi-operand expansion for add/remove, and conjunction/disjunction merge helpers; it is still helper parity, not non-strict typechecking execution.
- NonStrictTypeChecker helper coverage also includes the cached negation constructor and runtime-error skip predicate for
neverand type-function instances. - TableLiteralInference helper coverage includes incomplete-inference result storage and function-candidate selection across union/intersection expected types; full bidirectional literal pushing remains future work.
- TypeFunction helper coverage includes function-graph reduction result storage and the pending-type predicate for blocked, pending-expansion, unresolved type-function, and solver-blocked types.
- UserDefinedTypeFunction helper coverage includes blocker discovery over type graphs, with C++ visit-once traversal, bound following, solver-blocked inputs, extern opacity, and runtime type-function graph freezing.
- Compiler/VM runtime-erasure coverage includes type-function statements and explicit type-instantiation calls/method calls.
compilerhas initial compile options, compile result/error handling, source and pre-parsed AST entrypoints, bytecode blob/error-blob output, main chunk/prototype emission, scoped local register allocation, local declarations/references with primitive constant propagation for unwritten, uncaptured locals, C++-matching single-local register reuse for immutable local aliases with direct/nested-write guards, local/global/upvalue/table assignments with C++-matching local/table l-value conflict handling, O1+ local self-assignment skipping that preserves constant/write metadata, compound assignments, global and table loads/stores, one-/two-/three-partGETIMPORTimport constants for safe global reads and static global index chains, function calls/call statements with trailing multireturn varargs, O2 local-function return-arity metadata that converts known single-result calls from multret to fixed-result lowering, O2 local/direct function call inlining for single-return bodies, constant-conditionif/elsereturns, and straight-line local/assignment/side-effect bodies ending in one return, with C++-style cost/profit, stack-size, register-pressure, inline-depth, fixed-result, fenv, vararg, self-call, coverage, upvalue, multret-tail, recursive, nested-function, written-argument, and extra-argument side-effect guards, O2 builtin result/arity metadata, one-result builtin call recognition, none-safe fixed-arity builtin fastcall lowering for trailing multireturn arguments, supported direct/unwritten-local-alias builtin call,select(_, ...)varargFASTCALL1,bit32.extractconstant-field/widthFASTCALL2K,integer.*, andbuffer.readinteger/buffer.writeintegerfastcall emission with written/mutable/disabled builtin guards, function expressions/statements, local functions, method calls, closure creation with local/upvalue captures, C++-matchingDUPCLOSUREemission for immutable capture sets guarded bysetfenv, table constructors with record-fieldDUPTABLEtemplates, opt-in bytecode v7 constant-packedDUPTABLEvalues, automatic bytecode v8 targeting when integer constants are present, sequential numeric-key array allocation, empty-table hash/array allocation prediction from later local field/index writes, constant key setters, and trailing varargs,if/elsestatements and expressions,while/repeat/numeric and genericforloops withbreak/continue, O2 small constant-trip numeric loop unrolling for simple loop bodies without loop-control/call/nested-function hazards, direct loop-jump lowering for single-statementif break/if continue, compiler-finalized jump folding for jump chains and jump-to-return paths, constant-condition folding forif,while, andrepeatstatements with C++-matching terminating-branch detection, C++-matchingIfEliminationpruning for impossible branches with side-effect-preservingcond and falselowering and identity logical condition jumps, optimizedFORGPREP_NEXT/FORGPREP_INEXTemission for builtinpairs/ipairs/nextloops, extended equality-against-constant jump emission for nil/boolean/number/string comparisons, primitive numeric/unary/compare/logical/string-concat constant folding, conservative string-key table property constant folding for immutable local/table literals with mutation, duplicate-key, empty-key, capture, and call-escape guards, O2 guarded builtin constant folding for math/type/typeof/string/bit32 calls and math constants, O2 vector constant folding forvector.create, vector arithmetic/unary minus, vectorx/y/zfields,vector.zero/vector.one, andtype/typeof(vector), coverage opcode emission for statement, expression, and table-item coverage levels, debug-level 2 local live-range metadata for parameters, block locals, and return-terminated scopes, short-circuit logical expressions, unary expressions, arithmetic/concat/comparison binary expressions, interpolated string expressions with local string constant embedding, vararg expressions,returnstatements, primitive constants, and runtime-erased type wrappers/type aliases/type functions/declareglobals/functions/classes.- Compiler type metadata support includes userdata type option validation, vector/userdata/primitive/optional/alias/union/generic type mapping, builtin-call result typing, function parameter type-info blobs, local/upvalue type-info emission, and temporary arithmetic operand hints.
vmhas an initial bytecode chunk loader and primitive interpreter for emitted bytecode: owned string table/function storage plus debug names/line tables and function type-info payloads with v3 userdata remapping, nil/boolean/number/integer/string/vector/table/buffer/userdata/closure/native values, VM state with global/table/metatable/readonly-table/safeenv/vector-metatable/buffer/userdata/closure/upvalue/runtime-string/string-iterator/random/call-stack/chunk-owner storage, sandboxing for readonly globals/library tables, opcode and selected native-loop instruction budgets, logical heap memory limits, VM-accounted runtime string records, string iterators, call-stack frames, open-upvalue records, common native byte/error/debug builders including explicitdebug.tracebackoutput, and selected large value result/call arrays includingdebug.inforesult arrays, and host interrupt callbacks, fixed and multivalue returns, varargs, register moves, coverage counters, function/namecall/protected-call dispatch, nativepairs/ipairs/next,assert/error,newproxy,print,pcall/xpcall,getfenv/setfenv, host-installedloadstringwith C++-style chunk-id compile errors, host-native callbacks, named state chunks, opaque native-proto metadata and counter traversal for CodeGen-owned callback data,getmetatable/setmetatable,type/typeof,tostring/tonumber,select,_G,_VERSION, raw table helpers,string.format, string byte/char/find/gmatch/gsub/len/lower/match/pack/packsize/rep/reverse/split/sub/unpack/upper builtins with Luau pattern captures/replacements,utf8char/codepoint/codes/len/offset builtins andcharpattern,integerbuiltins/constants,bit32builtins, tableclear/clone/concat/create/find/foreach/foreachi/freeze/getn/insert/isfrozen/maxn/move/pack/remove/sort/unpack,mathbuiltins/constants including PCG-backedrandom/randomseedand Perlinnoise,osclock/date/difftime/time builtins,buffercreate/fromstring/tostring/len/read/write/copy/fill/bits builtins,vectorcreate/magnitude/normalize/cross/dot/angle/floor/ceil/abs/sign/clamp/min/max/lerp builtins pluszero/one, C++ CLI component-only vector indexing with conformance-only extended vector member/method opt-in, Luau-style argument diagnostics, and string-number coercion for numeric vector arguments and vector scalar arithmetic, anddebug.info/debug.tracebackfor the current VM thread plus suspended/error coroutine stack snapshots, closure creation with per-function environments and owning chunks,DUPCLOSUREexecution for immutable upvalue captures with shared closure caching, upvalue capture/get/set/close, global/table/vector/userdata index loads, optimized userdata key/namecall opcodes, and table/userdata stores with__index/__newindex/__namecalltable/function/callable-table metamethods, table/userdata__call/__tostring/__len, table/userdata arithmetic/concat/comparison metamethods, vector arithmetic andtostring, genericforsupport for Luau hash-node-ordered direct table iteration plus optimizedpairs/ipairs/nextprep opcodes,__iter, callable-table/userdata generators, and string pattern iterators, table construction/list fill, constant loads including vector/table-template constants,DUPTABLEcloning, boolean/numeric/string/vector/userdata comparisons, conditional/unconditional jumps including longJUMPXand extended equality-against-constant jumps, fastcall fallback paths, numericforloops with string-number coercion and genericforloops, numeric arithmetic including modulo/power/floor-division, concatenation over strings/numbers, logical selectors, length over strings/tables/userdata, and unarynot/minus. Unsupported runtime opcodes report explicit execution errors instead of falling back silently.vmalso owns an opaque native-proto metadata seam for future CodeGen integration: bind/query, native enter and disabled-enter callbacks, native-entry disable, destroy callbacks, memory-size and counter-word queries, native-helper error query/clear diagnostics, call-info native flag clearing, and chunk-lifetime cleanup are available without importing CodeGen or dispatching native code.vmsupportsLBC_CONSTANT_IMPORTloading andLOP_GETIMPORTexecution for one-, two-, and three-part import paths through the active function environment, using normal Luau table lookup and__indexmetamethod behavior instead of raw shortcuts.vmbytecode loader/debug metadata parity is pinned by root/C++ probes for function debug names, arity/source lines, loadstring chunk-name tracebacks, debug-break local metadata, and typed Luau function metadata.vmtracks logical VM heap usage even when no memory limit is active, exposesgcinfo()as number-typed KiB like C++lua_pushinteger, and supports the globalcollectgarbageentry point forcollect,count,isrunning,restart,step,stop,setgoal,setstepmul, andsetstepsizewith C++-style option and numeric-data diagnostics. Explicitcollect/stepruns a mark pass over globals, active Lua stacks, coroutine stacks, closures, upvalues, metatables, userdata, buffers, owned chunks, string iterators, and VM-owned strings, then clears weak table keys/values and sweeps unreachable ID-backed records through tombstones while keeping weak-table strings Luau-compatible. Automatic safepoints run the same collector when the running VM crosses its GC threshold, and the conformance harness can block logical VM allocations during collection withsetblockallocations. Precise incremental pacing, slot reuse/generation handles, finalization, and full ephemeron parity are still future work.vmmath helpers report C++-style number/integer argument diagnostics, coerce numeric strings, reject explicit integer values forluaL_checknumber/luaL_checkintegersurfaces, and return number values frommath.frexpexponents and boundedmath.randomresults like C++lua_pushinteger.vminteger values report"integer"throughtype/typeof, keeprawequaltype-strict against numbers, parseinteger.fromstringbases 2..36 including default-base0xprefixes, format integer%x/%X/%o/%u, reject runtime unary minus on integer values while preserving direct negative integer literal folding, and report C++-style number/string/integer/field/width argument errors for integer library helpers.vmbuffer helpers report C++-style buffer/string/number/integer argument errors while preserving raw bounds, bit-count, size/count, and string-length runtime errors.vmvector helpers report C++-style vector/number/string argument errors for library calls and metatable__index, including wrappedclampbound errors and numeric key string coercion.vmos.date,os.difftime, andos.timereport C++-style string/number/table argument errors, wrapped date-format conversion errors, date-table required-field errors for missing or non-numeric fields, and number-typedos.date("*t")integer fields like C++lua_pushinteger.vmdebug.infoanddebug.tracebackreport C++-style function/level/string/number argument errors, including wrapped negative-level, invalid-option, and duplicate-option diagnostics;debug.infoline and arity results are number-typed like C++lua_pushinteger.vmhost-installedloadstringreports C++-style source/chunk-name string argument errors and matchesluaL_checklstring/luaL_optstringnumber stringification without accepting integer values.vmcoroutine helpers report C++-style function/thread argument errors forcreate,wrap,resume,status, andclosewhile preserving raw coroutine-state runtime errors.vmtable.moveuses C++-matching 32-bit move bounds, wraparound diagnostics, source/destination table argument diagnostics, and numeric bound argument diagnostics; it allows empty moves into readonly tables, rejects non-empty moves into readonly destinations, and pre-grows near-boundary array destinations before copying like C++luaH_resizearray.vmtable.findreports C++-style table/start argument errors, treats a nil start index as omitted, reports the C++ missing-value error, and returns number-typed found indices.vmraw base helpers (getmetatable,rawget,rawset,rawequal, andrawlen) report C++-style missing/type argument errors, andrawlenreturns number-typed lengths.vmsetmetatablereports C++-style table and nil-or-table metatable argument errors.vmbase helpers (pcall,type,typeof,tostring,tonumber, andselect) report C++-style missing/type/range argument errors,tonumber(value, base)string-coerces numeric values before base parsing, generictonumberrejects integer TValue inputs like C++, andselect("#", ...)returns a number-typed count.vmiterator helpers (next,pairs,ipairs, and theipairsgenerator) report C++-style table/number argument errors, invalid-next-key runtime errors, and number-typed array keys/indices.vmbase edge helpers (assert,error,newproxy,getfenv, andsetfenv) report C++-style argument errors, andsetfenvvalidates its target before clearing the new environment's safeenv flag.vmstring helpers (string.len,string.sub,string.reverse,string.lower,string.upper,string.rep,string.byte,string.char,string.find,string.match,string.gmatch,string.gsub,string.split,string.format,string.pack,string.packsize, andstring.unpack) report C++-style string/number/range/replacement/format argument errors while preserving numeric string coercion and rejecting integer TValue inputs on generic string/number coercion paths;lua_pushinteger-style string results such as lengths, byte values, pattern positions, substitution counts, pack sizes, and unpack next positions are number-typed like C++.vmUTF-8 helpers (utf8.len,utf8.codepoint,utf8.char,utf8.offset,utf8.codes, and the returnedutf8.codesiterator) report C++-style string/number/range argument errors, reject explicit integer TValue arguments like the C API number/string coercion helpers, preserve numeric string coercion, and return number-typedlua_pushintegerresults.vmbit32 helpers report C++-style number/field/width argument errors while preserving variadic zero-argument defaults and numeric string coercion.vmtable.createreports C++-style missing/type/range errors for the size argument.vmtable.clear,table.clone,table.freeze, andtable.isfrozenreport C++-style first-argument missing/type errors.vmtable.sort,table.foreach, andtable.foreachireport C++-style table/function argument errors.vmtable.getnandtable.maxnreport C++-style first-argument missing/type errors;table.getn,table.pack(...).n,table.foreachiindices, andipairsindices/state use number-typedlua_pushintegerparity.vmtable.unpackreports C++-style table/start/stop argument errors while preserving nil optional defaults.vmtable helpers that read or write integer-indexed slots through C API-style paths now use number keys for those accesses, sotable.movepreserves C++ behavior for large and negative numeric hash ranges.vmtable storage treats explicit Integer TValue keys as distinct hash keys, never array indexes; numeric C API-style array access must use number keys, and the compiler emits generic table access for integer-literal keys instead of number-index bytecode.vmtable.concatreports C++-style separator-first argument order plus table/start/stop diagnostics.vmtable.removereports C++-style table/position argument errors while preserving nil optional defaults.vmtable.insertreports C++-style table/position argument errors, checks the table before arity like C++, parses the optional position argument before readonly mutation checks, and reports the C++ wrong-arity runtime error text.vmtable.concattreats nil separator/start/stop as omitted optional arguments and string-coerces numeric separators, matching C++ default/coercion handling.vmtable.concatreports C++-style invalid table-value runtime errors for unsupported element types, rejects integer TValue entries like C++lua_tolstring, and still accepts table number values through Lua string conversion.vmtable.removetreats omitted or nil positions as the current raw-length tail and returns no values for out-of-range positions before readonly mutation checks, matching C++ optional/no-op behavior.vmtable.clonepreserves array slots in-place instead of shifting them after pre-sized nil slots, andstring.formatparses numeric precision for float specifiers such as%.2f.vmreports C++-style source line prefixes for baseerror,assert, invalid-call, numeric-for, index, arithmetic, comparison, concat, table-key, rawlen type, UTF-8 iterator, vector native, table concat invalid-value, and missing-method failures when the active chunk has a source name, includingassert()missing-argument behavior,error(..., 0)raw error values, native-frame-awareerrorlevels sopcall(error, integer)keeps the raw integer value, stack overflow source prefixes, andxpcallhandler-failure text.vmtostringfollows C++luaL_tolstringfor__tostring: string results pass through, number results are converted to strings, and all other result types raise the standard'__tostring' must return a stringruntime error.vmsupportscoroutine.create,coroutine.resume,coroutine.running,coroutine.status,coroutine.close,coroutine.wrap, andcoroutine.isyieldablewith suspended Lua-frame continuation across nested bytecode calls, yieldablepcall/xpcallcontinuation, yieldable host-native callbacks marked by the embedder, non-yieldable xpcall error-handler continuation, multi-value yield/resume propagation, preserved open upvalues, allocator-failure rollback for suspended debug-frame persistence, coroutine-wrapper generator loops, normal-vs-running status reporting, nativecoroutine.yieldcoroutine bodies, and closing dead, failed, or suspended coroutines.vmcloses and removes open-upvalue records atCLOSEUPVALS, so later loop iterations that reuse a register create distinct captured locals instead of sharing a stale closed upvalue.vmenforces explicit active, suspended-coroutine, and tail-call-chain depth limits and reports catchablestack overflowruntime errors for recursive Lua/native calls; the current interpreter still uses host recursion for non-tail bytecode calls, somake smokebuilds optimized smoke CLIs and reserves a larger Darwin main stack until a future call-frame trampoline removes that platform stack dependence. Luau call bytecode that returns callee results directly reuses the active frame so conformance tail-recursion patterns do not consume host stack while infinite tail recursion still terminates through the logical tail-call limit.vmformats numerictostringthrough Luau's Schubfach shortest-roundtrip path including lowercaseinf/-inf/nan, coerces numeric strings for arithmetic andtonumber, keepstonumber(..., 10)on the standard number-conversion path, parses non-decimaltonumber(text, base)for bases 2..36 through the shared integer parser while returning number values, rejects numeric and vector NaN table assignment keys while reads return nil, and reports concat type errors such asattempt to concatenate nil with string.vmreports C++-style math argument diagnostics for missing, invalid, and argcheck failures while preserving numeric-string coercion throughluaL_checknumber-style paths; mathatan,sinh,cosh, andtanhuse VM-local implementations with conformance-matching behavior.vmgrows call-frame stack storage for large multireturn native results and vararg materialization such asselect("#", table.unpack(t))and{...}over thousands of arguments instead of treating values beyond register 254 as invalid bytecode registers.vmtable.unpacktreats nil optional bounds as omitted values, preserving vararg forwarding patterns that passargs.nwhen it may be nil.compileremits loop cleanup paths sobreak/continueclose captured loop/body locals before advancing or exiting, preserving explicit writes observed by closures; read-only closures created after a writer closure reuse the existing by-reference capture so repeat-until condition closures see connected upvalues, and constant propagation refuses locals that nested/upvalue functions can write so dynamic table indexes stay dynamic.requirehas initial require-by-string path utilities that match the C++ path classifier for./,../, and@paths plus first-component splitting, relative path navigation through host-provided parent/child callbacks, alias navigation for override/fallback hooks, config-provided JSON/Luau aliases,@self, opaque alias jumps, nested aliases, and alias cycle detection, resolver core for require permission, module presence, cache-key/cached status, chunkname, and loadname validation, cache core for registered aliased modules plus required-module cache store/clear behavior, engine core that combines registered lookup, resolver, loader callback, yield status, result caching, and recursive module load cycle detection, validation core that mirrors C++ setup checks for required callbacks andget_alias/get_configexclusivity, error formatting for C++-matching user-facing messages, a runtime wrapper owning cache+engine with require/proxyrequire/register/clear operations, a VM value bridge that maps opaque cache handles to real VM values, VM native installers for globalrequire/proxyrequireplusregistermodule/clearcacheentry/clearcachehelper callbacks without adding a VM-to-Require dependency while keeping navigation filesystem-agnostic.codegenhas initial CodeGen bytecode analysis front-end and IR core helper support: C++-shaped bytecode summary count storage,gatherFunctionsordering/filtering over bytecode function graphs, decoded type-info loading for function arguments/upvalues/local ranges, register type lookup/refinement helpers, basic-block construction from jump-target bitmaps, built-in call type effects, opcode-level bytecode type propagation with vector/userdata host hook result callbacks, packed 32-bit IR operands, IR command/constant/block/function storage, IR value-kind and side-effect utilities, use/substitution/block-order helpers, fixed 256-bit VM register sets, CFG predecessor/successor CSR storage, live-in/live-out VM register analysis, immediate dominators, dominance tree children, block ordering, iterated dominance frontier helpers, function-IR build-loop/dispatcher orchestration, primitive/equality/binary/unary/table/upvalue/loop/generic-for/table/global/namecall/closure/call/fastcall plus scalar math/type/vector/bit32/buffer/integer/string.len/table.insert builtin IR translation helpers, IR text/DOT dump helpers, scalar IR constant folding, scalar arithmetic const-prop peepholes for number/float add/sub/mul/div identities, scalar conversion roundtrip/uint arithmetic peepholes, pure arithmetic/conversion/vector value reuse with user-call clearing, typed entry-argument and predecessor tag facts, linear const-prop block creation for long direct jump paths, dead-store marking for overwritten VM-register full stores and tag/value pairs, captured/live-in/live-out safety, VM-exit and guard fallback liveness, GCO stack-pinning flushes, and unused buffer writes to fresh userdata allocations, tag-awareSELECT_IF_TRUTHYfolding, type/typeof string-name compare rewrites to tag compares, state-preserving pure/check IR classification for const-prop fact retention, custom side-effect command fact repair forDO_LEN,GET_TABLE,SET_TABLE,GET_CACHED_IMPORT, andCONCAT, tag-aware const-prop block-chain driving forSTORE_TAG/LOAD_TAG/CHECK_TAG/JUMP_EQ_TAG, scalar constant value tracking forSTORE_DOUBLE/STORE_INT/STORE_INT64and matching loads, versioned VM-register load reuse/link facts for scalar/pointer/TValue/float component loads,STORE_VECTORcomponent forwarding, andLOAD_FLOATextraction from forwarded vector TValues, pointer value tracking forSTORE_POINTERand matchingLOAD_POINTER, table TValue split-store forwarding for known tags and constant scalar values, VM-register TValue tag/value forwarding for checked tags and matching scalar loads, active scalar load forwarding across tag/TValue stores, duplicate VM-store elimination for active scalar/TValue loads, upvalue load/store forwarding, new-table array-size facts forCHECK_ARRAY_SIZE/SETLIST, array address reuse, repeated array-size guard elimination, array TValue load cache invalidation on stores, hash slot address reuse, repeated slot-match guard elimination/downgrade, hash TValue load cache invalidation on stores, and vector tag unwrap peepholes, scalar-derivedCHECK_TAGfolding for double/int64 values, readonly/no-metatable/safe-env/GC guard reuse,TRY_NUM_TO_INDEX, exactCHECK_BUFFER_LENcache reuse plus constant/dynamic offset-base range merge, exact-offset buffer load reuse, same-width store-to-load forwarding, signed/unsigned narrow-read conversion, and dirty-high-bit truncation for buffer facts, new-table pointer-store guard facts, userdata tag-check reuse for repeated checks and freshNEW_USERDATA, barrier elimination/tag patching from known value tags, fastcall result-tag facts formath.modf/math.frexp, tag/scalar-value branch folding for truthiness and int/number/float compare jumps, numeric-for loop condition folding/rewriting when step is known, the final x64 memory-operand optimization helper, value-location restore tracking, x64 condition/operand helpers for negation/inversion and register/memory/immediate operand construction, x64 emit-common layout/address/number-branch/runtime/barrier/interrupt/fallback/return helpers for VM registers/constants/stack slots, x64 frexp/modf builtin and return/call/setlist/forgloop-instruction helper emission, initial x64 IR lowering for scalar/TValue/environment loads, scalar/TValue stores, array/hash/closure address calculation, integer and int64 arithmetic/division/remainder helpers, scalar numeric math and fused multiply-add/round helpers, scalar float math, scalar/vector conversions, unsigned and int64 bit operations, select ops, vector math/extract ops, comparisons, generic comparison helper calls, control branches, runtime table/string/userdata helper calls, fastcall/stack-adjust helper rows, userdata/numeric/int/int64 compare-check rows, VM-exit finish handlers, counter emission, lower-function optimization/stat pipeline, x64 lowering-driver block orchestration, module-helper assembly, entry-gate assembly, code-block unwind/header-function metadata packing, module-wide x64 get-assembly text/binary-blob/function-stat/bytecode-summary/optional-type-log/IR-detail-flag orchestration, public C API-shaped metadata wrappers plus compile result/failure/stat/support/RNG/perf-log/userdata-remapper helpers, and spill stats, x64 assembly builder label/fixup/data-constant/logging helpers, base binary/mov/movsx/movzx/unary/test/shift/lea/setcc/cmov/jump/call/stack/bit-scan/byte-swap/imul-immediate/padding and AVX binary/unary/move/conversion/rounding/ternary/FMA instruction encoding forms, x64 register/allocation state bookkeeping for allocation order, last-use reuse, spill metadata, restore-needed values, scoped spill restoration, and spill-slot selection, plus A64 condition/register/address helpers, emit-common register/stack/TValue layout plus condition/add-offset/abort/fallback helpers, frexp/modf builtin helper emission, initial A64 IR scalar/TValue/environment load and array/hash/closure address lowering, and A64 register/allocation state bookkeeping for allocation order, last-use reuse, spill metadata, restore-needed values, scoped spill restoration, and spill-slot selection. It does not claim the complete builtin body matrix, full non-constant value propagation beyond current VM-register load/store links, broad x64 instruction-byte encoding beyond current helpers, production executable code allocation, OS unwind registration, liveNativeContexthookup, or executable native dispatch yet.codegenA64 lowering additionally covers initial scalar/vector/split stores, integer arithmetic/division/remainder/sign-extension rows, scalar numeric/float arithmetic rows, numeric/vector select rows, vector arithmetic/map/dot/extract rows, compare/CMP_ANY rows, block-aware branch/control rows, runtime table/string/userdata/import/concat/upvalue/check/guard/slot/node helper rows, buffer length, userdata tag, numeric/int/int64 compare-check rows, runtime-control rows, int64 and uint bit-operation rows, stack/fastcall helper rows, instruction/fallback/generic-for/coverage/newclosure rows, VM-exit finish handlers, sorted-block whole-function lowering driver orchestration with bytecode mapping, implicit safe-env checks, counters, randomized NOP padding, pseudo-row skipping, and restore-block clearing, the lower-function optimization/stat pipeline, module-wide binary assembly wrapper with function stats, bytecode summaries, IR/type text, assembly text with bounded mnemonic rows and.wordfallback, and bounded mnemonic logging, module-helper assembly, entry-gate assembly, and header-function metadata packing; native dispatch parity stays future work.codegenpublic register-allocation wrappers now cover nil-safe x64/A64 allocator init/destroy and A64 default range discovery, alongside existing allocator state accessors; these are metadata/bookkeeping APIs only and do not emit executable native dispatch.codegenA64 get-assembly can emit function headers, bytecode type summaries, IR text, source annotations, per-function outlined-code skip rows, and finalized assembly text when requested. The A64 assembly builder logs the C++LogTest-shaped bounded mnemonic subset for scalar arithmetic/move/bit/shift rows plus common compare/branch/control, load/store/pair, scalar FP arithmetic/rounding/conversion/select rows, SIMD lane, vector bit rows, and data ADR rows, with.wordfallback for still-unlogged rows; current public rows and outlined helper text are pinned against fallback regression, while broader mnemonic coverage remains future work.clihas internal smoke tools:luaucompiles and runs one script path,-stdin source, or recursive directory source list with.lua/.luaufiles and-O<n>optimization/-g<n>debug levels; it runs each top-level script in a coroutine thread with a C++-style sandbox-thread environment that proxies reads to the readonly root globals, socoroutine.running,coroutine.isyieldable,_Gidentity, running-thread close errors, and unexpected top-level yields match CLI thread semantics. It also runs multiple script paths/directories before-a/--program-argsin one VM state with shared require cache and shared top-level varargs, but each script gets its own sandbox-thread global environment like C++ file execution, top-level return values are ignored like C++runFile, and later files/directories still run after earlier failures while the final process status reports whether any failed. It exposes-h/--helpplus explicit usage-error status. It supports C++-matching shebang-line skipping, trailing program arguments for single-script compatibility, host-backedloadstring, file-backed relative and config-aliasedrequire/proxyrequiremodules using the same compile options as the main script plus cache helpers, isolated module sandbox-thread environments over the readonly root globals, C++-style module load diagnostics/source prefixes,module can not yieldrejection, default 256 MiB frontend and post-setup VM heap caps with--frontend-memory-limit=<bytes>/--memory-limit=<bytes>overrides (0disables), and opt-in--instruction-budget=<count>interrupt guards;luau-compileemits textual bytecode dumps by default, can include function constant tables with--dump-constants, emits source/remark output with--remarks, raw bytecode blobs with--binary, or compile-only validation with--nullfor script paths, recursive directory source lists, and-stdin source with matching-O<n>/-g<n>options and the same shebang handling;luau-astparses source through the AST package, emits pretty-printer output with type annotations preserved by default or stripped with--strip-types, and can emit C++-shaped root/commentLocations JSON with--json;luau-bytecodecompiles script paths, recursive directories, or-stdin source and writes a JSON opcode-count summary with the same-O<n>/-g<n>and shebang behavior;luau-conformanceruns conformance scripts with harness-only globals such as quietprint, C++ harness-shapedcollectgarbage,gcinfo,setblockallocations,loadstring,getcoverage, yieldable C-continuation probes (singleYield,multipleYields,multipleYieldsWithNestedCall, andpassthroughCall*),makelud,is_native,is_native_if_supported,int64,vec2, andvertexuserdata helpers including vec2 arithmetic metamethods,-c<n>coverage-level compilation,=basenamechunk names, the same memory-limit flags, a top-level thread-resume/yield/debug-break inspection path for harness scripts such asndebug_upvalues.luauanddebugger.luau, and a default 100,000,000-instruction per-script budget that--instruction-budget=0disables. The current smoke gate pinsapicalls.luau,assert.luau,attrib.luau,basic.luau,bitwise.luau,buffers.luau,calls.luau,clear.luau,closure.luau,constructs.luau,coroutine.luau,coverage.luau,cyield.luau,datetime.luau,debug.luau,debugger.luau,exceptions.luau,errors.luau,events.luau,explicit_type_instantiations.luau,gc.luau,ifelseexpr.luau,integers.luau,interrupt.luau,iter.luau,iter_fenv.luau,literals.luau,locals.luau,math.luau,move.luau,native_integer_spills.luau,native_userdata.luau,ndebug_upvalues.luau,pm.luau,safeenv.luau,sort.luau,strconv.luau,stringinterp.luau,strings.luau,tables.luau,tmerror.luau,tpack.luau,types.luau,utf8.luau,udata_direct.luau,userdata.luau,vararg.luau,vector.luau, andvector_library.luau; the known-largebuffers.luaufixture uses an explicit 2 GiB cap because it intentionally creates a 1 GiB buffer. The AST smoke tool keeps pretty-printer mode as its default while--jsonexercises the AstJsonEncoder path; the bytecode smoke tool summarizes compiler output directly instead of loading through the VM/CodeGen path, and the conformance runner is a progress probe rather than a full test-suite replacement.testsupporthas native end-to-end source smoke coverage that compiles Luau source, loads the emitted bytecode with the VM, and executes primitive scripts plus compiler debug-local dumps, coverage-instrumented bytecode counters, primitive, table-property, constant flow-control, if-elimination side-effect preservation, O2 numeric loop unrolling, O2 builtin arity fastcall, O2 fixed and cost-gated inlined single-return/branch-return/linear-body function calls, and O2 builtin/vector constant-folded bytecode, v7 constant-packedDUPTABLEbytecode, v8 integer-constant bytecode, table/global/import access, table-template duplication, predicted table allocation sizing, sparse positive integer table keys, arithmetic/concat operators, optimized equality branches, fastcall-decorated fallback calls includingselect(_, ...),bit32.extractk,integer.*, andbuffer.readinteger/buffer.writeinteger, local register reuse plus assignment l-value/nested-write alias guards, interpolated strings, runtimeloadstring, installedrequire/proxyrequireand Require cache helper natives, runtime-erased declarations, string formatting/packing/patterns, protected calls, basic globals/proxies, function environments, raw/table/string/utf8/integer/bit32/math/os/buffer/vector/debug builtins including random/noise/date/binary-buffer/vector-arithmetic/debug-stack paths, math argument diagnostics, bit32 string-number coercion, and buffer argument diagnostics/string-number coercion, table helpers including freeze/readonly behavior, table/string method calls, table/vector/userdata metatables with__index/__newindex, operator/call metamethods, and__iter, numeric and genericforloops with capturedbreak/continuecleanup, calls, large multivalue returns, varargs, and closure captures including shared immutable capture cases without adding runtime/compiler package dependency cycles.- Bytecode wire reads report truncation/overlong varints explicitly instead of unchecked reads.
File organization
Each implementation directory is one package. All .odin files in a directory must use that package name.
Split implementation files by logical responsibility, following current source seams where useful. Examples: constants, public types, parser state, bytecode builder, bytecode dump helpers, tests. Do not pile unrelated code into one large package file.
Validation commands
Current scaffold checks:
make gate
make gate runs check, vet, deterministic package tests, CLI smoke, and git diff --check exactly once. The Makefile passes LUAUFLAGS ?= -thread-count:1 to avoid a race in the current compiler's parallel type checker, and make test also passes LUAU_TESTFLAGS ?= -define:ODIN_TEST_THREADS=1 so the test runner stays deterministic. make test runs the aggregate roots analysis -all-packages and testsupport -all-packages, which cover all current package tests without the older repeated per-package rebuild loop. make smoke builds CLIs with LUAU_SMOKEFLAGS ?= $(LUAUFLAGS) -o:speed $(LUAU_DARWIN_STACK_FLAGS) and VM-backed CLIs with LUAU_VM_SMOKEFLAGS ?= $(LUAU_SMOKEFLAGS) -define:VM_MAX_CALL_DEPTH=19999 -define:VM_MAX_LOGICAL_CALL_DEPTH=19999; smoke binaries are ordinary Make targets under build/luau, so unchanged sources do not rebuild them. The luau CLI intentionally mirrors the C++ CLI collectgarbage wrapper and only exposes collect/count; full GC control remains available through the conformance harness and VM package tests. On Darwin, LUAU_DARWIN_STACK_FLAGS reserves an 80 MiB main stack for the current recursive interpreter to reach Luau-style stack-overflow diagnostics. Override these only after the compiler/test-runner parallel issues are no longer present or after VM calls no longer depend on host stack depth.
Equivalent direct package checks:
odin check . -no-entry-point -thread-count:1
odin check common -no-entry-point -thread-count:1
odin check bytecode -no-entry-point -thread-count:1
odin check ast -no-entry-point -thread-count:1
odin check compiler -no-entry-point -thread-count:1
odin check config -no-entry-point -thread-count:1
odin check analysis -no-entry-point -thread-count:1
odin check vm -no-entry-point -thread-count:1
odin check require -no-entry-point -thread-count:1
odin check cli -no-entry-point -thread-count:1
odin check cli/luau -no-entry-point -thread-count:1
odin check cli/luau-compile -no-entry-point -thread-count:1
odin check cli/luau-ast -no-entry-point -thread-count:1
odin check cli/luau-bytecode -no-entry-point -thread-count:1
odin check testsupport -no-entry-point -thread-count:1
Use vet through odin check <dir> -no-entry-point -vet -thread-count:1 for library packages. Do not use non-existent commands such as odin fmt, odin lint, or odin mod.
Use odin test <dir> -thread-count:1 without -no-entry-point; current scaffold packages may report No tests to run. until package-specific tests land. For the full unit pass, prefer make test over per-package loops.
If building smoke binaries by hand, mirror LUAU_SMOKEFLAGS from the Makefile; VM-backed smoke CLIs use LUAU_VM_SMOKEFLAGS for the current Luau call-depth gates. After make smoke, direct binary probes:
build/luau/luau --help
build/luau/luau tests/smoke/runtime_basic.luau
build/luau/luau tests/smoke/closure_loop.luau
build/luau/luau tests/smoke/collectgarbage.luau
build/luau/luau tests/smoke/error_location.luau
build/luau/luau tests/smoke/stack_overflow.luau
build/luau/luau --memory-limit=65536 tests/smoke/memory_limit.luau
build/luau/luau --frontend-memory-limit=1 tests/smoke/basic.luau
build/luau/luau --instruction-budget=1000 tests/smoke/instruction_budget.luau
printf 'print("stdin")\n' | build/luau/luau -
build/luau/luau tests/smoke/runtime_shebang.luau
build/luau/luau -O0 tests/smoke/args.luau alpha beta
build/luau/luau tests/smoke/args.luau alpha beta
build/luau/luau tests/smoke/args.luau --program-args alpha beta
build/luau/luau tests/smoke/multifile_a.luau tests/smoke/multifile_b.luau -a alpha beta
build/luau/luau tests/smoke/runtime_directory -a alpha beta
build/luau/luau tests/smoke/require_main.luau
build/luau/luau tests/smoke/require_env/main.luau
build/luau/luau tests/smoke/require_yield/main.luau
build/luau/luau -g0 tests/smoke/require_debug/main.luau
build/luau/luau tests/smoke/require_shebang/main.luau
build/luau/luau tests/smoke/require_alias_luau/main.luau
build/luau/luau tests/smoke/require_alias_parent/nested/deep/main.luau
build/luau/luau tests/smoke/require_cycle/main.luau
build/luau/luau-compile -g0 tests/smoke/basic.luau
build/luau/luau-compile -O2 tests/smoke/compile_o2.luau
printf 'return 20\n' | build/luau/luau-compile -
build/luau/luau-compile tests/smoke/shebang.luau
build/luau/luau-compile tests/smoke/shebang.luau tests/smoke/compile_o2.luau
build/luau/luau-compile tests/smoke/directory
build/luau/luau-compile --dump-constants tests/smoke/basic.luau
build/luau/luau-compile --remarks tests/smoke/compile_o2.luau
build/luau/luau-compile --null tests/smoke/basic.luau
build/luau/luau-compile --binary tests/smoke/basic.luau > build/luau/basic.luauc
build/luau/luau-compile tests/smoke/basic.luau
build/luau/luau-ast tests/smoke/ast/typed.luau
build/luau/luau-ast --json tests/smoke/ast/typed.luau
build/luau/luau-ast --strip-types tests/smoke/ast/typed.luau
printf 'local input: string = "stdin"\nreturn input\n' | build/luau/luau-ast -
build/luau/luau-ast tests/smoke/ast/directory
build/luau/luau-bytecode --summary-file=build/luau/bytecode-summary.json tests/smoke/basic.luau
build/luau/luau-bytecode --summary-file=build/luau/bytecode-summary.json tests/smoke/directory
build/luau/luau-conformance tests/conformance/apicalls.luau
build/luau/luau-conformance tests/conformance/assert.luau
build/luau/luau-conformance tests/conformance/attrib.luau
build/luau/luau-conformance tests/conformance/basic.luau
build/luau/luau-conformance tests/conformance/bitwise.luau
build/luau/luau-conformance tests/conformance/buffers.luau
build/luau/luau-conformance tests/conformance/calls.luau
build/luau/luau-conformance tests/conformance/clear.luau
build/luau/luau-conformance tests/conformance/closure.luau
build/luau/luau-conformance tests/conformance/constructs.luau
build/luau/luau-conformance tests/conformance/coroutine.luau
build/luau/luau-conformance -c2 tests/conformance/coverage.luau
build/luau/luau-conformance tests/conformance/cyield.luau
build/luau/luau-conformance tests/conformance/datetime.luau
build/luau/luau-conformance tests/conformance/debug.luau
build/luau/luau-conformance tests/conformance/debugger.luau
build/luau/luau-conformance tests/conformance/exceptions.luau
build/luau/luau-conformance tests/conformance/errors.luau
build/luau/luau-conformance tests/conformance/events.luau
build/luau/luau-conformance tests/conformance/explicit_type_instantiations.luau
build/luau/luau-conformance tests/conformance/ifelseexpr.luau
build/luau/luau-conformance tests/conformance/integers.luau
build/luau/luau-conformance tests/conformance/interrupt.luau
build/luau/luau-conformance tests/conformance/iter.luau
build/luau/luau-conformance tests/conformance/iter_fenv.luau
build/luau/luau-conformance tests/conformance/literals.luau
build/luau/luau-conformance tests/conformance/locals.luau
build/luau/luau-conformance tests/conformance/math.luau
build/luau/luau-conformance tests/conformance/move.luau
build/luau/luau-conformance tests/conformance/native_integer_spills.luau
build/luau/luau-conformance tests/conformance/native_userdata.luau
build/luau/luau-conformance tests/conformance/pcall.luau
build/luau/luau-conformance tests/conformance/pm.luau
build/luau/luau-conformance tests/conformance/safeenv.luau
build/luau/luau-conformance tests/conformance/sort.luau
build/luau/luau-conformance tests/conformance/strconv.luau
build/luau/luau-conformance tests/conformance/stringinterp.luau
build/luau/luau-conformance tests/conformance/strings.luau
build/luau/luau-conformance tests/conformance/tables.luau
build/luau/luau-conformance tests/conformance/tmerror.luau
build/luau/luau-conformance tests/conformance/tpack.luau
build/luau/luau-conformance tests/conformance/types.luau
build/luau/luau-conformance tests/conformance/utf8.luau
build/luau/luau-conformance tests/conformance/udata_direct.luau
build/luau/luau-conformance tests/conformance/userdata.luau
build/luau/luau-conformance tests/conformance/vararg.luau
build/luau/luau-conformance tests/conformance/vector.luau
build/luau/luau-conformance tests/conformance/vector_library.luau
build/luau/luau-conformance --memory-limit=65536 tests/smoke/memory_limit.luau
build/luau/luau-conformance --frontend-memory-limit=1 tests/smoke/basic.luau
build/luau/luau-conformance --instruction-budget=1000 tests/smoke/instruction_budget.luau
Existing Luau C++ baseline commands remain valid while the port is in progress:
make test
./luau-tests --fflags=true
./luau-tests -ts=Conformance
Validation-only oracles
When a phase needs exact behavior comparison, add explicit validation-only tooling. Keep it separate from production packages and document what it links to. If an oracle calls C APIs that allocate memory, free C-allocated memory with the C allocator, not the toolchain allocator.