code wiki / _hdl_build / nx_gen_ingest.nx

nx_gen_ingest.nx

buildroot/runtime/_hdl_build/nx_gen_ingest.nx

11987 B242 linesdepth 8pulls 17 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_ingest.nx -- ingest an ON-DISK PNG into the gallery: GENREC tEXt -> CID -> blob -> sidecar. WHY THIS EXISTS. The operator asked, this session: *"are these gens pointable so right now i can see them in gallery"*. The measured answer was NO, and it stayed no while three sovereign images were produced: `grep -c sovgen /volume1/ai/gen/cids.tsv` returned 0. The sovereign renderer wrote PNGs to /volume1/ai/images/sovgen/ -- a directory the gallery does not read. Nothing was broken; the images were simply never handed to the index. ★★★★★ AN ARTEFACT THAT IS NOT IN THE INDEX DOES NOT EXIST TO THE PRODUCT, HOWEVER REAL THE FILE IS. nx_gen_pipeline already does exactly this ingest, but its entry point takes BASE64 because it was written for a GPU worker that answers in JSON. The sovereign path has raw PNG bytes on disk, so this organ reuses that file's blob-path and sidecar-append helpers rather than restating them -- the gallery's contract must have ONE definition or the two writers will disagree about where an image lives, which is a corruption nobody would see until a link 404s. Usage: nx_gen_ingest <blobdir> <sidecar|-> <idx|-> <blob|-> <view|-> <model> <seed> <prompt> <png> ... Production values (measured from the live store, not assumed): blobdir /volume1/ai/gen/blob- idx /volume1/ai/galx/knowledge/index/galx_cid.idx blob /volume1/ai/galx/knowledge/index/galx_cid.blob Pass `-` for the sidecar to skip the legacy TSV entirely -- which is the point: the gen->gallery path now writes the SOVEREIGN store directly (nx_galx_cidput), so no 70-byte text append and no 34MB recompile of 235,445 rows stands between a render and the gallery. The gate points everything at /tmp -- ★ A TEST THAT WRITES TO THE PRODUCTION STORE IS NOT A TEST. license_tier: ORIGINAL

dependencies 8 imports · 0 importers

nx_syscalls.nx nx_strconv.nx nx_canon_cid.nx nx_png_textw.nx nx_store_ingest.nx nx_gen_pipeline.nx nx_galx_cidput.nx nx_galx_viewadd_lib.nx nx_gen_ingest.nx

imports: nx_syscalls.nxnx_strconv.nxnx_canon_cid.nxnx_png_textw.nxnx_store_ingest.nxnx_gen_pipeline.nxnx_galx_cidput.nxnx_galx_viewadd_lib.nx

imported by: nobody (leaf or entry point)

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

main gi_puts sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gi_base gi_slurp sys_openat_rd sys_read sys_close gi_size nx_strconv_format_i64 gi_be32 cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_seed_allocated sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word

structs

none

consts

36const GI_MAGIC_4096: i64 = 4096
37const GI_MAGIC_1024: i64 = 1024
92const GI_CAP: i64 = 33554432

functions

39func gi_puts(s: *u8) -> i64 {
called by 1: main calls 1: sys_write
48func gi_slurp(path: *u8, out: *u8, cap: i64) -> i64 {
called by 1: main calls 3: sys_openat_rdsys_readsys_close
63func gi_be32(b: *u8, off: i64) -> i64 {
called by 1: gi_size
70func gi_size(png: *u8, n: i64, out: *u8) -> i64 {
called by 1: main calls 2: nx_strconv_format_i64gi_be32
82func gi_base(p: *u8) -> *u8 {
called by 1: main
94func main(argc: i64, argv: *i64) -> i64 {