Skip to main content

Op

Enum Op 

Source
pub enum Op {
Show 120 variants LoadConst { dst: Reg, idx: u32, }, Move { dst: Reg, src: Reg, }, RevSwap { a: Reg, b: Reg, }, RevXor { place: Reg, delta: Reg, }, RevNeg { place: Reg, }, RevAdd { place: Reg, delta: Reg, }, RevSub { place: Reg, delta: Reg, }, EnsureOwned { reg: Reg, }, Add { dst: Reg, lhs: Reg, rhs: Reg, }, AddAssign { dst: Reg, src: Reg, }, Sub { dst: Reg, lhs: Reg, rhs: Reg, }, Mul { dst: Reg, lhs: Reg, rhs: Reg, }, Div { dst: Reg, lhs: Reg, rhs: Reg, }, ExactDiv { dst: Reg, lhs: Reg, rhs: Reg, }, FloorDiv { dst: Reg, lhs: Reg, rhs: Reg, }, Mod { dst: Reg, lhs: Reg, rhs: Reg, }, DivPow2 { dst: Reg, lhs: Reg, k: u8, }, MagicDivU { dst: Reg, lhs: Reg, magic: u64, more: u8, mul_back: i64, divisor: i64, wrap: bool, }, Lt { dst: Reg, lhs: Reg, rhs: Reg, }, Gt { dst: Reg, lhs: Reg, rhs: Reg, }, LtEq { dst: Reg, lhs: Reg, rhs: Reg, }, GtEq { dst: Reg, lhs: Reg, rhs: Reg, }, Eq { dst: Reg, lhs: Reg, rhs: Reg, }, ApproxEq { dst: Reg, lhs: Reg, rhs: Reg, }, NotEq { dst: Reg, lhs: Reg, rhs: Reg, }, Not { dst: Reg, src: Reg, }, Concat { dst: Reg, lhs: Reg, rhs: Reg, }, SeqConcat { dst: Reg, lhs: Reg, rhs: Reg, }, Pow { dst: Reg, lhs: Reg, rhs: Reg, }, BitXor { dst: Reg, lhs: Reg, rhs: Reg, }, BitAnd { dst: Reg, lhs: Reg, rhs: Reg, }, BitOr { dst: Reg, lhs: Reg, rhs: Reg, }, Shl { dst: Reg, lhs: Reg, rhs: Reg, }, Shr { dst: Reg, lhs: Reg, rhs: Reg, }, Jump { target: usize, }, JumpIfFalse { cond: Reg, target: usize, }, JumpIfTrue { cond: Reg, target: usize, }, Call { dst: Reg, func: u16, args_start: Reg, arg_count: u16, }, CallBuiltin { dst: Reg, builtin: BuiltinId, args_start: Reg, arg_count: u16, }, CallValue { dst: Reg, callee: Reg, args_start: Reg, arg_count: u16, name_for_err: u32, }, MakeClosure { dst: Reg, func: u16, locals_start: Reg, }, CheckPolicy { subject: Reg, predicate: Symbol, is_capability: bool, object: Reg, source_text: u32, }, ListPushField { obj: Reg, field: u32, src: Reg, }, GlobalGet { dst: Reg, idx: u16, }, GlobalSet { idx: u16, src: Reg, }, Return { src: Reg, }, ReturnNothing, NewList { dst: Reg, start: Reg, count: u16, }, NewEmptyList { dst: Reg, }, NewEmptyListWithCapacity { dst: Reg, capacity: Reg, }, NewEmptyListFixed { dst: Reg, capacity: u16, }, NewEmptyListI32 { dst: Reg, }, NewEmptySet { dst: Reg, }, NewEmptyMap { dst: Reg, }, NewEmptyMapWithCapacity { dst: Reg, capacity: Reg, }, NewRange { dst: Reg, start: Reg, end: Reg, }, ListPush { list: Reg, value: Reg, }, SetAdd { set: Reg, value: Reg, }, RemoveFrom { collection: Reg, value: Reg, }, SetIndex { collection: Reg, index: Reg, value: Reg, }, SetIndexUnchecked { collection: Reg, index: Reg, value: Reg, }, Index { dst: Reg, collection: Reg, index: Reg, }, IndexUnchecked { dst: Reg, collection: Reg, index: Reg, }, RegionBoundsGuard { array: Reg, bound: Reg, iv: Reg, add_max: i32, add_min: i32, }, Length { dst: Reg, collection: Reg, }, Contains { dst: Reg, collection: Reg, value: Reg, }, FormatValue { dst: Reg, src: Reg, spec: u32, debug_prefix: u32, }, SliceOp { dst: Reg, collection: Reg, start: Reg, end: Reg, }, DeepClone { dst: Reg, src: Reg, }, NewTuple { dst: Reg, start: Reg, count: u16, }, UnionOp { dst: Reg, lhs: Reg, rhs: Reg, }, IntersectOp { dst: Reg, lhs: Reg, rhs: Reg, }, LoadToday { dst: Reg, }, LoadNow { dst: Reg, }, NewStruct { dst: Reg, type_name: u32, }, StructInsert { obj: Reg, field: u32, value: Reg, }, GetField { dst: Reg, obj: Reg, field: u32, }, NewInductive { dst: Reg, type_name: u32, ctor: u32, args_start: Reg, count: u16, }, TestArm { dst: Reg, target: Reg, variant: u32, }, BindArm { dst: Reg, target: Reg, field: u32, index: u16, }, CrdtBump { obj: Reg, field: u32, amount: Reg, negate: bool, }, CrdtMerge { target: Reg, source: Reg, }, CrdtJoin { target: Reg, source: Reg, }, BigIntWide { kind: u8, dst: Reg, a: Reg, b: Reg, }, NewCrdt { dst: Reg, kind: u8, }, CrdtAppend { seq: Reg, value: Reg, }, CrdtResolve { obj: Reg, field: u32, value: Reg, }, IterPrepare { iterable: Reg, }, IterNext { dst: Reg, exit: usize, }, IterPop, ListPop { list: Reg, dst: Reg, }, Sleep { duration: Reg, }, DestructureTuple { src: Reg, start: Reg, count: u16, }, Show { src: Reg, }, Obs { site: u32, args_start: Reg, args_count: u16, }, Args { dst: Reg, }, ChanNew { dst: Reg, cap: i32, elem: ChanElem, }, ChanSend { chan: Reg, val: Reg, }, ChanRecv { dst: Reg, chan: Reg, }, ChanTrySend { dst: Reg, chan: Reg, val: Reg, }, ChanTryRecv { dst: Reg, chan: Reg, }, ChanClose { chan: Reg, }, Spawn { func: u16, args_start: Reg, arg_count: u16, }, SpawnHandle { dst: Reg, func: u16, args_start: Reg, arg_count: u16, }, TaskAwait { dst: Reg, handle: Reg, }, TaskAbort { handle: Reg, }, SelectArmRecv { chan: Reg, var: Reg, }, SelectArmTimeout { ticks: Reg, }, SelectWait { dst_arm: Reg, }, NetConnect { url: Reg, }, NetListen { topic: Reg, }, NetSend { to: Reg, msg: Reg, }, NetStream { to: Reg, values: Reg, }, NetAwait { dst: Reg, from: Reg, stream: bool, }, NetMakePeer { dst: Reg, addr: Reg, }, NetSync { dst: Reg, topic: Reg, }, Tcp { dst: Reg, kind: u8, args_start: Reg, arg_count: u16, }, Serve { port: Reg, handler: u16, }, FailWith { msg: u32, }, Halt,
}

