code wiki / _hdl_build / nx_gen_ingest.nx
nx_gen_ingest.nx
buildroot/runtime/_hdl_build/nx_gen_ingest.nx
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
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
structs
| none |
consts
| 36 | const GI_MAGIC_4096: i64 = 4096 |
| 37 | const GI_MAGIC_1024: i64 = 1024 |
| 92 | const GI_CAP: i64 = 33554432 |
functions
| 39 | func gi_puts(s: *u8) -> i64 { |
| 48 | func gi_slurp(path: *u8, out: *u8, cap: i64) -> i64 { |
| 63 | func gi_be32(b: *u8, off: i64) -> i64 {
called by 1: gi_size |
| 70 | func gi_size(png: *u8, n: i64, out: *u8) -> i64 { |
| 82 | func gi_base(p: *u8) -> *u8 {
called by 1: main |
| 94 | func main(argc: i64, argv: *i64) -> i64 { |