Verba/Rapida

Experiments #148g

Why row 148f's kept-row grammar draw is slower than the full-row path: LESTO `probe/148g` (row/148f plus...

done

What was tested

Why row 148f's kept-row grammar draw is slower than the full-row path: LESTO `/148g` (row/148f plus the step trace `LESTO_P148G_TRACE`, with the grammar and its CPU compact mask timed apart), against the best on 10 sessions, head-tail arm `lesto_p148g` and full-row arm `lesto_p148goff` (`MLX_SERVE_GRAMMAR_HEAD_TAIL_OFF=1`) of the same build; then the fix it points to (the compact mask and the dropped-id search moved onto the , or off the critical path)

Model and setup

the best (constrained requests)

Expected gain

diagnostic; decides row 148f's fix, prerequisite of 148b

Where the idea came from

row 148f

Outcome

done 2026-11-13: both constrained arms wait a whole forward (9.4 to 9.6 ms) on their token and add 2.4 to 2.6 ms of CPU in series (steps 12.18 kept-row, 11.75 full-row, best 10.6): MLX signals one event per async_eval and the draw is evaluated with the next forward (`transforms.cpp:244-251`); hands the split to row 148h

Lesson

in Lesto a token that depends on CPU input must be evaluated on its own before the next forward, because MLX signals one event per `async_eval`: evaluated together, waiting on the token waits for the whole forward, and the step's 2.5 ms of CPU work then runs with the GPU idle (12.2 ms steps against the best's 10.6).

Adopted

no (a diagnostic)

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