Last updated: 2026-07-19
Inference Runtime
Engine
ZINC_RT — the ZINC Runtime.
Owns tier selection and the top-level runtime handle used by future IR emitters and ring backends.
9 exports shown
enum
Tier
pub const Tier = enum Execution tier the engine will dispatch through.
`t1_pm4` and `t2_umq` are the two direct AMDGPU paths; `t_cpu` is the reference scalar fallback; `t_metal`, `t_intel`, and `t_cuda` are reserved for the corresponding native backends.
struct
Options
pub const Options = struct Caller-supplied configuration for `Engine.init`.
Currently just the desired tier; future fields (worker counts, ring depths, telemetry hooks) live here.
struct
Capabilities
pub const Capabilities = struct Runtime capability bits surfaced to harnesses and server integration code.
The batch planner is present, but continuous batched model execution is not wired into `forward_zinc_rt` yet.
constant
supports_multitenant_batch_planning
pub const supports_multitenant_batch_planning = true True when ZINC_RT can plan multitenant batches.
constant
supports_multitenant_batched_execution
pub const supports_multitenant_batched_execution = false True only when ZINC_RT can execute multiple tenants in one continuous inference loop.
This remains false until M3 wires the planner into `forward_zinc_rt` and the server runtime.
struct
Engine
pub const Engine = struct Top-level runtime handle.
Owns the allocator the engine was built with and the selected tier; future revisions will also own the ring backend.
Methods
3method
Engine.init
pub fn init(allocator: std.mem.Allocator, options: Options) !Engine Construct an engine pinned to the requested tier.
method
Engine.deinit
pub fn deinit(self: *Engine) void Release any engine-owned state and poison the handle.
Safe to call once per successful `init`.
method
Engine.capabilities
pub fn capabilities(self: *const Engine) Capabilities Return static runtime capability bits for the selected build.
function
parseTier
pub fn parseTier(value: []const u8) !Tier Parse a textual tier identifier (e.g.
from `ZINC_RT_TIER` or a CLI flag) into a `Tier`. Accepts both short (`t1`, `t2`) and canonical (`t1_pm4`, `t2_umq`) names; `auto` defers to `autoTier`. not a recognised name.
function
tierFromEnv
pub fn tierFromEnv() !Tier Read `ZINC_RT_TIER` and parse it, falling back to `autoTier` when unset.
function
autoTier
pub fn autoTier() Tier Probe the host for direct-execution paths and return the best available tier.
Tries T2 UMQ first (the blessed AMDGPU user-queue path), falls back to T1 PM4 over `/dev/kfd` when UMQ admission is refused, and finally to the scalar CPU reference. so T2 admission usually fails and we end up on T1 PM4.