About this project
Microfat is a Go-based toolchain for building and running "fat" Linux executables that bundle several CPU microarchitecture-specific builds of the same program. At runtime the launcher probes the host CPU for instruction-set extensions (AVX2, FMA, BMI2, AVX-512, SVE, SVE2) and picks a compatible variant according to a configurable policy.
How it works: variants are compiled with Go microarchitecture targets (GOAMD64=v1/v3/v4, GOARM64=v8.0–v9.5) and combined by the `microfat pack` command together with a launcher stub. Dispatch uses Linux memfd_create plus syscall.Exec, so the payload runs from anonymous RAM without a persistent wrapper process; a verified disk cache is available as a fallback. A 56-byte trailer stores a SHA-256 index hash and per-variant checksums for payload integrity verification. Multi-variant compression uses trained Zstandard dictionaries, with latency/balanced/size profiles.
Container tuning: the launcher parses cgroup v1 and v2 limits and sets a soft Go memory budget (GOMEMLIMIT) and CPU parallelism (GOMAXPROCS), unless the user already set them. A standalone `runtimeinit` package offers the same tuning for Go services without the fat-binary wrapper, including a zero-code blank-import autoload and a dry-run mode.
Lifecycle modes: a universal fat binary, a trimmed fat binary that drops unneeded variants while keeping auto-tuning, and a raw native ELF mode that permanently specializes to uncompressed machine code. Runtime meta-commands include --microfat:info, prewarm, trim, trim-to, optimize and optimize-to. Environment variables control autotuning, memory ratio, GC profile, forced/capped variant levels, AVX-512 downclock protection, execution mode and cache directory.
Diagnostics: `microfat detect` reports the host microarchitecture level, and `microfat doctor` (with --json) checks CPU features, memfd support, cache permissions and cgroup limits. Packaging can also be driven by a declarative PGO manifest (`microfat pgo-pack`) or GoReleaser matrix builds. The project is Apache 2.0 licensed and documents its architecture, CLI, benchmarks and troubleshooting under docs/.
Comments
0 people shared their preference · Deer Point appears after 10 participants
Sign in to join the discussion.