code wiki / _hdl_build / nx_status_map_test.nx

nx_status_map_test.nx source

↩ module page · 50 lines · 4158 B

1// nx_status_map_test.nx -- the team reports its own status + maps itself against a competitor (no 2// more black box). The MARKET RESEARCHER maps us vs llama.cpp/ggml across the top dimensions (honest: 3// behind on their core kernels, ahead on our meta/autonomy); the PROJECT MANAGER summarizes the full 4// inventory breadth (total, proven %, full bits-up stack, thinnest layer, project health). Exit 0 if 5// the honest picture holds. license_tier: ORIGINAL 6 7import "nx_capability_map.nx" 8import "nx_pm_status.nx" 9import "nx_syscalls.nx" 10 11func st_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 12func st_num(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; 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); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 } 13 14func main() -> i64 { 15 st_puts("=== STATUS + COMPETITIVE MAP: us vs llama.cpp/ggml, and our inventory breadth ===\n" as *u8) 16 // MAP us vs llama.cpp across 6 top dimensions (grade S=4 A=3 B=2, 0=none) 17 let n: i64 = 6 18 let oh: *i64 = sys_mmap(8*8) as *i64; let og: *i64 = sys_mmap(8*8) as *i64; let th: *i64 = sys_mmap(8*8) as *i64; let tg: *i64 = sys_mmap(8*8) as *i64 19 // d0 quantization d1 SIMD kernels d2 KV-cache mgmt d3 VRAM frontier model d4 autonomy/self-build d5 research+publishing 20 oh[0]=1; og[0]=3; th[0]=1; tg[0]=4 // BEHIND (their SOTA quant) 21 oh[1]=1; og[1]=3; th[1]=1; tg[1]=4 // BEHIND (their hand-tuned SIMD) 22 oh[2]=1; og[2]=3; th[2]=1; tg[2]=4 // BEHIND (PagedAttention/KIVI) 23 oh[3]=1; og[3]=3; th[3]=0; tg[3]=0 // AHEAD (our roofline/VRAM frontier tooling) 24 oh[4]=1; og[4]=3; th[4]=0; tg[4]=0 // AHEAD (self-building autonomous team) 25 oh[5]=1; og[5]=3; th[5]=0; tg[5]=0 // AHEAD (own research+publishing pipeline) 26 let sd: *i64 = sys_mmap(8*8) as *i64 27 var i: i64 = 0 28 while i < n { sd[i] = map_standing(oh[i], og[i], th[i], tg[i]); i = i + 1 } 29 let ahead: i64 = map_count(n, sd, MAP_AHEAD); let behind: i64 = map_count(n, sd, MAP_BEHIND); let net: i64 = map_net(n, sd) 30 st_puts(" [map vs llama.cpp] AHEAD=" as *u8); st_num(ahead); st_puts(" BEHIND=" as *u8); st_num(behind); st_puts(" net=" as *u8); st_num(net); st_puts(" (3=MIXED: behind on core kernels, ahead on meta/autonomy)\n" as *u8) 31 32 // PM STATUS: inventory by the 6 capability layers (counts sum to 136), 131 proven, 1 S-class 33 let lc: *i64 = sys_mmap(8*8) as *i64; lc[0]=25; lc[1]=8; lc[2]=20; lc[3]=18; lc[4]=30; lc[5]=35 34 let total: i64 = pm_total(lc, 6); let proven: i64 = 131; let sclass: i64 = 1 35 let ppct: i64 = pm_proven_permil(proven, total); let full: i64 = pm_full_stack(lc, 6); let thin: i64 = pm_thinnest_layer(lc, 6) 36 let health: i64 = pm_health(proven, total, full, sclass) 37 st_puts(" [PM status] total=" as *u8); st_num(total); st_puts(" caps proven=" as *u8); st_num(ppct); st_puts("/1000 full-stack=" as *u8); st_num(full); st_puts(" thinnest-layer=" as *u8); st_num(thin); st_puts(" project-health=" as *u8); st_num(health); st_puts("/1000\n" as *u8) 38 39 let r: *i64 = sys_mmap(8*8) as *i64 40 r[0] = 0; if sd[0] == MAP_BEHIND { if sd[4] == MAP_AHEAD { r[0] = 1 } } // honest map: behind core, ahead meta 41 r[1] = 0; if net == MAP_NET_MIXED { if ahead == 3 { if behind == 3 { r[1] = 1 } } } // 3-3 mixed 42 r[2] = 0; if total == 136 { if full == 1 { r[2] = 1 } } // full inventory, full stack 43 r[3] = 0; if ppct >= 950 { r[3] = 1 } // >=95% proven 44 r[4] = 0; if health >= 900 { r[4] = 1 } // strong project health 45 var pass: i64 = 0; var j: i64 = 0 46 while j < 5 { pass = pass + r[j]; j = j + 1 } 47 st_puts("----\n passed " as *u8); st_num(pass); st_puts("/5\n" as *u8) 48 if pass == 5 { st_puts(" VISIBLE: the team maps itself vs the market (honest mixed) + the PM reports the full breadth. No more black box.\n" as *u8); sys_exit(0); return 0 } 49 st_puts(" FAIL\n" as *u8); sys_exit(1); return 1 50}