nx_charjudge_lib.nx
buildroot/runtime/nx_charjudge_lib.nx
about
nx_charjudge_lib.nx -- CHARACTER-IMAGE JUDGE v2 core (operator 2026-08-04: "eat the debt and build to
actually get to sota"). v1 (composition-bimodality x palette) reproduced the human ordering and killed the
patch-scramble that fooled ns_assess -- but had a NAMED gameable vector: a designed smooth+noise+palette
collage. v2 adds the axes that close it:
CONTOUR COHERENCE -- permil of edge pixels on runs >= run_min (row+col propagation). A scramble cannot
carry a contour past its patch size; per-pixel noise has edges but no runs.
FACE PRESENCE -- multi-scale center-surround dark-blob (iris/pupil class, anime AND photo) + PAIR geometry
(two compact blobs, level, spaced). No face = capability floor 0 (a blob with no face is not 40pc of a
character). Ring compactness (all 8 ring points lighter) rejects line-art edges.
HEADLINE = MIN(composition, palette, contour, face). Thresholds = CONF ROWS (knowledge/charjudge.conf,
key=value, # comments; code defaults = the 2026-08-04 battery calibration) per rules 11+17.
All integer, zero third-party. Plain-if only in this lib (imported-else parser landmine, debt 1784673261).
Buffers are mmap-per-call, bounded by call count (CLI=1, gate<16) -- not a daemon lib.
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_charjudge.nxnx_charjudge_gate.nx
structs
| none |
consts
| 16 | const CHJ_CELL: i64 = 16 |
| 17 | const CHJ_BUCKETS: i64 = 4096 |
| 18 | const CHJ_CAND_MAX: i64 = 128 |
| 19 | const CHJ_MAGIC_65536: i64 = 65536 |
| 20 | const CHJ_C_SMOOTH_T: i64 = 0 |
| 21 | const CHJ_C_DETAIL_T: i64 = 1 |
| 22 | const CHJ_C_SMOOTH_DIV: i64 = 2 |
| 23 | const CHJ_C_DETAIL_DIV: i64 = 3 |
| 24 | const CHJ_C_PAL_DIV: i64 = 4 |
| 25 | const CHJ_C_EDGE_T: i64 = 5 |
| 26 | const CHJ_C_RUN_MIN: i64 = 6 |
| 27 | const CHJ_C_COH_DIV: i64 = 7 |
| 28 | const CHJ_C_EYE_T: i64 = 8 |
| 29 | const CHJ_C_FACE_REQ: i64 = 9 |
| 30 | const CHJ_NCONF: i64 = 10 |
functions
| 32 | func chj_conf_defaults(cf: *i64) -> i64 called by 1: chj_conf_load |
| 45 | func chj_keyeq(buf: *u8, at: i64, end: i64, key: *u8) -> i64 called by 1: chj_slot_for |
| 58 | func chj_slot_for(buf: *u8, at: i64, end: i64) -> i64 |
| 71 | func chj_conf_load(path: *u8, cf: *i64) -> i64 |
| 118 | func chj_luma(fb: *i64, w: i64, h: i64, luma: *i64) -> i64 called by 1: chj_judge |
| 132 | func chj_cells(luma: *i64, w: i64, h: i64, cf: *i64, outp: *i64) -> i64 called by 1: chj_judge |
| 174 | func chj_palette(fb: *i64, w: i64, h: i64) -> i64 |
| 196 | func chj_contour(luma: *i64, w: i64, h: i64, cf: *i64, outp: *i64) -> i64 |
| 299 | func chj_face_scan(l: *i64, w: i64, h: i64, cf: *i64) -> i64 |
| 359 | func chj_face(luma: *i64, w: i64, h: i64, cf: *i64) -> i64 |
| 395 | func chj_judge(fb: *i64, w: i64, h: i64, confpath: *u8, out: *i64) -> i64 |