code wiki / _hdl_build / nx_cjc_panel_gate.nx

nx_cjc_panel_gate.nx

buildroot/runtime/_hdl_build/nx_cjc_panel_gate.nx

31606 B502 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_cjc_panel_gate.nx -- THE REFEREE FOR THE REFEREE PANEL (graphics GR1 / charsim R22: cjc_panel). WHAT IT PROVES, end to end against the PROMOTED nx_charjudge_census binary (not a second compiled copy): T1 the per-image lens child speaks its anchored contract: decoded=1 and every cjp_* key on the line T2 an undecodable input is UNOBSERVABLE (decoded=0, rc 2), never a value that reads like an answer T3 THE ADMISSION LAW: with NO receipt, `panel` prints verdict=UNADMITTED on every row and never a GOOD/BAD verdict -- an uncalibrated classifier reports numbers, never verdicts T4 a receipt whose floors DIFFER from the conf does not admit (the receipt binds the floors it was measured at); neg-control: matching floors + admitted=1 -> verdicts appear T5 BITE: calibrate on a labelled corpus the skin lens separates -> ADMITTED (fp=0 fn=0); the SAME corpus with the labels swapped -> REFUSED. A calibrator that admitted both would be vacuous. T6 neg-control-one-class: a corpus with only BAD rows is REFUSED (FN cannot be measured on an empty GOOD class -- a zero over an empty set is a fabricated number) T7 neg-control-no-floors: a conf with no floors has no voting lens -> calibrate REFUSES, panel composite is unobservable (a panel with nobody voting cannot pass anything) T8 topng round-trips a decodable image (dims preserved) -- the reference-banking path T9 the calibration census reconciles its own partition T10 a REFUSED recalibration rewrites the receipt to admitted=0 and the panel returns to UNADMITTED Fixtures are SYNTHESISED at runtime under /tmp/cjc_panel_gate/ (the gate-fixture law: never a production file, never a source literal a detector could trip on): a skin-toned centre figure on a dark ground (the Kovac 2003 rule fires) and a green centre figure (it does not). Their lens values are MEASURED by the organ itself before the calibrate teeth run, so no tooth carries a pre-chosen number. The sibling judges (charjudge, image_beauty, percept) may or may not be reachable from the gate's cwd; nothing here depends on them because the gate's own conf gives ONLY the skin lens a floor. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0 GREEN / 1 RED / 3 SKIP

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_tool_run.nx nx_gate_verdict.nx nx_png_write.nx nx_cjc_panel_gate.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_tool_run.nxnx_gate_verdict.nxnx_png_write.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 ↻ cg_exists sys_openat_rd sys_close gv_puts ↻ gv_need gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻ gv_journal

structs

none

consts

32const CG_DIR: *u8 = "/tmp/cjc_panel_gate"
33const CG_MODE_DIR: i64 = 493 // 0755
34const CG_MODE_FILE: i64 = 420 // 0644
35const CG_OUTCAP: i64 = 65536
36const CG_PATHCAP: i64 = 1024
37const CG_CHILD_TIMEOUT_MS: i64 = 240000 // four sibling forks per image under load; the panel's own child budget x1
38const CG_W: i64 = 96
39const CG_H: i64 = 64
42const CG_SKIN_R: i64 = 210
43const CG_SKIN_G: i64 = 160
44const CG_SKIN_B: i64 = 130
45const CG_GREEN_R: i64 = 60
46const CG_GREEN_G: i64 = 180
47const CG_GREEN_B: i64 = 70
48const CG_GROUND: i64 = 24
50const CG_CONF_BUF: i64 = 2048
51const CG_LIST_BUF: i64 = 4096
52const CG_RECEIPT_BUF: i64 = 1024

functions

54func cg_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } d[p] = 0 as u8; return p }
55func cg_catn(d: *u8, o: i64, v: i64) -> i64 { let p: i64 = nxi_buf(d, o, v); d[p] = 0 as u8; return p }
56func cg_path(name: *u8) -> *u8
called by 1: main calls 2: sys_mmapcg_cat
63func cg_write(path: *u8, s: *u8) -> i64
72func cg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
74func cg_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main
89func cg_field(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main
119func cg_fixture_png(path: *u8, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 2: sys_mmapnx_png_write_rgb
137func cg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, ol: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture_tr
151func cg_write_conf(path: *u8, receipt: *u8, fs: i64) -> i64
called by 1: main calls 4: sys_mmapcg_catcg_catncg_write
163func cg_write_conf_tiers(path: *u8, receipt: *u8, fs: i64, t1: *u8, t2: *u8) -> i64
called by 1: main calls 4: sys_mmapcg_catcg_catncg_write
173func cg_write_receipt_tiers(path: *u8, floor: i64, tiers_admitted: *u8) -> i64
called by 1: main calls 4: sys_mmapcg_catcg_catncg_write
183func main(argc: i64, argv: *i64) -> i64