Last updated: 2026-06-05

Decode Planning

Op

All API Sections

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 0 methods src/zinc_rt/ir/op.zig

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).

src/zinc_rt/ir/op.zig:11

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.

src/zinc_rt/ir/op.zig:20

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`.

src/zinc_rt/ir/op.zig:31

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.

src/zinc_rt/ir/op.zig:65

function

info

#
pub fn info(opcode: Opcode) Info

Look up the static metadata record for an opcode.

never traps at runtime.

Parameters

opcode
IR opcode to describe.

Returns

The matching `Info` entry; the switch is exhaustive so this

src/zinc_rt/ir/op.zig:75

function

name

#
pub fn name(opcode: Opcode) []const u8

Canonical printable name for an opcode (e.g.

`"FLASH_ATTN"`).

Parameters

opcode
IR opcode to name.

Returns

The `Info.name` string, suitable for logging and golden traces.

src/zinc_rt/ir/op.zig:111

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`.

Parameters

value
Candidate opcode spelling.

Returns

The matching opcode, or `null` when no variant matches.

src/zinc_rt/ir/op.zig:121

function

isM0

#
pub fn isM0(opcode: Opcode) bool

Check whether an opcode is part of the M0 minimum-viable decode set.

Parameters

opcode
IR opcode to query.

Returns

`true` when `info(opcode).milestone == .m0`.

src/zinc_rt/ir/op.zig:134