# workgroup.queue_fifo
`workgroup.queue_fifo` is a Category C primitive for a bounded FIFO queue in
workgroup SRAM. It exposes `enqueue(value)`, `dequeue()`, `len()`, and
`is_empty()` against a queue handle and `u32` payloads.
The WGSL lowering uses shared ring-buffer storage with atomic `head`, `tail`,
and `len` words. Enqueue reserves tail positions with `atomicAdd`, so
multi-producer lanes receive a linearized insertion order even when they issue
commands in the same workgroup pass.
Algebraic laws:
- `QueueFifoTotalOrderPreserving`: successful dequeues return values in the
total order established by successful enqueues.
- `QueueEnqueueThenDequeueIdentityWhenEmpty`: enqueueing `x` into an empty
queue and then dequeueing returns `x` and restores emptiness.
- `BoundedCapacity`: enqueue beyond capacity returns overflow without removing
or overwriting the oldest live value.