Documentation
¶
Rendered for darwin/amd64
Overview ¶
metaltest — smallest pure-Go Metal compute proof: no cgo, no shell-out, drive a kernel + mutate a buffer through tmc/apple/metal (purego objc_msgSend). Doubles a buffer on the GPU and reads it back. The point isn't the math — it's that Go owns the Metal command path directly.
Three things this proves, in order:
- correctness — compile MSL, dispatch, mutate a buffer, read it back;
- throughput — serial commit+wait (GPU held-but-idle) vs batched (GPU fed);
- encode-bypass — re-encoding a fixed command sequence every step (MLX's ~68 ms/step host cost) vs recording it ONCE into an Indirect Command Buffer and replaying — the decode/diffusion lever, in pure Go;
- kernel reach — our real 150 MB mlx.metallib loads + enumerates through the same no-cgo path: the foundation for keeping the kernels and dropping mlx-c.
Click to show internal directories.
Click to hide internal directories.