code wiki / _hdl_build / nx_ciq_visual.nx
nx_ciq_visual.nx
buildroot/runtime/_hdl_build/nx_ciq_visual.nx
about
nx_ciq_visual.nx -- R3 of the CIQ arc, now MARKET-GENERIC: the VISUALIZER. For EACH market it reads
placements + gap from the SOVEREIGN seg_store and emits a standalone browser Magic Quadrant (HTML +
inline SVG, integer coords no-float, authored byte-by-byte like Nishi's site pages -- NOT a 3rd-party
plot lib) to knowledge/staging/ciq_<market>_quadrant.html. Nishi is highlighted with its gap-vector
arrow. GATE per market: re-read + assert "<svg" + EVERY placed entity + quadrant labels (liar-kill a
phantom placement). 100% sovereign. license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_seg_store.nxnx_uxf_decode.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
| 10 | const VZ_MAGIC_1024: i64 = 1024 |
| 11 | const VZ_MAGIC_131072: i64 = 131072 |
| 13 | const VZ_STORE: *u8 = "knowledge/store/ciq-" |
| 14 | const VZ_W: i64 = 820 |
| 15 | const VZ_H: i64 = 600 |
| 16 | const VZ_ML: i64 = 90 |
| 17 | const VZ_MR: i64 = 40 |
| 18 | const VZ_MT: i64 = 64 |
| 19 | const VZ_MB: i64 = 70 |
| 20 | const VZ_EXMIN: i64 = 500 |
| 21 | const VZ_VISMIN: i64 = 500 |
functions
| 23 | func vw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func vn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;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(1,bb,k); return 0 } |
| 25 | func v_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 } |
| 26 | func v_pint(s: *u8) -> i64 { var v: i64=0; var i: i64=0; var go: i64=1; while go==1 { let c: i64=s[i]; if c>=48 { if c<=57 { v=v*10+(c-48); i=i+1 } else { go=0 } } else { go=0 } } return v } called by 1: emit_market |
| 27 | func v_field(dk: *i64, dv: *i64, nf: i64, name: *u8) -> *u8 { var f: i64=0; while f<nf { if v_streq(dk[f] as *u8, name)==1 { return dv[f] as *u8 } f=f+1 } return 0 as *u8 } |
| 28 | func v_split(buf: *u8, delim: i64, out: *i64, maxn: i64) -> i64 { var n: i64=0; var i: i64=0; var intok: i64=0; while buf[i]!=(0 as u8) { let c: i64=buf[i]; if c==delim { buf[i]=0 as u8; intok=0 } else { if intok==0 { if n<maxn { out[n]=(buf as i64)+i; n=n+1 } intok=1 } } i=i+1 } return n } |
| 29 | func v_copy(src: *u8, dst: *u8) -> i64 { var i: i64=0; while src[i]!=(0 as u8){ dst[i]=src[i]; i=i+1 } dst[i]=0 as u8; return i } |
| 30 | func bcat(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ buf[off+i]=s[i]; i=i+1 } return off+i } |
| 31 | func bint(buf: *u8, off: i64, v: i64) -> i64 { var m: i64=v; var o: i64=off; if m<0{ buf[o]=45 as u8; o=o+1; m=0-m } let t: *u8=sys_mmap(32); var k: i64=0; if m==0{t[0]=48 as u8;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{ buf[o+i]=t[k-1-i]; i=i+1 } return o+k } |
| 32 | func v_contains(hay: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){ nl=nl+1 } if nl==0 { return 1 } var i: i64=0; while i + nl <= n { var j: i64=0; var ok: i64=1; while j < nl { if hay[i+j] != needle[j] { ok=0; j=nl } else { j=j+1 } } if ok==1 { return 1 } i=i+1 } return 0 } called by 1: emit_market |
| 33 | func v_key(buf: *u8, market: *u8, suffix: *u8) -> i64 { var o: i64=0; o=ss_cat(buf,o,"ciq:" as *u8); o=ss_cat(buf,o,market); o=ss_cat(buf,o,":" as *u8); o=ss_cat(buf,o,suffix); buf[o]=0 as u8; return o } |
| 34 | func px_x(vis: i64) -> i64 { let pw: i64 = VZ_W - VZ_ML - VZ_MR; return VZ_ML + (vis * pw) / 1000 } |
| 35 | func px_y(ex: i64) -> i64 { let ph: i64 = VZ_H - VZ_MT - VZ_MB; return VZ_MT + ((1000 - ex) * ph) / 1000 } |
| 37 | func emit_dot(buf: *u8, off: i64, name: *u8, ex: i64, vis: i64, is_nishi: i64, idx: i64) -> i64 |
| 52 | func emit_market(market: *u8) -> i64 |
| 141 | func main() -> i64 |