Verba/Rapida

Experiments #173kc

The end-of-turn `mlx_clear_cache` the socket waits on (row 173ks: 3.0 ms a request): finishSlot clears...

done

What was tested

The end-of-turn `mlx_clear_cache` the socket waits on (row 173ks: 3.0 ms a request): finishSlot clears MLX's buffer pool after the terminator (`src/scheduler.zig:4725`) and `complete()` (`src/server.zig:7639`) waits for that pass before the socket closes. Step 1: its time against the pool's size per request; the fix moves the clear off the socket's wait or skips it while the pool is small (issue #110's footprint ratchet must stay fixed), then its own pair

Model and setup

the scheduler

Expected gain

up to 3.0 ms a request, about 0.22% of the replay's window (inferred)

Where the idea came from

row 173ks

Outcome

done 2026-11-20 20:07 (engine-rows): the clear costs 3.0 and 3.4 ms a request on both sets, 1.3 to 1.7 ms a GiB of pool; small pools under 1 ms, so only the move; fix row 173kd (`2026-11-20-mac-r173kt-trim-copy/README.md` ยง Result, rows 173kt and 173kc step 1)

Lesson

the end-of-turn `mlx_clear_cache` that the socket's close waits on costs 3.0 to 3.4 ms a request on both text sets, rising about 1.3 to 1.7 ms a GiB of pooled buffers; clears of small pools cost under 1 ms, so moving the clear off the wait is the lever, not skipping it.

Adopted

no (diagnostics; their fix rows are queued as rows 173km, 173kv and 173kd).

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