Verba/Rapida

Experiments #161

The reserved-token suppression in `applySuppressMask` (`src/generate.zig:574` at best-2026-11-12-r147)...

done

What was tested

The reserved-token suppression in `applySuppressMask` (`src/generate.zig:574` at best-2026-11-12-r147) masks with a float32 `-inf` 0-d array, so `where` widens the `[.., 262144]` logits row to float32 before the argmax; its sibling `verifyArgmax` (`generate.zig:622`) already casts through `scalarLike`. Fix: the same `scalarLike` swap; lossless (bf16 to float32 is exact and the argmax reads the same order, so a bit-identity check of the decides)

Model and setup

the best

Expected gain

sized from bytes, inferred: about 0.5 MB written and 0.5 MB read extra per row, about 4 us at 273 GB/s, under 0.1% of a 10.5 ms step; reached on batched (`sampleRowsLazy`, 2 or more users), on draws the head tail does not take and with penalties or logprobs; not on the 1-user greedy step, which takes `headTailTakeToken` first (`generate.zig:2496`)

Where the idea came from

coordinator's float32 sibling check of row 153d step 2b, 2026-11-13 (`2026-11-13-mac-lesto-drafter/README.md` ยง Row 153d step 2b result)

Outcome

done 2026-11-27: landed through the stack, never scored alone; LESTO dd56693 (2026-11-13) builds the suppress mask's -inf in the logits' own dtype where an argmax follows (`applySuppressMaskFor`, `src/generate.zig:702-712` at d1158e56, on by default, `MLX_SERVE_SUPPRESS_MASK_NATIVE_DTYPE_OFF=1` turns it off), in every best tag since best-2026-11-19-r172; sampling, probs and residual callers keep the float32 row ( on 3a437610); closed by the coordinator (read-rows)

Want to see what these experiments produced? Lesto, the Gemma 4 inference engine for Apple silicon Macs, is on lestoengine.com

Made by Federico Andrioli, @fedeandri on X A research lab's own measurements, generated from its files. Data built