code wiki / _hdl_build / nx_ciq_quadrant.nx

nx_ciq_quadrant.nx

buildroot/runtime/_hdl_build/nx_ciq_quadrant.nx

11793 B192 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tooltopic ciq
docsdependenciesstructsconstsfunctions

about

nx_ciq_quadrant.nx -- R2 of the CIQ arc, now MARKET-GENERIC: the QUADRANT-PLACER. For EACH market in the registry it reads the persisted two-axis scores from the SOVEREIGN seg_store and places every entity in the Gartner Magic Quadrant (x=Vision, y=Execute), then computes for NISHI the where-we-are -> where-we-need-to-go answer: the GAP VECTOR to the Leaders boundary + the COMPUTED capability ROADMAP (each not-yet-full nishi cell ranked by the EXACT permil it adds to its axis). Placement + gap are persisted ("ciq:<market>:placement:<e>" / ":gap:nishi") for the visualizer. Thresholds = NAMED consts. 100% sovereign, no-float. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_uxf_decode.nx nx_ciq_quadrant.nx

imports: nx_syscalls.nxnx_canon_cid.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

main sys_mmap ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 canon_decode ud_r32 sys_mmap ↻ q_field q_streq q_copy q_split ss_begin ss_begin_cap sys_mmap ↻ place_market sys_mmap ↻ q_key ss_cat ↻ ss_get ↻ canon_decode ↻ q_copy ↻

structs

none

consts

12const QQ_MAGIC_1024: i64 = 1024
13const QQ_MAGIC_8192: i64 = 8192
15const QQ_STORE: *u8 = "knowledge/store/ciq-"
16const QQ_MAXLEVEL: i64 = 2
17const QQ_EX_MIN: i64 = 500
18const QQ_VIS_MIN: i64 = 500

functions

20func qw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: place_marketmain calls 1: sys_write
21func qn(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 }
called by 2: place_marketmain calls 2: sys_mmapsys_write
22func q_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 }
called by 2: q_fieldplace_market
23func q_itoa(v: i64, b: *u8) -> i64 { var m: i64=v; if m<0{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{b[i]=t[k-1-i];i=i+1} b[k]=0 as u8; return k }
called by 1: place_market calls 1: sys_mmap
24func q_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: place_market
25func q_field(dk: *i64, dv: *i64, nf: i64, name: *u8) -> *u8 { var f: i64=0; while f<nf { if q_streq(dk[f] as *u8, name)==1 { return dv[f] as *u8 } f=f+1 } return 0 as *u8 }
called by 2: place_marketmain calls 1: q_streq
26func q_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 }
called by 2: place_marketmain
27func q_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 }
called by 2: place_marketmain
28func q_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 }
called by 1: place_market calls 1: ss_cat
30func q_quad(ex: i64, vis: i64) -> i64 { if ex >= QQ_EX_MIN { if vis >= QQ_VIS_MIN { return 0 } return 1 } if vis >= QQ_VIS_MIN { return 2 } return 3 }
called by 2: place_marketmain
31func q_quadname(q: i64) -> *u8 { if q==0 { return "LEADER" as *u8 } if q==1 { return "CHALLENGER" as *u8 } if q==2 { return "VISIONARY" as *u8 } return "NICHE-PLAYER" as *u8 }
called by 1: place_market
34func place_market(market: *u8, sw: *i64) -> i64
165func main() -> i64