code wiki / _hdl_build / nx_cjc_panel_gate.nx
nx_cjc_panel_gate.nx
buildroot/runtime/_hdl_build/nx_cjc_panel_gate.nx
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
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
structs
| none |
consts
| 32 | const CG_DIR: *u8 = "/tmp/cjc_panel_gate" |
| 33 | const CG_MODE_DIR: i64 = 493 // 0755 |
| 34 | const CG_MODE_FILE: i64 = 420 // 0644 |
| 35 | const CG_OUTCAP: i64 = 65536 |
| 36 | const CG_PATHCAP: i64 = 1024 |
| 37 | const CG_CHILD_TIMEOUT_MS: i64 = 240000 // four sibling forks per image under load; the panel's own child budget x1 |
| 38 | const CG_W: i64 = 96 |
| 39 | const CG_H: i64 = 64 |
| 42 | const CG_SKIN_R: i64 = 210 |
| 43 | const CG_SKIN_G: i64 = 160 |
| 44 | const CG_SKIN_B: i64 = 130 |
| 45 | const CG_GREEN_R: i64 = 60 |
| 46 | const CG_GREEN_G: i64 = 180 |
| 47 | const CG_GREEN_B: i64 = 70 |
| 48 | const CG_GROUND: i64 = 24 |
| 50 | const CG_CONF_BUF: i64 = 2048 |
| 51 | const CG_LIST_BUF: i64 = 4096 |
| 52 | const CG_RECEIPT_BUF: i64 = 1024 |
functions
| 54 | func 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 } |
| 55 | func cg_catn(d: *u8, o: i64, v: i64) -> i64 { let p: i64 = nxi_buf(d, o, v); d[p] = 0 as u8; return p } |
| 56 | func cg_path(name: *u8) -> *u8 |
| 63 | func cg_write(path: *u8, s: *u8) -> i64 called by 4: cg_write_confcg_write_conf_tierscg_write_receipt_tiersmain calls 3: sys_openat_wrsys_writesys_close |
| 72 | func cg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 74 | func cg_count(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: main |
| 89 | func cg_field(buf: *u8, n: i64, key: *u8) -> i64 called by 1: main |
| 119 | func cg_fixture_png(path: *u8, r: i64, g: i64, b: i64) -> i64 |
| 137 | func cg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, ol: *i64) -> i64 |
| 151 | func cg_write_conf(path: *u8, receipt: *u8, fs: i64) -> i64 |
| 163 | func cg_write_conf_tiers(path: *u8, receipt: *u8, fs: i64, t1: *u8, t2: *u8) -> i64 |
| 173 | func cg_write_receipt_tiers(path: *u8, floor: i64, tiers_admitted: *u8) -> i64 |
| 183 | func main(argc: i64, argv: *i64) -> i64 |