code wiki / _hdl_build / nx_kernel_adoption.nx
nx_kernel_adoption.nx
buildroot/runtime/_hdl_build/nx_kernel_adoption.nx
about
nx_kernel_adoption.nx -- THE SECOND AXIS: does the feature actually RUN in the live boot?
WHY (a measured ruler defect, debt idx 2071): nx_kernel_census computes PRESENT with re_has()
substring probes over the CONCATENATED gate logs. A feature proven ONCE by a standalone
fixture binary therefore scores IDENTICALLY to a feature wired into the image the pinned
BOOTSOV actually boots. Measured 2026-07-31: the census read 382 permil BEFORE and 382 permil
AFTER the live boot went from a 72-byte banner exercising ZERO features to a 1480-byte kernel
exercising ELEVEN of its eighteen -- the ruler scored the adoption gap as exactly zero movement.
A RULER THAT CANNOT DISTINGUISH PROVEN-IN-ISOLATION FROM WIRED-AT-THE-CHOKEPOINT WILL ALWAYS
SCORE THE ADOPTION GAP AS ZERO, and this census is the instrument meant to catch it.
WHAT THIS DOES: boots the LIVE image in-process (the artifact itself, not a log ABOUT it),
captures the serial transcript, and scores every incumbent feature on TWO axes --
evidence : re_has() over the gate logs (what the census already measured)
live : its marker appears in the transcript (what the census could not see)
Headline = MIN(evidence, live), never the mean and never the max, per the min-not-mean law.
ADOPTION GAP = features with evidence but NOT live -- the number the census could not report.
Data-driven: the feature->marker table is knowledge/registry/kernel_live_markers.tsv, never
hardcoded; a feature with no row there is NOT live, which is the honest default.
Self-validating: a positive control must be live, a synthetic marker must NOT be.
license_tier: ORIGINAL
Shared boot-and-capture: this organ, the gate and the census must agree byte-for-byte on what
booting the image means, or the rulers can disagree about the same artifact.
dependencies 2 imports · 0 importers
imports: nx_bootcap.nxnx_research_extract.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const KA_MAGIC_2000000: i64 = 2000000 |
| 27 | const KA_MAGIC_80000: i64 = 80000 |
| 28 | const KA_MAGIC_40000: i64 = 40000 |
| 29 | const KA_MAGIC_300000: i64 = 300000 |
| 31 | const KA_REF: *u8 = "knowledge/registry/kernel_incumbent_ref.tsv" |
| 32 | const KA_MARKERS: *u8 = "knowledge/registry/kernel_live_markers.tsv" |
| 33 | const KA_OUT: *u8 = "knowledge/registry/kernel_adoption.tsv" |
| 34 | const KA_LOG: *u8 = "knowledge/status/kernel_adoption.log" |
| 35 | const KA_BIN: *u8 = "runtime/_hdl_build/_boot_nishi_virt.bin" |
| 36 | const KA_BIN_ALT: *u8 = "_boot_nishi_virt.bin" |
| 37 | const KA_MAXF: i64 = 256 |
| 39 | const KA_E0: *u8 = "knowledge/status/boot_stub.log" |
| 40 | const KA_E1: *u8 = "knowledge/status/trap_syscall.log" |
| 41 | const KA_E2: *u8 = "knowledge/status/virtio_blk.log" |
| 42 | const KA_E3: *u8 = "knowledge/status/virtio_net.log" |
| 43 | const KA_E4: *u8 = "knowledge/status/hwmap.log" |
| 44 | const KA_E5: *u8 = "knowledge/status/timer_irq.log" |
| 45 | const KA_E6: *u8 = "knowledge/status/sched.log" |
| 46 | const KA_E7: *u8 = "knowledge/status/memalloc.log" |
| 47 | const KA_E8: *u8 = "knowledge/status/coopsched.log" |
| 48 | const KA_E9: *u8 = "knowledge/status/driver_spec.log" |
| 49 | const KA_E10: *u8 = "knowledge/status/driver_bind.log" |
| 50 | const KA_E11: *u8 = "knowledge/status/nndev.log" |
| 51 | const KA_E12: *u8 = "knowledge/status/mmu.log" |
| 52 | const KA_E13: *u8 = "knowledge/status/priv.log" |
| 54 | const KA_MEM_BASE: i64 = 0x80000000 |
| 55 | const KA_MEM_SIZE: i64 = 65536 |
| 56 | const KA_TX_CAP: i64 = 4096 |
| 57 | const KA_MAX_STEPS: i64 = 100000 |
functions
| 59 | func ka_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } called by 1: main |
| 60 | func ka_n(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } called by 1: main |
| 62 | func ka_read_into(path: *u8, buf: *u8, off: i64, cap: i64) -> i64 |
| 75 | func ka_scan_to(buf: *u8, n: i64, start: i64, delim: i64) -> i64 called by 1: main |
| 81 | func ka_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 87 | func ka_app(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: main |
| 91 | func ka_boot(img: *u8, ilen: i64, tx_buf: *u8) -> i64 |
| 99 | func main(argc: i64, argv: *i64) -> i64 |