Verba/Rapida

Experiments #138

No commit of an empty command buffer: `gpu::finalize` skips a buffer with no work and no events, MLX's...

done

What was tested

No commit of an empty command buffer: `gpu::finalize` skips a buffer with no work and no events, MLX's throttle otherwise submits 21 and 52 empty ones per step (`transforms.cpp:279-288`), lossless

Model and setup

the best

Expected gain

at most +0.08 ms at 1k and +0.22 ms at 8k (kb118's hollow stream, 1.9% of the 8k step); less on a real step, and row 130 removes commits too

Where the idea came from

none

Outcome

done 2026-11-11: , -0.01% [-0.08, +0.02] against a 0.03% floor, 150 of 150 replies identical, 6.4 empty buffers a step skipped; the empties sit right before the throttle's wait on the , so they cost nothing on a real step (`2026-11-11-mac-empty-commits/README.md`)

Lesson

removing host work that sits right before a blocking wait on a backlogged GPU gains nothing, even when it fires 6 to 9 times a step: a hollow-stream price measures the work on the critical path only when the GPU has nothing queued, so read what the CPU does next before pricing a host saving from a microbenchmark.

Adopted

no (no gain; lossless and live, but not , since it adds code for no measured effect)

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