Context
A 2026-05-01 audit of the home-os kernel (404 modules) found that 148 of 170 typecheck failures are the same diagnostic:
error: use of possibly uninitialized variabletriggered on reads of module-scope mutable globals like:
var pci_buses: [256]PciBus
var keyboard_state: [128]u8
var process_table: [MAX_PROCS]ProcessThese are kernel BSS-section globals — implicitly zero-initialized by the kernel image at boot. The current typechecker treats them as possibly uninitialized and rejects every read.
Impact
This single rule blocks ~150 kernel modules in home-os from typechecking. Includes load-bearing files: core/foundation.home, core/memory.home, core/process.home, core/filesystem.home, the entire core/vfs_* family, mm/mm_integration.home, sched/scheduler.home, sys/signal.home, net/socket.home, net/tcp.home, net/udp.home, boot/initramfs.home, most of arch/arm64/.
Proposal
Two reasonable directions:
- Teach the checker about BSS zero-init. Module-scope
var x: Tfor anyTwhose layout permits zero-initialization (POD types, fixed-size arrays of POD, structs of POD) should be considered initialized at first read. Behind--kernelor always, depending on what fits the language model. - Require an explicit zero-init expression. Force
var x: [N]u64 = .{0} ** N(or similar) and migrate. Keeps the checker simple but adds source noise to every kernel global.
(1) is the lower-friction option for kernel work. (2) is closer to Zig's philosophy.
Audit data
- TSV with the full per-module breakdown is at
~/Desktop/home-os-kernel-audit-2026-05-01.tsvon the maintainer's machine - Caveat: `home check` is non-transitive in the audit — module-local OK status doesn't include imports
- Ran against `home-debug` built from `zig build debug` on macOS arm64
Why this matters
The home-os kernel cannot meaningfully be built end-to-end today; this is one of the two highest-leverage items in the audit (the other is `home build`'s lack of a freestanding target — separate issue).