code wiki / (root) / nx_photo_count_gate.nx

nx_photo_count_gate.nx

buildroot/runtime/nx_photo_count_gate.nx

5845 B91 linesdepth 9pulls 38 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_photo_count_gate.nx -- REFEREE for the five-pics fix and the conversation-album arithmetic (2026-08-30): a photo count parses from digits AND number words but ONLY beside a photo noun, clamps to the batch cap, and is spliced out of the scene the diffusion model reads (the measured defect: "send me five pics" clamped to ONE request whose prompt still said "five pics", so the model painted a five-panel collage into one image); the album emitter groups tsv rows into days under a clock offset with hand-derivable 1970-epoch fixtures. GPU-free, in-process (imports the orchestrator lib directly). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gen_orchestrator.nx nx_photo_count_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gen_orchestrator.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr 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 ↻ sys_mmap ↻ pg_count go_parse_count_any sys_mmap ↻ go_cnt_is_letter go_cnt_lo go_cnt_is_digit go_cnt_numword go_cnt_word_at go_cnt_lo ↻ go_cnt_is_letter ↻ go_cnt_prefix_at go_cnt_lo ↻ pg_len gv_check gv_puts ↻ go_scene_decount pg_len ↻ pg_eq go_album_emit

structs

none

consts

11const PG_TOKBUF: i64 = 32
12const PG_OUT: i64 = 8192
13const PG_ALBUM_FIXTURE: *u8 = "0\tnxc1-aa\n86399\tnxc1-bb\n86400\tnxc1-cc\n" as *u8

functions

15func pg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 3: pg_findpg_countmain
16func pg_eq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
called by 1: main
17func pg_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: pg_len
31func pg_count(s: *u8, tok: *i64) -> i64 { return go_parse_count_any(s, pg_len(s), tok) }
called by 1: main calls 2: go_parse_count_anypg_len
33func main() -> i64