code wiki / _hdl_build / nx_onsite_search_gate.nx
nx_onsite_search_gate.nx
buildroot/runtime/_hdl_build/nx_onsite_search_gate.nx
about
nx_onsite_search_gate.nx -- the engineer's re-runnable instrument for the REUSABLE onsite search client
(manifest model). Builds TWO isolated site corpora (alpha = andelinwest-like practice docs; beta =
gallery-like image-meta docs), each its OWN durable inverted index + MANIFEST (url<TAB>title<TAB>text),
registers both in a sites TSV, then forks+execs the REAL /tmp/nx_onsite_search.sov.elf over a KAT +
neg-control oracle:
- BM25 lands the right doc #1 on its own term (3 rows: probate->Estate, custody->Family, llc->Business)
- per-site ISOLATION holds BOTH directions (alpha can't see a beta-only term; beta can't see alpha-only)
- beta works on its own term (portrait->beta doc)
- an UNKNOWN site fails clean (exit 1, "unknown site"), not a crash
GREEN iff all 7 rows pass. Durable verdict appends to knowledge/status/onsite_search_gate.log.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_search_inverted_persist.nxnx_g_puts_lib.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
| 15 | func g_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 } |
| 16 | func g_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 } |
| 17 | func g_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 } |
| 18 | func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 20 | func g_write_file(path: *u8, data: *u8) -> i64 |
| 27 | func g_read_small(path: *u8, buf: *u8, cap: i64) -> i64 calls 1: sys_read |
| 39 | func g_build_site(urls: *i64, titles: *i64, texts: *i64, nd: i64, idx_path: *u8, manifest_path: *u8) -> i64 called by 1: main calls 9: sys_forknx_inv_newnx_inv_index_rowg_strlennx_inv_finalize_offsetsnx_inv_emit_row+3 |
| 69 | func g_run(sites: *u8, site: *u8, term: *u8, out_path: *u8) -> i64 |
| 87 | func g_find(hay: *u8, n: i64, needle: *u8) -> i64 |
| 99 | func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 { if g_find(hay,n,needle)>=0 { return 1 } return 0 } calls 1: g_find |
| 100 | func g_rank_of(buf: *u8, n: i64, expected: *u8) -> i64 calls 1: g_find |
| 114 | func main() -> i64 |