Five-stage distribution pipeline
One dependency chain, five explicit ownership boundaries
Stage0Cross SDK toolchain initialization
Builds binutils, patched GCC, and musl for x86_64-akadata-linux-musl, then passes an explicit acceptance gate.
Stage1Bootstrap rootfs generation
Creates the first musl rootfs from the glibc host while retaining builder ownership of source and build trees.
Stage2Native final system and GRUB
Builds the native final rootfs, validates the non-usrmerged FHS layout, and prepares native boot capability.
Stage3Bootable image assembly
Assembles and validates the base qcow2 image without turning the image step into a package build.
Stage4Managed server packages
Builds the Akadata APK repository and a derived server image containing packages such as Nginx, PHP-FPM, Python 3.14.6, OpenSSH, curl, and Vim.
Optional compiler policy
GCC 52cd026 generic branch-cost backport
Akadata can optionally build GCC 16.1 with the pinned backport of upstream commit 52cd02606b906160bf47001a00b446c35d46f15f. The patch changes one x86 generic-tuning value in gcc/config/i386/x86-tune-costs.h: the branch-misprediction scale increases from COSTS_N_INSNS (2) to COSTS_N_INSNS (2) + 3.
The higher modelled cost gives GCC more reason to avoid a conditional branch when its optimizers determine that a safe branchless transformation is cheaper. Depending on the code and optimization pass, that may mean conditional moves, arithmetic or other straight-line forms. It does not force cmov, remove every branch, or change processor hardware.
Potential benefit
Reduce misprediction-sensitive stalls
Branch-heavy hot paths with unpredictable conditions may benefit because a misprediction can discard speculative work and refill the pipeline. A possible 10–20% gain is a benchmark target for favourable workloads, not a measured distribution-wide guarantee. Some programs may improve less, remain unchanged, or regress.
Controlled experiment
Off by default and fully fingerprinted
The setting defaults to off. Its state and the patch SHA-256 are compile-policy inputs, so changing the toggle invalidates SDK through Stage4 evidence instead of mixing binaries produced under different compiler policies.
How the policy reaches the distribution
SDK construction applies the patch to a disposable generated GCC source tree and leaves the pristine GCC 16.1 source untouched. Stage1 applies and verifies the same policy in its native GCC. That native compiler then carries the selected cost model into downstream Stage2 and Stage4 compilation. Manifests record the enabled state, commit, and patch digest.
./build.sh settings show
./build.sh settings set gcc-branch-cost on
./build.sh rebuild all
# Return to the upstream GCC 16.1 cost model:
./build.sh settings set gcc-branch-cost off
./build.sh rebuild allUse matched on/off images, identical inputs, repeated measurements, hardware performance counters, and workload-specific latency and throughput data before publishing a performance result. Enabling the option requires ./build.sh rebuild all; a partial build would not be valid comparison evidence.
Deterministic Stage4 order
25 units from bootstrap APK to Vim
The generated order is numbered 00 through 24. It is derived from the acyclic dependency graph rather than maintained as a marketing-friendly shorter list.
- 00
apk-bootstrap-static - 01
akadata-base-abi - 02
akadata-baselayout - 03
zlib - 04
zlib-dev - 05
openssl - 06
openssl-dev - 07
ca-certificates - 08
libcap - 09
libcap-dev - 10
libmnl - 11
libmnl-dev - 12
ncurses - 13
ncurses-dev - 14
python3 - 15
ninja - 16
meson - 17
apk-tools - 18
iproute2 - 19
iputils - 20
dhcpcd - 21
openssh-client - 22
openssh-server - 23
curl - 24
vim
The private bootstrap stays private
The disposable APK bootstrap builds its own zlib, OpenSSL, Python, Ninja, Meson, and static apk under build/stage4/work/apk-bootstrap. Its payload is neither copied into the deployment rootfs nor emitted as an Akadata package.
Package recipes then build in the derived Stage4 rootfs with sources mounted read-only and writable work directories mounted separately.