code wiki / _hdl_build / nx_gen_rank.nx

nx_gen_rank.nx

buildroot/runtime/_hdl_build/nx_gen_rank.nx

6768 B138 linesdepth 9pulls 16 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_rank.nx -- FULL-SCALE score-and-rank on a SOVEREIGN seg-store PLANE (NOT a .tsv -- sovereign-formats-first law, operator 2026-07-21 "why are you building tsvs again"). Scores live in knowledge/store/genscores- (row = cid<TAB> symmetry_q1000), written via sts_seed (one commit per beat run, NOT per gen -> avoids the seg-store quadratic) and read via sts_load. Verbs: score [batch] -> score up to batch not-yet-scored gallery cids (cid list from the daemon sidecar) INTO the plane. rank [n] -> load the ENTIRE plane, sort by symmetry DESC, return top n (default all). Full-scale, no sampling. Scoring uses the shared symmetry lib. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_image_symmetry_lib.nx nx_seg_store.nx nx_store_seed_lib.nx nx_gen_rank.nx

imports: nx_syscalls.nxnx_image_symmetry_lib.nxnx_seg_store.nxnx_store_seed_lib.nx

imported by: nobody (leaf or entry point)

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

main gr_streq do_score sys_mmap sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_cat ↻ ss_loadfile ss_load_aux2 ssl_total_keys ssl_pow2 ssl_build ss_r32 ssl_lookup ss_manifest_free sys_munmap ssc_retire_handle sts_mm sys_mmap ↻ sts_werr sys_write sys_exit ss_hget sys_mmap ↻ ss_idx_find ss_r32 ↻ ss_len ss_kcmp sts_atoi sts_rowkey

structs

none

consts

12const K_MAGIC_1048576: i64 = 1048576
13const K_MAGIC_8192: i64 = 8192
14const K_MAGIC_1024: i64 = 1024

functions

16func gr_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if (a[i]&0xff)!=(b[i]&0xff) { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 }
called by 2: do_rankmain
18func gr_contains(buf: *u8, n: i64, cid: *u8) -> i64
called by 1: do_score
31func do_score(batch: i64) -> i64
70func do_rank(topn: i64) -> i64
129func main(argc: i64, argv: *i64) -> i64