Last updated: 2026-06-12
Inference Runtime
Packet List
Dynamic packet list for building per-token decode sequences.
T-CPU forward passes use this to accumulate packets before submitting them to the CPU ring for execution.
1 exports shown
struct
PacketList
pub const PacketList = struct Growable buffer used to assemble a `PacketBatch` for one decode step.
Lowering code pushes packets in execution order, interleaves explicit `barrier` entries between dependent dispatches, and then publishes the resulting slice via `slice()` to whichever ring will run the batch.
Methods
7method
PacketList.init
pub fn init(allocator: std.mem.Allocator) PacketList Create an empty list bound to the given allocator.
outlive the list.
method
PacketList.deinit
pub fn deinit(self: *PacketList) void Release the backing storage and poison `self` for use-after-free debug.
method
PacketList.append
pub fn append(self: *PacketList, packet: ring.Packet) !void Push a payload-bearing packet (embed, rms_norm, lm_head, etc.) onto the end of the list.
method
PacketList.appendBarrier
pub fn appendBarrier(self: *PacketList) !void Append a `.barrier` marker that forces the ring to drain prior packets before continuing.
buffer (for example, between attention output and the next RMSNorm).
method
PacketList.slice
pub fn slice(self: *const PacketList) []const ring.Packet Borrowed view of the current packet sequence.
method
PacketList.len
pub fn len(self: *const PacketList) usize Number of packets currently queued, including any barriers.
method
PacketList.clear
pub fn clear(self: *PacketList) void Drop all queued packets while keeping the allocated capacity, so the list can be reused for the next decode step without re-allocating.