nx_galx_index.nx
buildroot/runtime/nx_galx_index.nx
about
nx_galx_index.nx -- SOVEREIGN gallery index builder (replaces the bash build_view_index.sh; all logic
is NishiLang per the ecosystem law). Reads the CID->path sidecar, derives each image's capture timestamp
from its filename (YYYYMMDD_HHMMSS), sorts NEWEST-FIRST (iterative heapsort -- no recursion depth risk at
230k), de-dups by CID, and writes knowledge/status/galx_view_index.txt (one 69-char CID per line) that
the daemon's /api/list + grid read. NO image is skipped: a row whose filename has no parseable timestamp
still gets indexed with key 0 (sorts to the end), so every ingested image is browsable.
Usage: nx_galx_index (no args). license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_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
| 10 | const GI_MAGIC_1000000: i64 = 1000000 |
| 12 | const GI_CAP: i64 = 300000 // max images indexed (corpus is ~230k) |
| 13 | const GI_SIDE: *u8 = "knowledge/status/galx_cid_paths.tsv" as *u8 |
| 14 | const GI_OUT: *u8 = "knowledge/status/galx_view_index.txt" as *u8 |
functions
| 16 | func gi_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 21 | func gi_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 23 | func gi_isdig(c: i64) -> i64 { if c < 48 { return 0 } if c > 57 { return 0 } return 1 } called by 1: gi_ts |
| 27 | func gi_ts(buf: *u8, off: i64, end: i64) -> i64 |
| 53 | func gi_sift(idx: *i64, key: *i64, root0: i64, n: i64) -> i64 called by 1: gi_heapsort |
| 71 | func gi_heapsort(idx: *i64, key: *i64, n: i64) -> i64 |
| 84 | func gi_cideq(buf: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 90 | func main() -> i64 |