code wiki / _hdl_build / nx_seg_imp_build.nx

nx_seg_imp_build.nx

buildroot/runtime/_hdl_build/nx_seg_imp_build.nx

4646 B100 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind tooltopic seg
docsdependenciesstructsconstsfunctions

about

nx_seg_imp_build.nx -- build the NXW1 .imp IMPACT sidecar for every live segment of a shard, IN PLACE (2026-07-25, the WAND rung, seq606). The cheap format-upgrade path: reads each segment's .idx (terms+post slices) + .pos (the NXQ1 tf source) and writes seg-<id>.imp via temp->rename. ADDITIVE-ONLY BY CONSTRUCTION (rules 13/26): no existing file is ever mutated, a crash leaves only a .tmp, and a re-run skips segments already carrying the sidecar (idempotent, rule 10). A segment without .pos (pre-phrase format) is SKIPPED LOUD -- compaction is that segment's upgrade path. usage: nx_seg_imp_build <domain> [--force] license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_docportal_search_seg.nx nx_itoa_lib.nx nx_seg_imp_build.nx

imports: nx_docportal_search_seg.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

main dss_prefix ss_manifest_cap ss_manifest_file_cap sys_mmap ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sib_puts sib_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap sib_one ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile sys_map_file sys_openat_rd ↻ sys_lseek ↻ sys_close ↻ ss_readall ↻ ss_r32 sys_munmap ↻ ss_loadfile ↻ ss_build_imp ss_r32 ↻ sys_mmap ↻ ss_w32 ss_vr ss_imp_thresh sys_mmap ↻

structs

none

consts

11const SIB_MAGIC_65536: i64 = 65536
13const SIB_MAXSEGS: i64 = 8192

functions

15func sib_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main
20func sib_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
23func sib_one(prefix: *u8, segname: *u8, force: i64) -> i64
67func main(argc: i64, argv: *i64) -> i64