The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Zero-cgo benchmark and verification example for github.com/tmc/apple/x/metalcache
(MTLBinaryArchive and Metal 4 MTL4PipelineDataSetSerializer + MTL4Archive).
What it does
Generates 16 templated MSL compute kernels (4 tile/unroll factors 1, 2, 4, 8
× 4 activations relu, gelu, silu, tanh) stamped with a fresh source nonce so
cold compilation bypasses Metal's system-wide shader cache.
Computes a cache key via metalcache.CacheKey(dev, msl, opts) (GPU name +
macOS build + MSL SHA-256 + specialization constants), compiles all 16 compute
pipelines into a metalcache.Archive, and atomically serializes the archive to
$TMPDIR.
Spawns a fresh child process (METALCACHE_BENCH_RELOAD=1, also available via
-reload-only) so Metal's in-process pipeline cache is completely cold, opens
the serialized archive, and instantiates all 16 pipelines strictly from the
archive (NewComputePipelineStrict with MTLPipelineOptionFailOnBinaryArchiveMiss).
Dispatches all 16 kernels on the GPU in both processes and verifies 16/16
bit-identical SHA-256 output digests.
Mutates the MSL source and confirms metalcache.Open automatically invalidates
the stale archive (Loaded() == false, Invalidated() == true, and strict
lookup fails with a miss).
On Metal 4 devices (metalcache.SupportsMetal4(dev)), runs the same cold
compile vs. fresh-subprocess reload comparison using
MTL4PipelineDataSetSerializer and MTL4Archive.
Usage
CGO_ENABLED=0 go run ./examples/metal/pipeline-cache-bench
CGO_ENABLED=0 go run ./examples/metal/pipeline-cache-bench -elems 131072
CGO_ENABLED=0 go test -v -count=1 ./examples/metal/pipeline-cache-bench
Live Results (Apple M4 Max, macOS 26.6.2)
Recorded on Apple M4 Max, macOS 26.6.2 (Build 25G83), Go 1.27.0
(darwin/arm64), CGO_ENABLED=0, 16 templated compute kernels, 65,536
float32 elements:
MTLBinaryArchive (x/metalcache.Archive)
Phase
Time
Notes
Cold compile (total)
1.687 s
lib=186.8 ms, 16x pipelines=1.377 s, serialize=123.0 ms
Warm fresh subprocess (total)
107.2 ms
open=1.17 ms, lib=96.9 ms, 16x strict load=9.11 ms