Last updated: 2026-06-05
Decode Planning
Op
ZINC_RT IR opcode definitions.
This table mirrors Appendix B of the design and gives each opcode stable metadata for verification, lowering, and T-CPU dispatch.
8 exports shown
enum
Stage
pub const Stage = enum Which inference stage an opcode participates in.
`decode` ops run during single-token autoregressive steps, `prefill` ops run during the batched prompt-ingestion phase, and `both` ops are shared between the two paths (e.g. RMS norm, RoPE).
enum
Milestone
pub const Milestone = enum Roadmap milestone in which the opcode becomes mandatory.
`m0` is the minimum viable decode set; later milestones add fused kernels, prefill batching, request-state I/O, and verification ops.
enum
Opcode
pub const Opcode = enum(u8) ZINC_RT IR opcode table.
Each variant maps onto Appendix B of the runtime design; metadata such as the human-readable name, stage, and milestone live in `info`.
struct
Info
pub const Info = struct Static metadata for an opcode.
Pairs the IR enum with its canonical printable name, the stage it targets, and the milestone in which it must be implemented.
function
info
pub fn info(opcode: Opcode) Info Look up the static metadata record for an opcode.
never traps at runtime.
function
name
pub fn name(opcode: Opcode) []const u8 Canonical printable name for an opcode (e.g.
`"FLASH_ATTN"`).
function
fromName
pub fn fromName(value: []const u8) ?Opcode Parse an opcode from its canonical name or Zig identifier.
Accepts either the printable `Info.name` (case-sensitive) or the Zig enum field name (case-insensitive), so both `"FLASH_ATTN"` and `"flash_attn"` resolve to `Opcode.flash_attn`.
function
isM0
pub fn isM0(opcode: Opcode) bool Check whether an opcode is part of the M0 minimum-viable decode set.