code wiki / _hdl_build / nx_semantic_gap_gate.nx
nx_semantic_gap_gate.nx
buildroot/runtime/_hdl_build/nx_semantic_gap_gate.nx
about
nx_semantic_gap_gate.nx -- HONEST measurement of the SEMANTIC GAP (answers the operator's doubt "are we
really exceed doing semantic work?" with a number, not an opinion). Our search is LEXICAL (BM25/BM25F =
"literal matches of the query words", cited sem_search.raw). This gate runs NATURAL-LANGUAGE queries -- the
way a real person types -- through the LIVE nx_onsite_search client over the real andelinwest corpus, and
counts how many land the semantically-correct practice page at rank #1. A LOW score is the POINT: it proves,
measured, that lexical search does NOT understand meaning -> we are NOT exceed on semantics. The fix is the
PARTNERSHIP (BM25 retrieve + LLM rerank = RAG, cited sem_rag.raw), which is unbuilt here. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| none |
functions
| 10 | func s_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func s_num(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 } |
| 12 | func s_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 } calls 1: sys_write |
| 13 | func s_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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(fd,bb,k); return 0 } |
| 14 | func s_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 16 | func s_write_file(path: *u8, data: *u8) -> i64 { let fd: i64=sys_openat_wr(path, 0x1a4); if fd<0 { return 0-1 } sys_write(fd, data, s_strlen(data)); sys_close(fd); return 0 } |
| 17 | func s_read_small(path: *u8, buf: *u8, cap: i64) -> i64 |
| 24 | func s_index(a1: *u8, a2: *u8, a3: *u8, a4: *u8) -> i64 |
| 36 | func s_client(sites: *u8, site: *u8, terms: *i64, nt: i64, out_path: *u8) -> i64 |
| 48 | func s_find(hay: *u8, n: i64, needle: *u8) -> i64 |
| 55 | func s_top_is(buf: *u8, n: i64, expected: *u8) -> i64 |
| 68 | func s_row(sites: *u8, label: *u8, terms: *i64, nt: i64, expect: *u8, obuf: *u8) -> i64 |
| 81 | func main() -> i64 |