metaltest

command
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: EUPL-1.2 Imports: 7 Imported by: 0

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:

  1. correctness — compile MSL, dispatch, mutate a buffer, read it back;
  2. throughput — serial commit+wait (GPU held-but-idle) vs batched (GPU fed);
  3. 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;
  4. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL