code wiki / _hdl_build / nx_store_ingest_cid_gate.nx

nx_store_ingest_cid_gate.nx

buildroot/runtime/_hdl_build/nx_store_ingest_cid_gate.nx

6649 B127 linesdepth 7pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic store
docsdependenciesstructsconstsfunctions

about

nx_store_ingest_cid_gate.nx -- R1 gate: proves the `prompt` factor is now in the generation-CID, fixing the latent collision where two DIFFERENT prompts at the same seed/model/sampler/steps/ generator_host mapped to ONE CID -> the gallery would silently drop the second as a dup. Composes the GREEN organ nx_store_ingest_compute_cid (computes a CID with NO store side-effect -> a pure CID comparison). Builds tiny chunk-walkable PNGs in-memory: sig+IHDR copied verbatim from the known-good KAT fixture (nx_store_ingest_test.nx) + real tEXt chunks (CRC32) + IEND. NO fake green: if `prompt` were NOT harvested, P_cat and P_dog would collide -> the gate goes RED. The cg_text tEXt-chunk writer here is the prototype for the R2 sovereign PNG tEXt writer. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_store_ingest.nx nx_syscalls.nx nx_store_ingest_cid_gate.nx

imports: nx_store_ingest.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap cg_build cg_prefix cg_text cg_slen cg_iend nx_store_ingest_compute_ci sys_mmap ↻ nx_store_ingest_harvest sys_mmap ↻ _pe_pngchunk_rdbe _pe_pngtext_locate nx_store_ingest_keq canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ cid_from_digest sys_munmap ↻ cg sys_write

structs

none

consts

none

functions

13func cg(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 calls 1: sys_write
14func cg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: cg_text
17func cg_prefix(b: *u8) -> i64
called by 1: cg_build
30func cg_text(b: *u8, off: i64, kw: *u8, val: *u8) -> i64
called by 1: cg_build calls 1: cg_slen
62func cg_iend(b: *u8, off: i64) -> i64
called by 1: cg_build
70func cg_build(b: *u8, withprompt: i64, pval: *u8) -> i64
called by 1: main calls 3: cg_prefixcg_textcg_iend
83func cg_cideq(a: *u8, b: *u8) -> i64 { var i: i64=0; while i<69 { if (a[i]&0xff)!=(b[i]&0xff){return 0} i=i+1 } return 1 }
called by 1: main
85func main() -> i64