code wiki / (root) / nx_swcompare_terms.nx

nx_swcompare_terms.nx

buildroot/runtime/nx_swcompare_terms.nx

12344 B214 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic swcompare
docsdependenciesstructsconstsfunctions

about

nx_swcompare_terms.nx -- AUTO-AXIS-DISCOVERY for Nishi Compare. Given a <domain>, loads the researcher-banked frontier corpus (from <domain>.q bank names) and mechanically DISCOVERS the frontier's most-discussed phrases: tokenize -> adjacent-word bigrams (stopword-filtered, both words >=3 chars, small gap) -> hashed frequency table -> top-N by count. These are CANDIDATE axes surfaced straight from the 2025/26 frontier -- they feed/refine the curated <domain>.axes so a new domain trends toward a single-file (.q) act. HONEST: this is candidate DISCOVERY (keyword momentum has the usual extraction noise), not a finished axis list. Modes: `<domain>` = console + gate. NOTE: no '#'/'!' in string literals (nx_cc trap). license_tier: ORIGINAL expect_exit:0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_swcompare_terms.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 pj3 load_corpus_from_q c_read sys_openat_rd sys_read sys_close sys_mmap ↻ pj3 ↻ load_append sys_openat_rd ↻ sys_read ↻ sys_close ↻ extract_titles sys_mmap ↻ matchat is_alpha is_stop lc c_has hash_la is_alpha ↻ lc ↻ beq is_alpha ↻ lc ↻ wc sys_mmap ↻ sys_write w sys_write ↻ wr sys_write ↻ wr_lower sys_mmap ↻ lc ↻ sys_write ↻ sys_exit

structs

none

consts

9const K_MAGIC_5381: i64 = 5381
10const K_MAGIC_4194304: i64 = 4194304
11const K_MAGIC_65536: i64 = 65536
12const K_MAGIC_2097152: i64 = 2097152
13const K_MAGIC_262144: i64 = 262144

functions

15func 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 2: wnmain calls 1: sys_write
16func wn(fd: i64, v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
22func wr(fd: i64, buf: *u8, s: i64, e: i64) -> i64 { var i: i64 = s; while i < e { sys_write(fd, (buf as i64 + i) as *u8, 1); i = i + 1 } return 0 }
called by 1: main calls 1: sys_write
23func c_read(path: *u8, buf: *u8, cap: i64) -> i64
29func c_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: is_stop
36func pj3(dst: *u8, a: *u8, b: *u8, c: *u8) -> i64
43func load_append(dst: *u8, off: i64, cap: i64, path: *u8) -> i64
49func load_corpus_from_q(FRONT: *u8, fcap: i64, qpath: *u8, qb: *u8, qcap: i64) -> i64
called by 1: main calls 4: c_readsys_mmappj3load_append
70func matchat(buf: *u8, i: i64, n: i64, pat: *u8, pl: i64) -> i64 { if i + pl > n { return 0 } var k: i64 = 0; while k < pl { if buf[i+k] != pat[k] { return 0 } k = k + 1 } return 1 }
called by 1: extract_titles
73func extract_titles(FRONT: *u8, FN: i64, CLEAN: *u8, ccap: i64) -> i64
called by 1: main calls 2: sys_mmapmatchat
86func is_alpha(c: u8) -> i64 { let x: i64 = c as i64; if x >= 65 { if x <= 90 { return 1 } } if x >= 97 { if x <= 122 { return 1 } } return 0 }
called by 3: hash_labeqmain
87func lc(c: u8) -> i64 { let x: i64 = c as i64; if x >= 65 { if x <= 90 { return x + 32 } } return x }
88func hash_la(buf: *u8, s: i64, e: i64) -> i64
called by 1: main calls 2: is_alphalc
94func beq(buf: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64
called by 1: main calls 2: is_alphalc
109func is_stop(buf: *u8, s: i64, e: i64, tmp: *u8, STOP: *u8, sl: i64) -> i64
called by 1: main calls 2: lcc_has
117func 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
118func wr_lower(fd: i64, buf: *u8, s: i64, e: i64) -> i64 { let t: *u8 = sys_mmap(2); var i: i64 = s; while i < e { t[0] = lc(buf[i]) as u8; sys_write(fd, t, 1); i = i + 1 } return 0 }
called by 1: main calls 3: sys_mmaplcsys_write
119func 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 1: main calls 2: sys_mmapsys_write
121func main(argc: i64, argv: *i64) -> i64