code wiki / (root) / nx_swcompare_gapmap.nx

nx_swcompare_gapmap.nx

buildroot/runtime/nx_swcompare_gapmap.nx

31895 B482 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic swcompare
docsdependenciesstructsconstsfunctions

about

nx_swcompare_gapmap.nx -- the GENERATIVE gap-finder of Nishi Compare, DOMAIN-PARAMETERIZED. Given a <domain>, it reads knowledge/compare/<domain>.q (to learn the researcher-banked frontier corpus file names) + knowledge/ compare/<domain>.axes (label|organ-path|symbol|frontier-keywords, plus an optional "@title <text>" line) -> for each axis measures OUR presence (symbol on disk, mechanical) x FRONTIER MOMENTUM (keyword count over the banked 2024-2026 corpus) -> classifies OPPORTUNITY (absent+hot = where to test/research), COVERED (present), dormant. A NEW domain = a new .q + .axes pair; ZERO new code. Modes: `nx_swcompare_gapmap <domain>` = console + liar-kill (gate); `nx_swcompare_gapmap <domain> html` = emit the /compare/<domain>/frontier page. NOTE: no '#'/'!' in string literals (nx_cc trap). license_tier: ORIGINAL expect_exit:0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_swcompare_gapmap.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main streq sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ pj3 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close q_walk sys_mmap ↻ pj3 ↻ sys_openat_rd ↻ sys_lseek ↻ sys_close ↻ load_append sys_openat_rd ↻ sys_read ↻ sys_close ↻ sys_munmap ↻ c_file_has sys_mmap ↻ sys_read_file ↻ c_has

structs

none

consts

10const K_MAGIC_100000: i64 = 100000
69const GM_ASCII_UPPER_A: i64 = 65
70const GM_ASCII_UPPER_Z: i64 = 90
71const GM_ASCII_LOWER_A: i64 = 97
72const GM_ASCII_LOWER_Z: i64 = 122
73const GM_ASCII_DIGIT_0: i64 = 48
74const GM_ASCII_DIGIT_9: i64 = 57
75const GM_CASE_DELTA: i64 = 32
76const GM_WHOLE_WORD_MARK: i64 = 36
77const GM_CH_AMP: i64 = 38
78const GM_CH_LT: i64 = 60
79const GM_CH_GT: i64 = 62
80const GM_CH_DQUOTE: i64 = 34
81const GM_CH_SQUOTE: i64 = 39
82const GM_CH_MINUS: i64 = 45
83const GM_DECIMAL: i64 = 10
84const GM_KW_ENTRY_SLACK: i64 = 24
155const GM_LIB_DIR: *u8 = "knowledge/library/"
156const GM_LIB_EXT: *u8 = ".txt"
157const GM_SEEK_END: i64 = 2
158const GM_PATH_SLACK: i64 = 32

functions

12func 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 3: wnwhmain calls 1: sys_write
13func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 }
called by 3: wjwhmain calls 2: sys_mmapsys_write
14func wn(fd: i64, v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
20func 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 1: main
21func wj(fd: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c == 34 { wc(fd, 92); wc(fd, 34) } else { if c == 92 { wc(fd, 92); wc(fd, 92) } else { if c < 32 { wc(fd, 32) } else { wc(fd, c) } } } i = i + 1 } return 0 }
called by 1: main calls 1: wc
22func pj3(dst: *u8, a: *u8, b: *u8, c: *u8) -> i64
called by 2: q_walkmain
29func c_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: c_file_has
40func c_file_has(path: *u8, needle: *u8) -> i64
52func c_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main
85func gm_lower(c: i64) -> i64 { if c >= GM_ASCII_UPPER_A { if c <= GM_ASCII_UPPER_Z { return c + GM_CASE_DELTA } } return c }
86func gm_is_alnum(c: i64) -> i64
called by 1: c_count_word calls 1: gm_lower
92func c_count_word(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 2: gm_lowergm_is_alnum
117func gm_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } dst[o] = 0 as u8; return o }
called by 1: main
119func gm_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main
133func wh(fd: i64, s: *u8) -> i64
called by 1: main calls 2: wwc
142func load_append(dst: *u8, off: i64, cap: i64, path: *u8) -> i64
159func q_walk(qb: *u8, qn: i64, FRONT: *u8, fcap: i64, sizing: i64, stats: *i64) -> i64
198func main(argc: i64, argv: *i64) -> i64