Expand description
Ring-buffer protocol constants - slot layout, control words, opcodes, debug log.
Pure data module. No logic, no imports beyond std. Every constant has a doc-comment that says what the GPU kernel does with it.
Modules§
- control
- Control-buffer slot layout helpers.
- debug
- Debug helpers for inspecting megakernel slot/opcode state at runtime.
- opcode
- Opcode constants and decoding utilities for megakernel slots.
- slot
- Slot layout helpers (per-slot offsets, ARG0 helpers).
Structs§
- Debug
Record - A single PRINTF event decoded out of the debug-log buffer.
Enums§
- Protocol
Error - Megakernel host-protocol encoding and decoding error.
Constants§
- ARG0_
WORD - First argument word. Opcodes read args at
ring_buffer[slot_base + ARG0_WORD .. slot_base + SLOT_WORDS]. - ARGS_
PER_ SLOT - Number of u32 argument words available per slot (12).
- CONTROL_
MIN_ WORDS - Minimum control-buffer words required by the compiled megakernel ABI.
- MAX_
DEBUG_ RECORDS - Maximum debug-log records whose byte length is representable by the u32 wire ABI.
- MAX_
ENCODED_ DEBUG_ RECORDS - Maximum debug-log records the allocating encoder will materialize.
- MAX_
ENCODED_ OBSERVABLE_ SLOTS - Maximum host-observable words the allocating encoder will materialize.
- MAX_
ENCODED_ RING_ SLOTS - Maximum ring slots the allocating encoder will materialize.
- MAX_
OBSERVABLE_ SLOTS - Maximum host-observable words whose control-buffer byte length is representable by the u32 wire ABI.
- MAX_
RING_ SLOTS - Maximum ring slots whose byte length is representable by the u32 wire ABI.
- OPCODE_
WORD - Word index of the slot opcode (dispatched via If-tree).
- PRIORITY_
WORD - Word index of the slot priority level.
- SLOT_
WORDS - Number of u32 words each ring-buffer slot occupies. 16 words = 64 B,
a cache line on x86_64 and the slot size NVMe Submission Queue
Entries will use when the
uring-cmd-nvmeextension lands. - STATUS_
WORD - Word index of the slot status header (the CAS target).
- TENANT_
WORD - Word index of the slot tenant id.
Functions§
- control_
byte_ len - Return the number of bytes required by a control buffer with
observable_slots. - count_
done_ ring_ slots - Count DONE slots in a ring-buffer readback.
- debug_
log_ byte_ len - Return the number of bytes required by a debug-log buffer.
- decode_
expert_ miss Deprecated - Deprecated alias for
decode_load_miss; seeencode_expert_miss. - decode_
load_ miss - Decode a load-miss slot from ring-buffer bytes.
- encode_
control - Encode a control-buffer payload.
- encode_
empty_ debug_ log - Encode an empty PRINTF channel buffer.
- encode_
empty_ ring - Encode an empty ring buffer with
slot_countslots. - encode_
expert_ miss Deprecated - Deprecated alias for
encode_load_miss. The old MoE-specific parameter name was a boundary violation - vyre is a generic GPU substrate. New code must useencode_load_miss; this shim will be removed once consumers have migrated. - encode_
load_ miss - Encode a single ring-buffer slot for a load-miss request.
- read_
debug_ log - Decode PRINTF records out of the debug-log buffer.
- read_
debug_ log_ into - Decode PRINTF records into caller-owned storage.
- read_
done_ count - Decode the kernel’s
done_countfrom a control buffer. - read_
epoch - Read the epoch counter from a control buffer.
- read_
metrics - Read per-opcode metrics counters from a control buffer.
- read_
metrics_ into - Read per-opcode metrics counters into caller-owned storage.
- read_
observable - Read an observable result word from a control buffer.
- ring_
byte_ len - Return the number of bytes required by a ring buffer with
slot_countslots. - try_
count_ done_ ring_ slots - Strictly count DONE slots in a ring-buffer readback.
- try_
encode_ control - Strictly encode a control-buffer payload.
- try_
encode_ control_ into - Strictly encode a control-buffer payload into caller-owned storage.
- try_
encode_ empty_ debug_ log - Strictly encode an empty PRINTF channel buffer.
- try_
encode_ empty_ debug_ log_ into - Strictly encode an empty PRINTF channel buffer into caller-owned storage.
- try_
encode_ empty_ ring - Strictly encode an empty ring buffer with
slot_countslots. - try_
encode_ empty_ ring_ into - Strictly encode an empty ring buffer into caller-owned storage.
- try_
encode_ load_ miss - Strictly encode a single ring-buffer slot for a load-miss request.
- try_
encode_ load_ miss_ into - Strictly encode a load-miss slot into caller-owned storage.
- try_
read_ debug_ log - Strictly decode PRINTF records out of the debug-log buffer.
- try_
read_ debug_ log_ into - Strictly decode PRINTF records into caller-owned storage.
- try_
read_ done_ count - Strictly decode the kernel’s
done_countfrom a control buffer. - try_
read_ epoch - Strictly decode the epoch counter from a control buffer.
- try_
read_ metrics - Strictly read per-opcode metrics counters from a control buffer.
- try_
read_ metrics_ into - Strictly read per-opcode metrics counters into caller-owned storage.
- try_
read_ observable - Strictly read an observable result word from a control buffer.
- try_
slot_ byte_ len - Return the byte length of one ring-buffer slot.
- try_
slot_ word_ base - Return the first word index for
slot. - try_
slot_ word_ index - Return the absolute ring word index for a slot-local word.
- try_
word_ index - Convert a protocol-local word index into a host index.