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
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
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
structs
| none |
consts
| none |
functions
| 13 | func cg(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func 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 |
| 17 | func cg_prefix(b: *u8) -> i64 called by 1: cg_build |
| 30 | func cg_text(b: *u8, off: i64, kw: *u8, val: *u8) -> i64 |
| 62 | func cg_iend(b: *u8, off: i64) -> i64 called by 1: cg_build |
| 70 | func cg_build(b: *u8, withprompt: i64, pval: *u8) -> i64 |
| 83 | func 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 |
| 85 | func main() -> i64 |