code wiki / (root) / nx_lbp_faceindex.nx

nx_lbp_faceindex.nx

buildroot/runtime/nx_lbp_faceindex.nx

4927 B108 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic lbp
docsdependenciesstructsconstsfunctions

about

nx_lbp_faceindex.nx -- SOVEREIGN face-descriptor RUNG 6: cluster the corpus descriptor store into people. Reads knowledge/status/galx_face_descr.bin (fixed records {cid(72) + 16384 i64}), packs the descriptors, runs cluster_greedy (nx_lbp_core) at a chi-square threshold (arg1, scale=1000), and writes: galx_face_index.tsv = cid \t cluster_id (consumed by the gallery &person= filter) galx_persons.tsv = cluster_id \t count \t rep_cid (sorted by count DESC -> the People dropdown) Prints M / cluster count / top cluster sizes so the threshold can be tuned by MEASUREMENT. Build/run: ./_offc/nx_sov_build_run.elf nx_lbp_faceindex [thresh] license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_lbp_core.nx nx_lbp_faceindex.nx

imports: nx_syscalls.nxnx_lbp_core.nx

imported by: nobody (leaf or entry point)

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

main fi_atoi sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close lp sys_write sys_exit cluster_greedy chi2_at ln sys_mmap ↻ sys_write ↻ sys_openat_wr fi_num sys_mmap ↻ sys_write ↻ sys_close ↻ fi_heapsort fi_sift

structs

none

consts

10const K_MAGIC_8000000: i64 = 8000000
12const REC: i64 = 131144 // 72 (cid, null-padded, 8-aligned) + 16384*8 (descriptor)
13const D: i64 = 16384 // 8x8 grid * 256 bins

functions

15func fi_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8) { if s[i]>=(48 as u8) { if s[i]<=(57 as u8) { v=v*10+((s[i] as i64)-48) } } i=i+1 } return v }
called by 1: main
17func fi_num(buf: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
27func fi_sift(idx: *i64, key: *i64, root0: i64, n: i64) -> i64
called by 1: fi_heapsort
32func fi_heapsort(idx: *i64, key: *i64, n: i64) -> i64
called by 1: main calls 1: fi_sift
39func main(argc: i64, argv: *i64) -> i64