Variants§

§

LoadConst

R[dst] = constants[idx]

Fields

§dst: Reg
§idx: u32
§

Move

R[dst] = R[src] (shallow clone)

Fields

§dst: Reg
§src: Reg
§

RevSwap

Exchange R[a] and R[b] in place — the canonical ZERO-GARBAGE reversible primitive (its own inverse: swapping twice is the identity). Reverse execution re-applies it with no history tape entry, so it reverses with zero erased bits (the adiabatic charge-recovery case).

Fields

§

RevXor

In-place XOR: R[place] ^= R[delta] over the ℤ/2ⁿ ring — SELF-INVERSE ((x ⊕ e) ⊕ e = x), so reverse re-applies it with no history-tape entry (zero garbage). Requires place != delta (else x ⊕ x = 0 erases x) — a well-formedness invariant the emitter guarantees, like a valid jump target. R[delta] is read-only, and the reverse-order invariant restores it to its forward value before this op is re-applied, so the inverse is exact.

Fields

§place: Reg
§delta: Reg
§

RevNeg

In-place modular negation: R[place] = -R[place] (wrapping two’s-complement) — SELF-INVERSE (-(-x) = x for every i64, i64::MIN included), so reverse re-applies it with no tape entry. The additive inverse of the (ℤ/2ⁿ, +) group.

