code wiki / _hdl_build / _genealogy_chart.nx

_genealogy_chart.nx source

↩ module page · 55 lines · 3593 B

1// _genealogy_chart.nx -- FIRST VIEW of the Nishi Visualization Suite (VIZ-SIL-R1 proof). 2// Renders the BOOTSTRAP GENEALOGY (god -> adam -> descent) as a native, VALID, sovereign 3// SVG genealogy chart -- no mermaid.js, no d3.js, no canvas. Emits via DIRECT sys_write 4// (sidesteps nx_render_svg's print-buffer reordering bug, filed VIZ-RENDER-FIX). Writes the 5// .svg file itself (no stdout/build-line pollution). The #1 broken link (nx_cc_equiv_gate 6// uses GNU as+ld) is flagged RED. license_tier: ORIGINAL 7import "nx_syscalls.nx" 8 9func gw(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 } 10func gwn(fd: i64, v: i64) -> i64 { 11 let bb: *u8 = sys_mmap(28); var m: i64 = v 12 if m < 0 { m = 0 - m; sys_write(fd, "-" as *u8, 1) } 13 let t: *u8 = sys_mmap(28); var k: i64 = 0 14 if m == 0 { t[0] = 48 as u8; k = 1 } 15 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 16 var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } 17 sys_write(fd, bb, k); return 0 18} 19 20// one rung of the descent ladder: rounded rect (green=sovereign / red=broken) + white label + arrow to next. 21func grung(fd: i64, idx: i64, label: *u8, broken: i64, last: i64) -> i64 { 22 let y: i64 = 64 + idx * 64 23 gw(fd, "<rect x=\"110\" y=\"" as *u8); gwn(fd, y); gw(fd, "\" width=\"430\" height=\"36\" rx=\"6\" fill=\"" as *u8) 24 if broken == 1 { gw(fd, "#b71c1c" as *u8) } else { gw(fd, "#1b5e20" as *u8) } 25 gw(fd, "\" stroke=\"#30363d\"/>\n" as *u8) 26 gw(fd, "<text x=\"124\" y=\"" as *u8); gwn(fd, y + 23); gw(fd, "\" font-family=\"monospace\" font-size=\"14\" fill=\"#ffffff\">" as *u8); gw(fd, label); gw(fd, "</text>\n" as *u8) 27 if last == 0 { 28 gw(fd, "<line x1=\"325\" y1=\"" as *u8); gwn(fd, y + 36); gw(fd, "\" x2=\"325\" y2=\"" as *u8); gwn(fd, y + 64); gw(fd, "\" stroke=\"#8b949e\" stroke-width=\"2\"/>\n" as *u8) 29 } 30 return 0 31} 32 33func main() -> i64 { 34 let path: *u8 = "knowledge/ai_wiki/genealogy_chart.svg" as *u8 35 __syscall(263, AT_FDCWD, path as i64, 0, 0, 0, 0) // unlinkat: fresh write, no leftover bytes 36 let fd: i64 = sys_openat_wr(path, 0x1a4) 37 if fd < 0 { sys_exit(1); return 1 } 38 gw(fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" as *u8) 39 gw(fd, "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"660\" height=\"720\" viewBox=\"0 0 660 720\">\n" as *u8) 40 gw(fd, "<rect width=\"660\" height=\"720\" fill=\"#0d1117\"/>\n" as *u8) 41 gw(fd, "<text x=\"110\" y=\"36\" font-family=\"monospace\" font-size=\"15\" fill=\"#e6edf3\">NISHI BOOTSTRAP GENEALOGY : god to adam to descent (native sovereign SVG)</text>\n" as *u8) 42 grung(fd, 0, "GENESIS (god): rv64im_min_sim -- the ISA spec" as *u8, 0, 0) 43 grung(fd, 1, "nxasm_x86_main -- the assembler/linker" as *u8, 0, 0) 44 grung(fd, 2, "nx_cc_sovereign -- the self-hosted compiler" as *u8, 0, 0) 45 grung(fd, 3, "ADAM: self-host fixpoint gen2 == gen3" as *u8, 0, 0) 46 grung(fd, 4, "nx_cc_equiv_gate -- BROKEN LINK: uses GNU as+ld" as *u8, 1, 0) 47 grung(fd, 5, "nx_sov_build_run -- the local build engine" as *u8, 0, 0) 48 grung(fd, 6, "nx_syscalls + module registry + shared prims" as *u8, 0, 0) 49 grung(fd, 7, "organs + the K-rung hardware ladder" as *u8, 0, 0) 50 grung(fd, 8, "apps + every hardware climate (one genome)" as *u8, 0, 1) 51 gw(fd, "<text x=\"110\" y=\"668\" font-family=\"monospace\" font-size=\"13\" fill=\"#8b949e\">green = sovereign parent red = foreign parent (re-parent to Nishi)</text>\n" as *u8) 52 gw(fd, "</svg>\n" as *u8) 53 sys_close(fd) 54 return 0 55}