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_ MISS Deprecated - 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]]intocontrol[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.