code wiki / _hdl_build / nx_onsite_search_gate.nx

nx_onsite_search_gate.nx

buildroot/runtime/_hdl_build/nx_onsite_search_gate.nx

10716 B204 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic onsite
docsdependenciesstructsconstsfunctions

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

nx_search_inverted_persist.nx nx_g_puts_lib.nx nx_onsite_search_gate.nx

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

main g_puts sys_write g_build_site sys_fork nx_inv_new nx_inv_index_row nx_inv_is_token_char nx_inv_hash_bytes_lower nx_inv_add_posting nx_inv_count_token nx_inv_slot_at nx_inv_slot_hash nx_inv_slot_set_hash nx_inv_slot_set_postings_c nx_inv_slot_postings_count g_strlen nx_inv_finalize_offsets nx_inv_slot_at ↻ nx_inv_slot_hash ↻ nx_inv_slot_postings_count ↻ nx_inv_slot_set_postings_o nx_inv_slot_set_write_curs nx_inv_emit_row nx_inv_is_token_char ↻ nx_inv_hash_bytes_lower ↻ nx_inv_emit_posting nx_inv_slot_at ↻ nx_inv_slot_hash ↻ nx_inv_slot_postings_count ↻ nx_inv_slot_postings_offse nx_inv_slot_write_cursor nx_inv_slot_set_write_curs ↻ nx_inv_save sys_openat_wr nx_invp_write_all sys_openat_wr ↻ sys_wait4 g_write_file sys_openat_wr ↻

structs

none

consts

none

functions

15func 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 }
16func 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 }
17func 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 }
18func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
20func g_write_file(path: *u8, data: *u8) -> i64
called by 1: main calls 2: sys_openat_wrg_strlen
27func g_read_small(path: *u8, buf: *u8, cap: i64) -> i64
calls 1: sys_read
39func g_build_site(urls: *i64, titles: *i64, texts: *i64, nd: i64, idx_path: *u8, manifest_path: *u8) -> i64
69func g_run(sites: *u8, site: *u8, term: *u8, out_path: *u8) -> i64
87func g_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: g_containsg_rank_of calls 1: g_strlen
99func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 { if g_find(hay,n,needle)>=0 { return 1 } return 0 }
calls 1: g_find
100func g_rank_of(buf: *u8, n: i64, expected: *u8) -> i64
calls 1: g_find
114func main() -> i64