Fields

§place: Reg
§

RevAdd

In-place modular add: R[place] = R[place] + R[delta] (wrapping, non-promoting — the reversible additive translation, DISTINCT from the BigInt-promoting Op::Add). Its inverse is Op::RevSub with the same operands; reverse applies that, no tape entry. Requires place != delta (else x + x = 2x is not invertible by subtraction). R[delta] is read-only.

Fields

§place: Reg
§delta: Reg
§

RevSub

In-place modular subtract: R[place] = R[place] - R[delta] (wrapping). Mutual inverse of Op::RevAdd; reverse applies RevAdd, no tape entry. Requires place != delta.

Fields

§place: Reg
§delta: Reg
§

EnsureOwned

Copy-on-write barrier: if R[reg]’s collection is shared (Rc strong > 1), deep-clone it in place so R[reg] becomes the sole owner. Emitted before an argument is passed to a function whose corresponding parameter is an inferred MUTABLE BORROW (mutated in place and returned): the callee’s element writes then land on a buffer no OTHER live handle can observe, so an aliasing caller (Let y be arr; Set arr to f(arr)) still sees value semantics. A no-op when already uniquely owned (the common Set x to f(x) consume-reassign), so the hot path pays only a strong-count check. Mirrors the AOT’s call-site .cow().

Fields

§reg: Reg
§

Add

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

AddAssign

R[dst] = R[dst] + R[src] — the Set x to x + … shape. Semantically identical to Add { dst, lhs: dst, rhs: src }; the dedicated form lets the VM append in place when R[dst] is a sole-owner Text (turning the O(n²) build-a-string-by-concatenation loop into amortized O(n)).

Fields

§dst: Reg
§src: Reg
§

Sub

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Mul

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Div

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

ExactDiv

EXACT division (7 / 2 → 7/2, a Rational), the type-directed sibling of Op::Div — emitted for BinaryOpKind::ExactDivide.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

FloorDiv

