SLeeLa VM Opcode Map
Max Rupplin - MEARVK LLC - 2026
This is the human-readable support map for the canonical source-defined SLeeLa ISA in lib/vm/InstructionSet.sleela.
Canonical ordering and allocation catalog
lib/vm/InstructionSet.sleela is the sole authoritative ordered source registry; the native
SLOp enum in impl/core/sleela_core.h must match it exactly by mnemonic and numeric
position. tools/isa/opcode-registry-3.0.json is the machine-readable allocation/status
catalog, not a second source of opcode assignments. Its verifier checks the
source registry, native enum, contiguous family allocations, and the complete
reserved tail through 281:
python3 tools/verify-opcode-registry.py
make -C impl test-opcode-registry
The standard make -C impl test suite runs this verifier. The sleela-build.py inventory-lib
gate also runs it before accepting the library inventory. Do not reorder or
renumber existing entries to make a family look tidier: preserve IDs and add
new executable instructions only through the append-only registry workflow.
Reserved IDs are family-owned and remain absent from the executable enum and
source opcode records until the full implementation is ready.
Compatibility contract (CI-gated): the frozen pre-OSLS ISA contains 155 opcodes (0..154), including the original OS-call range 103–123. OP_OSLS_CALL is the append-only 156th entry (155). tools/verify-osls-isa-extension.py compares the complete source and native enum sequences against tools/isa/osls-isa-baseline-155.txt; the cross-platform workflow also builds and executes the OSLS native registry and VM binding tests. The tail groups are the array ops (98–102), the operating-system system calls (103–123, OP_OS_*), the GC/system ops (124 OP_GC_HINT, 125 OP_RAN_MEM), the idea-canvas native-bridge ops (126–147, OP_IC_*, from idea/realtime), the VM-selection service op (148, OP_VM_SELECT), the Modium file-resolution scan op (149, OP_MODIUM_SCAN), OP_UI_CALL (150), OP_SSEND (151), and runtime type/stack ops OP_CHECKCAST (152), OP_INSTANCEOF (153), OP_DUP2 (154), and OP_OSLS_CALL (155) — all appended to the end of the enum so earlier opcode numbers are unchanged.
Sync note: the source registry, native enum, and map now cover the appended
OP_IC_*group (126–147),OP_VM_SELECT(148),OP_MODIUM_SCAN(149), and opcodes 150–155. OP_OSLS_CALL (155) dispatches the typed osls_* ABI binding table. The coverage checks compare the ordered source records against the native enum; CI remains the final build-level verification.OP_VM_SELECT(148) is the service-exit seam the Sleela VM selector (virtual-machine/vm-version/SLVmRegistry+ theSLVmVersionNNNmanifests) binds to, so choosing a VM parks a VM-exit the host services by building and booting the chosen version's native main.
| Code | Opcode | Runtime status | Native dispatch |
|---|---|---|---|
| 00 | OP_NOP | Implemented | impl/core/sleela_core.c |
| 01 | OP_CONST | Implemented | impl/core/sleela_core.c |
| 02 | OP_POP | Implemented | impl/core/sleela_core.c |
| 03 | OP_DUP | Implemented | impl/core/sleela_core.c |
| 04 | OP_LOADG | Implemented | impl/core/sleela_core.c |
| 05 | OP_STOREG | Implemented | impl/core/sleela_core.c |
| 06 | OP_LOADL | Implemented | impl/core/sleela_core.c |
| 07 | OP_STOREL | Implemented | impl/core/sleela_core.c |
| 08 | OP_ADD | Implemented | impl/core/sleela_core.c |
| 09 | OP_SUB | Implemented | impl/core/sleela_core.c |
| 10 | OP_MUL | Implemented | impl/core/sleela_core.c |
| 11 | OP_DIV | Implemented | impl/core/sleela_core.c |
| 12 | OP_MOD | Implemented | impl/core/sleela_core.c |
| 13 | OP_NEG | Implemented | impl/core/sleela_core.c |
| 14 | OP_EQ | Implemented | impl/core/sleela_core.c |
| 15 | OP_NE | Implemented | impl/core/sleela_core.c |
| 16 | OP_LT | Implemented | impl/core/sleela_core.c |
| 17 | OP_LE | Implemented | impl/core/sleela_core.c |
| 18 | OP_GT | Implemented | impl/core/sleela_core.c |
| 19 | OP_GE | Implemented | impl/core/sleela_core.c |
| 20 | OP_AND | Implemented | impl/core/sleela_core.c |
| 21 | OP_OR | Implemented | impl/core/sleela_core.c |
| 22 | OP_NOT | Implemented | impl/core/sleela_core.c |
| 23 | OP_JMP | Implemented | impl/core/sleela_core.c |
| 24 | OP_JMPF | Implemented | impl/core/sleela_core.c |
| 25 | OP_CALL | Implemented | impl/core/sleela_core.c |
| 26 | OP_RET | Implemented | impl/core/sleela_core.c |
| 27 | OP_PRINT | Implemented | impl/core/sleela_core.c |
| 28 | OP_SPAWN | Implemented | impl/core/sleela_core.c |
| 29 | OP_JOINALL | Implemented | impl/core/sleela_core.c |
| 30 | OP_LOCK | Implemented | impl/core/sleela_core.c |
| 31 | OP_UNLOCK | Implemented | impl/core/sleela_core.c |
| 32 | OP_SEND | Implemented | impl/core/sleela_core.c |
| 33 | OP_RECV | Implemented | impl/core/sleela_core.c |
| 34 | OP_LISTEN | Implemented | impl/core/sleela_core.c |
| 35 | OP_ACCEPT | Implemented | impl/core/sleela_core.c |
| 36 | OP_CONNECT | Implemented | impl/core/sleela_core.c |
| 37 | OP_SOCKREAD | Implemented | impl/core/sleela_core.c |
| 38 | OP_SOCKWRITE | Implemented | impl/core/sleela_core.c |
| 39 | OP_SOCKCLOSE | Implemented | impl/core/sleela_core.c |
| 40 | OP_PIPE | Implemented | impl/core/sleela_core.c |
| 41 | OP_PIPEPEER | Implemented | impl/core/sleela_core.c |
| 42 | OP_FIFO_MK | Implemented | impl/core/sleela_core.c |
| 43 | OP_FILEOPEN | Implemented | impl/core/sleela_core.c |
| 44 | OP_FILEREAD | Implemented | impl/core/sleela_core.c |
| 45 | OP_FILEWRITE | Implemented | impl/core/sleela_core.c |
| 46 | OP_FILECLOSE | Implemented | impl/core/sleela_core.c |
| 47 | OP_FILEUNLINK | Implemented | impl/core/sleela_core.c |
| 48 | OP_HALT | Implemented | impl/core/sleela_core.c |
| 49 | OP_TIME_UTC_MS | Implemented | impl/core/sleela_core.c |
| 50 | OP_TIME_UTC_NS | Implemented | impl/core/sleela_core.c |
| 51 | OP_TIME_MONO_NS | Implemented | impl/core/sleela_core.c |
| 52 | OP_TIME_PRECISION_MS | Implemented | impl/core/sleela_core.c |
| 53 | OP_TIME_LOCATION | Implemented | impl/core/sleela_core.c |
| 54 | OP_TIME_HTTP_DATE | Implemented | impl/core/sleela_core.c |
| 55 | OP_TIME_JSON | Implemented | impl/core/sleela_core.c |
| 56 | OP_TIME_NTP | Implemented | impl/core/sleela_core.c |
| 57 | OP_TIME_SET_LOCATION | Implemented | impl/core/sleela_core.c |
| 58 | OP_NEWSTRUCT | Implemented | impl/core/sleela_core.c |
| 59 | OP_GETFIELD | Implemented | impl/core/sleela_core.c |
| 60 | OP_SETFIELD | Implemented | impl/core/sleela_core.c |
| 61 | OP_STRUCTPACK | Implemented | impl/core/sleela_core.c |
| 62 | OP_STRUCTUNPACK | Implemented | impl/core/sleela_core.c |
| 63 | OP_SYN_OPEN | Implemented | impl/core/sleela_core.c |
| 64 | OP_SYN_DISPATCH | Implemented | impl/core/sleela_core.c |
| 65 | OP_SYN_STAT | Implemented | impl/core/sleela_core.c |
| 66 | OP_SYN_REPORT | Implemented | impl/core/sleela_core.c |
| 67 | OP_SYN_CLOSE | Implemented | impl/core/sleela_core.c |
| 68 | OP_MUN_START | Implemented | impl/core/sleela_core.c |
| 69 | OP_MUN_CONNECT | Implemented | impl/core/sleela_core.c |
| 70 | OP_MUN_ENABLE | Implemented | impl/core/sleela_core.c |
| 71 | OP_MUN_SEND | Implemented | impl/core/sleela_core.c |
| 72 | OP_MUN_THATCH | Implemented | impl/core/sleela_core.c |
| 73 | OP_MUN_CONSUME | Implemented | impl/core/sleela_core.c |
| 74 | OP_MUN_LATCH | Implemented | impl/core/sleela_core.c |
| 75 | OP_MUN_RECEPTION | Implemented | impl/core/sleela_core.c |
| 76 | OP_MUN_CLOSE | Implemented | impl/core/sleela_core.c |
| 77 | OP_BEST_NEW | Implemented | impl/core/sleela_core.c |
| 78 | OP_BEST_WEIGHT | Implemented | impl/core/sleela_core.c |
| 79 | OP_BEST_MINVER | Implemented | impl/core/sleela_core.c |
| 80 | OP_BEST_BUDGET | Implemented | impl/core/sleela_core.c |
| 81 | OP_BEST_CAND | Implemented | impl/core/sleela_core.c |
| 82 | OP_BEST_RECORD | Implemented | impl/core/sleela_core.c |
| 83 | OP_BEST_SCORE | Implemented | impl/core/sleela_core.c |
| 84 | OP_BEST_BEST | Implemented | impl/core/sleela_core.c |
| 85 | OP_BEST_STAT | Implemented | impl/core/sleela_core.c |
| 86 | OP_BEST_CHOICE | Implemented | impl/core/sleela_core.c |
| 87 | OP_BEST_REPORT | Implemented | impl/core/sleela_core.c |
| 88 | OP_BEST_ARCH | Implemented | impl/core/sleela_core.c |
| 89 | OP_BEST_ARCH_STATE | Implemented | impl/core/sleela_core.c |
| 90 | OP_BEST_CLOSE | Implemented | impl/core/sleela_core.c |
| 91 | OP_AUDIO_NEW | Implemented | impl/core/sleela_core.c |
| 92 | OP_AUDIO_ADD | Implemented | impl/core/sleela_core.c |
| 93 | OP_AUDIO_CONTROLS | Implemented | impl/core/sleela_core.c |
| 94 | OP_AUDIO_VALIDATE | Implemented | impl/core/sleela_core.c |
| 95 | OP_AUDIO_RENDER | Implemented | impl/core/sleela_core.c |
| 96 | OP_AUDIO_CLOSE | Implemented | impl/core/sleela_core.c |
| 97 | OP_AUDIO_PLATFORM | Implemented | impl/core/sleela_core.c |
| 98 | OP_NEWARRAY | Implemented | impl/core/sleela_core.c |
| 99 | OP_ARRGET | Implemented | impl/core/sleela_core.c |
| 100 | OP_ARRSET | Implemented | impl/core/sleela_core.c |
| 101 | OP_ARRLEN | Implemented | impl/core/sleela_core.c |
| 102 | OP_ARRPUSH | Implemented | impl/core/sleela_core.c |
| 103 | OP_OS_PLATFORM | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 104 | OP_OS_CAPABILITY | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 105 | OP_OS_GETENV | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 106 | OP_OS_SETENV | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 107 | OP_OS_CWD | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 108 | OP_OS_CHDIR | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 109 | OP_OS_HOSTNAME | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 110 | OP_OS_USERNAME | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 111 | OP_OS_TEMPDIR | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 112 | OP_OS_PID | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 113 | OP_OS_EXISTS | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 114 | OP_OS_ISDIR | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 115 | OP_OS_FILESIZE | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 116 | OP_OS_MKDIR | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 117 | OP_OS_REMOVE | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 118 | OP_OS_RENAME | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 119 | OP_OS_RUN | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 120 | OP_OS_SPAWN | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 121 | OP_OS_WAIT | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 122 | OP_OS_KILL | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 123 | OP_OS_PCLOSE | Implemented | impl/core/sleela_core.c (sleela_os.c) |
| 124 | OP_GC_HINT | Implemented | impl/core/sleela_core.c |
| 125 | OP_RAN_MEM | Implemented | impl/core/sleela_core.c |
| 126 | OP_IC_CREATE | Implemented | impl/core/sleela_core.c |
| 127 | OP_IC_DESTROY | Implemented | impl/core/sleela_core.c |
| 128 | OP_IC_COLS | Implemented | impl/core/sleela_core.c |
| 129 | OP_IC_ROWS | Implemented | impl/core/sleela_core.c |
| 130 | OP_IC_COUNT | Implemented | impl/core/sleela_core.c |
| 131 | OP_IC_SETPARAMS | Implemented | impl/core/sleela_core.c |
| 132 | OP_IC_EXCITE | Implemented | impl/core/sleela_core.c |
| 133 | OP_IC_STEP | Implemented | impl/core/sleela_core.c |
| 134 | OP_IC_ADVANCE | Implemented | impl/core/sleela_core.c |
| 135 | OP_IC_TIMESTEP | Implemented | impl/core/sleela_core.c |
| 136 | OP_IC_INTENSITY | Implemented | impl/core/sleela_core.c |
| 137 | OP_IC_HASREND | Implemented | impl/core/sleela_core.c |
| 138 | OP_IC_OPENWIN | Implemented | impl/core/sleela_core.c |
| 139 | OP_IC_SHOULDCLOSE | Implemented | impl/core/sleela_core.c |
| 140 | OP_IC_PRESENT | Implemented | impl/core/sleela_core.c |
| 141 | OP_IC_RUN | Implemented | impl/core/sleela_core.c |
| 142 | OP_IC_SETPOLICY | Implemented | impl/core/sleela_core.c |
| 143 | OP_IC_POLICY | Implemented | impl/core/sleela_core.c |
| 144 | OP_IC_BACKEND | Implemented | impl/core/sleela_core.c |
| 145 | OP_IC_GPUAVAIL | Implemented | impl/core/sleela_core.c |
| 146 | OP_IC_MEASHZ | Implemented | impl/core/sleela_core.c |
| 147 | OP_IC_MIGRATE | Implemented | impl/core/sleela_core.c |
| 148 | OP_VM_SELECT | Implemented | impl/core/sleela_core.c |
| 149 | OP_MODIUM_SCAN | Implemented | impl/core/sleela_core.c |
| 150 | OP_UI_CALL | Implemented | impl/core/sleela_core.c |
| 151 | OP_SSEND | Implemented | impl/core/sleela_core.c |
| 152 | OP_CHECKCAST | Implemented | impl/core/sleela_core.c |
| 153 | OP_INSTANCEOF | Implemented | impl/core/sleela_core.c |
| 154 | OP_DUP2 | Implemented | impl/core/sleela_core.c |
| 155 | OP_OSLS_CALL | Implemented | impl/core/sleela_core.c (os-level-support/osls_vm_bridge.c) — typed OSLS ABI registry; JSON result marshalling |
156 | OP_BIGMUL | Implemented | impl/core/sleela_core.c
157 | OP_SLEEP | Implemented | impl/core/sleela_core.c
158 | OP_BIGADD | Implemented | impl/core/sleela_core.c
159 | OP_BIGDIVMOD | Implemented | impl/core/sleela_core.c
160 | OP_BIGSUB | Implemented | impl/core/sleela_core.c
161 | OP_BIGDIV | Implemented | impl/core/sleela_core.c
162 | OP_BIGISQRT | Implemented | impl/core/sleela_core.c
163 | OP_NATIVE_CALL | Implemented | impl/core/sleela_core.c
164 | OP_NATIVE_OPEN | Implemented | impl/core/sleela_core.c
165 | OP_NATIVE_CLOSE | Implemented | impl/core/sleela_core.c
166 | OP_JSTR_LENGTH | Implemented | impl/core/sleela_core.c
167 | OP_JSTR_CHAR_AT | Implemented | impl/core/sleela_core.c
168 | OP_JSTR_CODE_POINT_AT | Implemented | impl/core/sleela_core.c
169 | OP_JSTR_CODE_POINT_COUNT | Implemented | impl/core/sleela_core.c
170 | OP_JSTR_OFFSET_BY_CODE_POINTS | Implemented | impl/core/sleela_core.c
171 | OP_JSTR_SUBSTRING | Implemented | impl/core/sleela_core.c
172 | OP_JSTR_CONCAT | Implemented | impl/core/sleela_core.c
173 | OP_JSTR_HASH_CODE | Implemented | impl/core/sleela_core.c
174 | OP_JSTR_COMPARE_TO | Implemented | impl/core/sleela_core.c
175 | OP_JSTR_FROM_UTF8 | Implemented | impl/core/sleela_core.c
176 | OP_TRY_PUSH | Implemented | impl/core/sleela_core.c
177 | OP_TRY_POP | Implemented | impl/core/sleela_core.c
178 | OP_THROW | Implemented | impl/core/sleela_core.c
179 | OP_IPC_OPEN | Reserved; fail-closed pending process supervisor and VM worker table | impl/core/sleela_core.c
180 | OP_IPC_CALL | Reserved; fail-closed pending process supervisor and VM worker table | impl/core/sleela_core.c
181 | OP_IPC_CLOSE | Reserved; fail-closed pending process supervisor and VM worker table | impl/core/sleela_core.c
182 | OP_REF | Implemented | impl/core/sleela_core.c
183 | OP_JSTR_TO_UTF8 | Implemented | impl/core/sleela_core.c
184 | OP_JSTR_FROM_CODE_UNIT | Implemented | impl/core/sleela_core.c
185 | OP_BAND | Implemented | impl/core/sleela_core.c
186 | OP_BOR | Implemented | impl/core/sleela_core.c
187 | OP_BXOR | Implemented | impl/core/sleela_core.c
188 | OP_BSHL | Implemented | impl/core/sleela_core.c
189 | OP_BSHR | Implemented | impl/core/sleela_core.c
190 | OP_BUSHR | Implemented | impl/core/sleela_core.c
191 | OP_BNOT | Implemented | impl/core/sleela_core.c
192 | OP_CHARSTR | Implemented | impl/core/sleela_core.c
193 | OP_ADDCHAR | Implemented | impl/core/sleela_core.c
194 | OP_NEWARRAYND | Implemented | impl/core/sleela_core.c
195 | OP_MATH_CALL | Implemented | impl/core/sleela_core.c (sl_math_kernel_* C ABI; Core bytecode fallback)
The operating-system opcodes (OP_OS_*) are the host System Call API: the os*
built-ins (osRun/osSpawn/osGetEnv/osExists/...) lower to these opcodes,
which the VM services through impl/core/sleela_os.c on Windows (Win32), Linux,
and macOS (POSIX). A spawned process is a VM-local bounded handle, the same
discipline as sockets and files. Source-side they are mirrored by the
SLISAOs* classes in lib/vm/InstructionSet.sleela and surfaced to a VM via
lib/vm/SleelaVMSystemCallBridge.sleela. Because every VM generation (SLVM/1
through SLVM/11) shares this one ISA, the system-call surface is available to
all of them, not just the base VM.
Native IPC worker opcode reservation
Opcodes 179–181 are append-only ABI reservations: OP_IPC_OPEN,
OP_IPC_CALL, and OP_IPC_CLOSE. Their numeric IDs are fixed and included
in the native/source ISA equality check. Artifact validation checks their
operand shapes. The interpreter currently rejects all three with an explicit
fail-closed diagnostic; they do not launch a worker or create a live handle yet.
Runtime execution becomes available only after the native process supervisor,
host capability authorizer, and VM-owned worker-handle table are integrated.
Object reference opcode
Opcode 182 is the append-only OP_REF, the VM-level view of an object (the
second tier of the two-tier object model; see /POINTERS.md). Its single
operand packs a selector in the low 4 bits and, for DEREF, the class type
index above them: a = (typeIndex << 4) | selector. Selectors: OF, DEREF,
VALID, ID, GEN, TYPE, FIELDS, BYTES, AGE, OLD, LIVE, LIMIT.
A ref is an ordinary SL_INT packed as (generation << 32) | (slot + 1), so
0 is the null ref. It is a weak, generation-checked handle, never a
machine address: every use validates the slot (in range, active, same
generation) and a ref that fails validation reads as invalid rather than
aliasing a different object. Artifact validation checks the selector and the
class operand. The VM artifact ABI minor version advances to 7; artifact
serialization layout is unchanged, and older runtimes reject artifacts that
contain the new opcode.
Reserved native math opcode ranges
The native-math ISA allocation is reserved by family so future additions do not fragment the instruction set. Opcode 195 is implemented; all remaining positions in these ranges are allocation reservations only and must be rejected as unsupported until each instruction is implemented and validated across the compiler, artifact loader, native VM, and supported VM generations.
| Opcode range | Family | Allocation |
|---|---|---|
| 195–199 | Shared native math | 195 OP_MATH_CALL implemented; 196 planned for OP_MATH_ARRAY_CALL; 197–199 reserved |
| 200–207 | Vector | 8 positions |
| 208–215 | Matrix | 8 positions |
| 216–223 | Complex | 8 positions |
| 224–231 | Decomposition | 8 positions |
| 232–281 | Transform | 50 positions |
All ranges are inclusive. Vacant positions remain reserved for their family; they are not general-purpose gaps. In particular, Transform begins at 232 and ends at 281. Existing opcode IDs 0–194, including IPC 179–181, are unchanged. Opcode 195 is the first executable math-family instruction. Do not create enum placeholders or source-registry entries for reserved IDs: the source/native ISA equality verifier must continue to describe executable instructions only.
Runtime rule
The authoritative runtime is /impl/core. An opcode not present in the canonical map is not silently ignored or treated as a no-op.
When an unknown/unsupported opcode reaches the VM dispatch loop:
- the VM writes a diagnostic to standard error; and
- if
SLEELA_OPCODE_LOGis set to a writable path, the diagnostic is appended to that log instead; and - execution is rejected with an
unsupported opcodeVM error.
Example:
SLEELA_OPCODE_LOG=/var/log/sleela/opcodes.log ./impl/build/sleela ...
The environment variable is optional. Standard error remains the fallback when the configured log cannot be opened.
Maintenance rule
Any new source-defined opcode must be added in this order:
lib/vm/InstructionSet.sleela- native
SLOpenum inimpl/core/sleela_core.h - native dispatch in
impl/core/sleela_core.c - this support map
- the source/ISA coverage verifier
- SLVM/1 through SLVM/11 source-to-VM contracts.
A source opcode is not considered supported merely because it appears in the source registry. Native dispatch is required.
The
OP_OS_*system-call group followed this rule end to end: added toInstructionSet.sleela(step 1), the nativeSLOpenum (step 2) and dispatch (step 3), this map (step 4), and reflected in the SLVM/1–11 runtime-services contract (step 6) viaRUNTIME-SERVICES.md.