code wiki / _hdl_build / nx_spore_min_test.nx

nx_spore_min_test.nx

buildroot/runtime/_hdl_build/nx_spore_min_test.nx

3598 B68 linesdepth 1pulls 1 transitivereach 0 importersview sourcekind gate/prooftopic spore
docsdependenciesstructsconstsfunctions

about

nx_spore_min_test.nx -- the minimal SPORE, and it MEASURES ITS OWN footprint. The spore is the tiniest viable bootstrap: it carries just the trust core it needs to safely pull + verify the first seed pieces (the FNV-1a piece hash = germination integrity), and nothing else. Because a NishiLang binary is a STATIC, libc-FREE, OS-runtime-FREE ELF -- just machine code + raw syscalls -- the spore is KILOBYTES, not the megabytes a runtime-dependent stack needs. THIS is what makes "a USB drive as a proper computer" real: the bootstrap owes nothing to a host OS/runtime. The spore reads its OWN ELF size (/proc/self/exe, lseek SEEK_END) -- sovereign self-awareness of its footprint -- and gates that it stays under budget. Known answer: prints "spore=<bytes>" and exit 0 iff the trust core works AND the footprint is tiny (< 16 KB).

dependencies 1 imports · 0 importers

nx_spore_syscalls.nx nx_spore_min_test.nx

imports: nx_spore_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sp_hash sp_slen sys_exit sys_openat_rd sys_lseek sys_close _emit sys_write sys_mmap sys_write ↻

structs

none

consts

22const SPORE_BUDGET: i64 = 12288 // 12 KB ceiling on the bootstrap
23const FNV_OFFSET: i64 = 0 - 3750763034362895579 // 0xcbf29ce484222325
24const FNV_PRIME: i64 = 1099511628211 // 0x100000001b3
25const SEEK_END: i64 = 2

functions

27func sp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
28func sp_hash(s: *u8, len: i64) -> i64
called by 1: main
34func _emit(name: *u8, v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
44func main() -> i64