Skip to main content

Module opcode

Module opcode 

Source
Expand description

Opcode constants and decoding utilities for megakernel slots.

Constants§

ATOMIC_ADD
atomic_add(control[args[1]], args[0]).
BATCH_FENCE
Batch fence signaling that the published batch is complete.
COMPARE_SWAP
CAS(control[args[0]], expected=args[1], desired=args[2]).
DFA_STEP
DFA single-step: next_state = dfa_table[args[0] * 256 + args[1]].
EXPERT_LOAD_MISSDeprecated
Deprecated alias retained for source-level compatibility. Will be removed once all in-tree consumers have migrated; new code must use LOAD_MISS.
LOAD_MISS
GPU-initiated load miss: the megakernel writes a DMA request to the IO queue and polls for completion. The argument is the consumer’s resource identifier (32-bit, opaque to vyre). vyre is a generic GPU substrate; it does not know what “the resource” is - that is the consumer’s domain. See the boundary rule in AGENTS.md.
LOAD_U32
Read control[args[0]] into control[OBSERVABLE_BASE + args[1]].
MEMCPY
Bulk GPU-to-GPU copy within the control buffer.
NOP
Do nothing. Useful for heartbeat probes.
PACKED_SLOT
Packed slot: one outer ring slot carries several inner ops.
PRINTF
Write one PRINTF event to the debug log.
RESERVED_MAX_RANGE_MIN
Lower bound for the high reserved range.
SHUTDOWN
Set control[SHUTDOWN] = 1.
STORE_U32
control[args[1]] = args[0].
SYSTEM_MASK
High bit is reserved for system opcodes.

Functions§

is_builtin
Return true if the opcode is one of the frozen built-in opcodes.
is_system
Return true if the opcode is reserved by the megakernel.
validate_publish_opcode
Validate an opcode that is about to be written to the ring.
validate_user_opcode
Validate a user-defined opcode.