FLOOR division (-7 // 2 → -4, toward negative infinity) — emitted for BinaryOpKind::FloorDivide, distinct from the truncating Op::Div.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Mod

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

DivPow2

dst = lhs / 2^k (signed, round toward zero) — emitted only when the divisor is a literal power of two AND the Oracle proved lhs is Int. A single op (the JIT lowers it to the side-exit-free divpow2 shift stencil) so it fires for loop-invariant divisors the in-region JIT detector misses, without the scratch-register pressure of an expansion.

Fields

§dst: Reg
§lhs: Reg
§k: u8
§

MagicDivU

dst = lhs / c (mul_back == 0) or dst = lhs % c (mul_back == c), where c is a compile-time-constant divisor that is NOT a power of two (W5/DivPow2 handles powers of two), computed by the Granlund–Montgomery / libdivide UNSIGNED magic-reciprocal sequence (a mul-high + shift, ~3 cycles) instead of idiv (~25 cycles). magic/more are the precomputed constants (the exact logicaffeine_data::LogosDivU64 encoding — low 6 bits of more are the shift, 0x40 is the 65-bit add-marker path). Emitted ONLY when the Oracle proves lhs is Int and NON-NEGATIVE: the unsigned magic equals the signed truncating //% only for a non-negative dividend (for x < 0 the signs disagree, exactly as for the % 2^k → & rewrite). The remainder is derived as lhs - q*c (wrapping), bit-exact with the kernel’s wrapping_rem for non-negative lhs. divisor carries the original constant c so the VM handler can fall back to an exact Div/Mod when lhs is a BigInt the u64 magic reciprocal cannot hold (the optimistic non-negative gate does not prove the dividend fits i64). wrap: the Oracle also proved lhs < 2 * divisor (Opt::ModWrap), so the remainder is lhs, less divisor once when lhs >= divisor — a compare and a subtract a backend may compute in place of the magic sequence. A backend that reads the magic constants stays exact.

Fields

§dst: Reg
§lhs: Reg
§magic: u64
§more: u8
§mul_back: i64
§divisor: i64
§wrap: bool
§

Lt

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Gt

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

LtEq

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

GtEq

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Eq

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

ApproxEq

Tolerant float comparison (a is approximately b) — the shared isclose semantics (logicaffeine_data::ops::logos_approx_eq); ==/Eq stays IEEE bit-exact.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

NotEq

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Not

Fields

§dst: Reg
§src: Reg
§

Concat

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

SeqConcat

a followed by b — merge two sequences into one.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Pow

a ** b — exponentiation. Integer power is exact (promotes to BigInt on overflow); a Float operand uses powf; a negative Int exponent errors.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

BitXor

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

BitAnd

a & b — bitwise AND on Int, logical on Bool, intersection on Sets.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

BitOr

a | b (see BitAnd) — union on Sets.

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Shl

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Shr

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Jump

Unconditional jump to absolute instruction index.

Fields

§target: usize
§

JumpIfFalse

Jump if R[cond] is falsey.

Fields

§cond: Reg
§target: usize
§

JumpIfTrue

Jump if R[cond] is truthy.

Fields

§cond: Reg
§target: usize
§

Call

Call a user function. The caller has placed arg_count arguments in consecutive registers starting at args_start (relative to the caller’s frame base). The result is written to R[dst]. Uses register windowing.

Fields

§dst: Reg
§func: u16
§args_start: Reg
§arg_count: u16
§

CallBuiltin

Call a kernel builtin with already-evaluated arguments (arity was validated at compile time, mirroring the tree-walker’s arity-before-evaluation rule).

Fields

§dst: Reg
§builtin: BuiltinId
§args_start: Reg
§arg_count: u16
§

CallValue

Call the closure value in R[callee]. name_for_err is the function name when this came from a by-name call (Unknown function: f when the value is not callable) or u32::MAX for a call-by-expression (Cannot call value of type T).

Fields

§dst: Reg
§callee: Reg
§args_start: Reg
§arg_count: u16
§name_for_err: u32
§

MakeClosure

Build a closure over program.functions[func]: its captures list is snapshotted — local captures deep-cloned from the register window at locals_start, global captures from the globals table (skipped when still undefined; the body then falls through to the live global).

Fields

§dst: Reg
§func: u16
§locals_start: Reg
§

CheckPolicy

Check subject can/is predicate (of object) — kernel policy check. object == Reg::MAX means no object.

Fields

§subject: Reg
§predicate: Symbol
§is_capability: bool
§object: Reg
§source_text: u32
§

ListPushField

Push value to obj's field — kernel push into a struct’s List field. field is a Text constant (the resolved field name).

Fields

§obj: Reg
§field: u32
§src: Reg
§

GlobalGet

R[dst] = globals[idx], error “Undefined variable: {name}” when unset.

Fields

§dst: Reg
§idx: u16
§

GlobalSet

globals[idx] = R[src] (defines or overwrites).

Fields

§idx: u16
§src: Reg
§

Return

Return R[src] from the current function.

Fields

§src: Reg
§

ReturnNothing

Return nothing from the current function.

§

NewList

R[dst] = [R[start], …, R[start+count-1]] (a new list).

Fields

§dst: Reg
§start: Reg
§count: u16
§

NewEmptyList

Fields

§dst: Reg
§

NewEmptyListWithCapacity

R[dst] = a new empty list reserving max(R[capacity], 0) elements. Unlike NewEmptyListFixed, this carries a source/runtime capacity hint and therefore reads a register rather than a compile-time proof.

Fields

§dst: Reg
§capacity: Reg
§

NewEmptyListFixed

R[dst] = a new empty list whose exact maximum length is capacity. The shared fixed-sequence proof emits this only for a non-escaping local. It is observably identical to NewEmptyList; storage-aware backends may reserve once or use frame-local backing instead of a growable heap list.

Fields

§dst: Reg
§capacity: u16
§

NewEmptyListI32

R[dst] = a new half-width (Vec) Int sequence — emitted (behind LOGOS_NARROW_VM) for a new Seq of Int declaration the narrowing proof certified fits i32. Observably identical to NewEmptyList; only the storage width differs (see crate::interpreter::ListRepr::IntsI32).

Fields

§dst: Reg
§

NewEmptySet

Fields

§dst: Reg
§

NewEmptyMap

Fields

§dst: Reg
§

NewEmptyMapWithCapacity

R[dst] = a new empty map reserving max(R[capacity], 0) entries.

Fields

§dst: Reg
§capacity: Reg
§

NewRange

R[dst] = [R[start]..=R[end]] (inclusive integer range as a list).

Fields

§dst: Reg
§start: Reg
§end: Reg
§

ListPush

Append R[value] to the list in R[list] (mutates in place).

Fields

§list: Reg
§value: Reg
§

SetAdd

Add R[value] to the set in R[set] (no-op if already present).

Fields

§set: Reg
§value: Reg
§

RemoveFrom

Remove R[value] from the set/map in R[collection].

Fields

§collection: Reg
§value: Reg
§

SetIndex

R[collection][R[index]] = R[value] (1-based list set, or map insert).

Fields

§collection: Reg
§index: Reg
§value: Reg
§

SetIndexUnchecked

Like SetIndex but the Oracle PROVED the index in [1, length] (range analysis, M9) — bounds-check elimination for the STORE. The interpreter still checks (free defense-in-depth); the JIT lowers it to an UNCHECKED array store (no bounds branch). Only listy collections with a stable length earn this, via index_provably_in_bounds.

Fields

§collection: Reg
§index: Reg
§value: Reg
§

Index

R[dst] = R[collection][R[index]] (1-based for ordered collections).

Fields

§dst: Reg
§collection: Reg
§index: Reg
§

IndexUnchecked

Like Index but the Oracle (range analysis, M9) PROVED the index in [1, length] at this point — bounds-check elimination, the V8/LLVM way. The bytecode interpreter still checks (a sound proof makes the check never fire; keeping it is free defense-in-depth), but the JIT lowers it to an UNCHECKED array load (no bounds branch, no deopt). Only listy collections with a stable length earn this; the compiler emits it solely behind index_provably_in_bounds.

Fields

§dst: Reg
§collection: Reg
§index: Reg
§

RegionBoundsGuard

REGION-ENTRY bounds-check hoist (V8 TurboFan loop bound-check elimination). For a loop while iv </<= bound reading/writing R[array] at affine indices, this asserts ONCE — at native region entry — that the array is long enough for the whole loop: length(R[array]) >= R[bound] + add_max and R[iv] + add_min >= 1. If it holds, the region runs every covered access UNCHECKED; if not, the VM declines the region and replays on bytecode (where the accesses are checked). A pure no-op in the interpreter and the function tier — speculation is region-only, made safe solely by this entry guard.

Fields

§array: Reg
§bound: Reg
§iv: Reg
§add_max: i32
§add_min: i32
§

Length

R[dst] = length of R[collection].

Fields

§dst: Reg
§collection: Reg
§

Contains

R[dst] = R[collection] contains R[value].

Fields

§dst: Reg
§collection: Reg
§value: Reg
§

FormatValue

R[dst] = Text(debug_prefix? + format(R[src], spec?)) — one interpolated-string segment. u32::MAX = no spec / no prefix.

Fields

§dst: Reg
§src: Reg
§spec: u32
§debug_prefix: u32
§

SliceOp

R[dst] = R[collection][R[start]..=R[end]] (1-indexed inclusive).

Fields

§dst: Reg
§collection: Reg
§start: Reg
§end: Reg
§

DeepClone

R[dst] = deep clone of R[src].

Fields

§dst: Reg
§src: Reg
§

NewTuple

R[dst] = (R[start], …, R[start+count-1]) (immutable tuple).

Fields

§dst: Reg
§start: Reg
§count: u16
§

UnionOp

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

IntersectOp

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

LoadToday

R[dst] = today (Date; honors the test fixed-clock).

Fields

§dst: Reg
§

LoadNow

R[dst] = now (Moment; honors the test fixed-clock).

Fields

§dst: Reg
§

NewStruct

R[dst] = Struct { type_name: constants[type_name], fields: {} }.

Fields

§dst: Reg
§type_name: u32
§

StructInsert

Insert R[value] under field constants[field] into the struct in R[obj] (construction and SetField — structs have VALUE semantics, so in-place mutation of the register equals the tree-walker’s clone-mutate-reassign).

Fields

§obj: Reg
§field: u32
§value: Reg
§

GetField

R[dst] = R[obj].field — “Field ‘{f}’ not found” / “Cannot access field on {type}”.

Fields

§dst: Reg
§obj: Reg
§field: u32
§

NewInductive

R[dst] = Inductive { type, constructor, args: R[args_start..+count] }.

Fields

§dst: Reg
§type_name: u32
§ctor: u32
§args_start: Reg
§count: u16
§

TestArm

R[dst] = Bool(struct type-name or inductive constructor == constants[variant]); false for any other value.

Fields

§dst: Reg
§target: Reg
§variant: u32
§

BindArm

Inspect-arm binding: a Struct target binds fields[constants[field]], an Inductive target binds args[index]. A missing field/index leaves R[dst] unwritten (the tree-walker skips the bind — unreachable for parsed programs, whose fields always exist after default-fill).

Fields

§dst: Reg
§target: Reg
§field: u32
§index: u16
§

CrdtBump

GCounter/PNCounter bump of R[obj].field by R[amount] (negated for Decrease — also selects the tree-walker’s increment/decrement wording).

Fields

§obj: Reg
§field: u32
§amount: Reg
§negate: bool
§

CrdtMerge

GCounter merge: fold every field of R[source] into R[target].

Fields

§target: Reg
§source: Reg
§

CrdtJoin

GCounter LATTICE JOIN: per-replica MAX of two 4-lane G-Counters (R[target] ⊔= R[source]), the state-based, idempotent join. Unlike CrdtMerge’s polymorphic field-wise merge (which is field-wise ADD for bare-int counters), this is the fixed 4-lane per-replica MAX that maps 1:1 to the crdt_merge hardware block — the coprocessor the real soft-core issues on its port.

Fields

§target: Reg
§source: Reg
§

BigIntWide

256-BIT BIGINT LANE — one opcode for the whole wide-arithmetic family, routed on the soft-core to the proven bigint_alu/bigint_div/bigint_mul blocks over an 8×256-bit wide register bank. kind selects the operation: 0 = FromInt (W[dst] = zext(R[a])), 1 = Add (W[dst]=W[a]+W[b]), 2 = Sub, 3 = Cmp (R[dst] = W[a] < W[b]), 4 = Low (R[dst] = W[a][31:0]), 5 = Div, 6 = Mul. On the chip word the kind rides the high nibble of the dst byte; the VM carries it as a field.

Fields

§kind: u8
§dst: Reg
§

NewCrdt

R[dst] = a fresh, empty rich CRDT — kind 0 = SharedSet (OR-Set), 1 = SharedSequence (RGA), 2 = Divergent (MV-register). Used to default-fill a Shared struct’s CRDT fields, mirroring the tree-walker’s new-struct init.

Fields

§dst: Reg
§kind: u8
§

CrdtAppend

RGA append: push R[value] onto the replicated sequence in R[seq] (mutates the shared CRDT in place, so a field access propagates).

Fields

§seq: Reg
§value: Reg
§

CrdtResolve

Resolve R[obj].field to R[value]: a real MV-register resolves in place, a plain field is overwritten — the same fallback the tree-walker’s Resolve takes.

Fields

§obj: Reg
§field: u32
§value: Reg
§

IterPrepare

Snapshot R[iterable] (List/Set items, Text chars, Map (k,v) tuples) and push it onto the iterator stack.

Fields

§iterable: Reg
§

IterNext

Load the next snapshot element into R[dst] and advance; jump to exit when exhausted (the iterator stays pushed — IterPop at the exit point drops it).

Fields

§dst: Reg
§exit: usize
§

IterPop

Drop the top iterator.

§

ListPop

R[dst] = R[list].pop() — Nothing when empty (not an error).

Fields

§list: Reg
§dst: Reg
§

Sleep

Sleep for R[nanos] (Duration nanos, or Int milliseconds).

Fields

§duration: Reg
§

DestructureTuple

Tuple-pattern binding: R[start..start+count] = tuple elements with zip semantics (stops at the shorter side, like the tree-walker). Errors when R[src] is not a Tuple.

Fields

§src: Reg
§start: Reg
§count: u16
§

Show

Emit R[src].to_display_string() to the output stream.

Fields

§src: Reg
§

Obs

Emit an observation event (Wave 13 — the OBSERVED profile only). site indexes CompiledProgram::observation_sites for the category / message / payload names / span kind (all resolved at compile time); a Message site reads its payload VALUES from the register range R[args_start .. args_start+args_count]. Never emitted in the elided (compiled/release) profile — observation is erased before those tiers — so this op is Unreachable for AOT/WASM (see wasm_aot_lock).

Fields

§site: u32
§args_start: Reg
§args_count: u16
§

Args

R[dst] = the program argument vector as a Seq of Text (the interpreter’s args() system native, mirroring the compiled binary’s env::args(): index 0 is the program name). Outside the JIT integer subset, so the adapters bail on it and it always runs in the VM.

Fields

§dst: Reg
§

ChanNew

R[dst] = a new channel; cap < 0 ⇒ the scheduler’s default capacity. elem is the declared Pipe of T element type (a hint for a typed-queue consumer; the scheduler ignores it).

Fields

§dst: Reg
§cap: i32
§

ChanSend

Send R[val] into channel R[chan] (blocks if the channel is full).

Fields

§chan: Reg
§val: Reg
§

ChanRecv

R[dst] = receive from channel R[chan] (blocks if the channel is empty).

Fields

§dst: Reg
§chan: Reg
§

ChanTrySend

R[dst] = bool — non-blocking send of R[val] into R[chan].

Fields

§dst: Reg
§chan: Reg
§val: Reg
§

ChanTryRecv

R[dst] = received value, or Nothing — non-blocking receive from R[chan].

Fields

§dst: Reg
§chan: Reg
§

ChanClose

Close channel R[chan].

Fields

§chan: Reg
§

Spawn

Spawn functions[func] with args in R[args_start..+arg_count] (fire-and-forget).

Fields

§func: u16
§args_start: Reg
§arg_count: u16
§

SpawnHandle

R[dst] = task handle of a spawned functions[func] (same arg convention).

Fields

§dst: Reg
§func: u16
§args_start: Reg
§arg_count: u16
§

TaskAwait

R[dst] = result of awaiting task R[handle] (Nothing if it was aborted).

Fields

§dst: Reg
§handle: Reg
§

TaskAbort

Abort task R[handle].

Fields

§handle: Reg
§

SelectArmRecv

Register a Receive var from chan arm for the next SelectWait.

Fields

§chan: Reg
§var: Reg
§

SelectArmTimeout

Register an After ticks timeout arm for the next SelectWait.

Fields

§ticks: Reg
§

SelectWait

Block on the registered select arms; R[dst_arm] = the winning arm index (a recv arm’s received value is already in its var register).

Fields

§dst_arm: Reg
§

NetConnect

Dial the relay at R[url] (async); resume when connected.

Fields

§url: Reg
§

NetListen

Subscribe this node’s inbox to R[topic] (async); resume when subscribed.

Fields

§topic: Reg
§

NetSend

Encode R[msg] and publish it to peer R[to].

Fields

§to: Reg
§msg: Reg
§

NetStream

Batch-stream the list R[values] to peer R[to].

Fields

§to: Reg
§values: Reg
§

NetAwait

R[dst] = await a message (or a batch stream, if stream) from peer R[from]`` (blocks).

Fields

§dst: Reg
§from: Reg
§stream: bool
§

NetMakePeer

R[dst] = a PeerAgent handle for address R[addr]`` (its canonical relay topic). Pure.

Fields

§dst: Reg
§addr: Reg
§

NetSync

CRDT sync point on topic R[topic]: publish R[dst]’s counter, merge what has arrived, and write the merged value back to R[dst].

Fields

§dst: Reg
§topic: Reg
§

Tcp

A tcp.lg client native (async-tier): kind is the TcpOp code (connect/send/recv/recvExact/close — the BigIntWide one-op-many-kinds pattern), operands in R[args_start..args_start+arg_count]. Suspends via VmBlock::Tcp; the async io driver services it through the SAME TcpRegistry::exec_values the tree-walker calls, and resumes R[dst] with the LOGOS Result value.

Fields

§dst: Reg
§kind: u8
§args_start: Reg
§arg_count: u16
§

Serve

Serve HTTP on R[port] with the handler function handler (a resolved FuncIdx) — the Serve keystone on the bytecode tier. Suspends via VmBlock::Serve; the async io driver owns the SAME concurrent accept loop the tree-walker’s serve_http_concurrent uses, and per connection RE-ENTERS handler AS VM BYTECODE (a fresh child Vm at the handler’s entry) with the marshaled Request value, reading its Response through the shared request/response marshaling — so both tiers serve byte-identically. The accept loop never returns; this op never resumes.

Fields

§port: Reg
§handler: u16
§

FailWith

Fail with the Text constant at msg — used for constructs whose tree-walker semantics are “error WHEN EXECUTED” (an unbound Set, an unsupported statement). Never fails at compile time: dead branches must stay free.

Fields

§msg: u32
§

Halt

Stop execution.

Implementations§

Source§

impl Op

Source

pub fn name(&self) -> &'static str

A stable name for this op variant — EXHAUSTIVE (no wildcard), so a new VM instruction fails to compile until it is named here. The single source of truth for op names shared by every catalog lock (WASM-AOT support, reversibility, …) — see tests/reverse_op_lock.rs.

Source

pub fn for_each_written_reg(&self, f: impl FnMut(Reg))

Every register this op WRITES (rebinds). EXHAUSTIVE (no wildcard) and over-approximate — a conditional write (IterNext’s element) and a copy-on-write rebind (EnsureOwned) count. An analysis that types or classifies registers takes a written register’s facts from the writing op alone, never from what it held before; a new op that writes a register cannot compile until it is listed here.

Source

pub fn for_each_read_reg( &self, captures: impl Fn(u16) -> usize, f: impl FnMut(Reg), )

Every register this op READS — EXHAUSTIVE and over-approximate: every range operand is expanded, and a Reg::MAX “no object” sentinel is skipped. A MakeClosure snapshots captures(func) locals from locals_start; a caller without the program passes an upper bound, which only reads more.

Source

pub fn all_variants() -> Vec<Op>

One instance of EVERY VM bytecode op — the full instruction catalog of the language. Catalog locks iterate this to COUNT coverage/classification. (name, WASM-AOT op_support, and reversibility are exhaustive matches, so the compiler already forbids a new op from escaping classification; this enumeration is what lets a lock count the ISA.)

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Op

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Op

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,