code wiki / (root) / nx_charjudge_lib.nx

nx_charjudge_lib.nx

buildroot/runtime/nx_charjudge_lib.nx

15879 B432 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_charjudge_lib.nx nx_charjudge.nx nx_charjudge_gate.nx

imports: nx_syscalls.nx

imported by: nx_charjudge.nxnx_charjudge_gate.nx

structs

none

consts

16const CHJ_CELL: i64 = 16
17const CHJ_BUCKETS: i64 = 4096
18const CHJ_CAND_MAX: i64 = 128
19const CHJ_MAGIC_65536: i64 = 65536
20const CHJ_C_SMOOTH_T: i64 = 0
21const CHJ_C_DETAIL_T: i64 = 1
22const CHJ_C_SMOOTH_DIV: i64 = 2
23const CHJ_C_DETAIL_DIV: i64 = 3
24const CHJ_C_PAL_DIV: i64 = 4
25const CHJ_C_EDGE_T: i64 = 5
26const CHJ_C_RUN_MIN: i64 = 6
27const CHJ_C_COH_DIV: i64 = 7
28const CHJ_C_EYE_T: i64 = 8
29const CHJ_C_FACE_REQ: i64 = 9
30const CHJ_NCONF: i64 = 10

functions

32func chj_conf_defaults(cf: *i64) -> i64
called by 1: chj_conf_load
45func chj_keyeq(buf: *u8, at: i64, end: i64, key: *u8) -> i64
called by 1: chj_slot_for
58func chj_slot_for(buf: *u8, at: i64, end: i64) -> i64
called by 1: chj_conf_load calls 1: chj_keyeq
71func chj_conf_load(path: *u8, cf: *i64) -> i64
118func chj_luma(fb: *i64, w: i64, h: i64, luma: *i64) -> i64
called by 1: chj_judge
132func chj_cells(luma: *i64, w: i64, h: i64, cf: *i64, outp: *i64) -> i64
called by 1: chj_judge
174func chj_palette(fb: *i64, w: i64, h: i64) -> i64
called by 1: chj_judge calls 1: sys_mmap
196func chj_contour(luma: *i64, w: i64, h: i64, cf: *i64, outp: *i64) -> i64
called by 1: chj_judge calls 1: sys_mmap
299func chj_face_scan(l: *i64, w: i64, h: i64, cf: *i64) -> i64
called by 1: chj_face calls 1: sys_mmap
359func chj_face(luma: *i64, w: i64, h: i64, cf: *i64) -> i64
called by 1: chj_judge calls 2: sys_mmapchj_face_scan
395func chj_judge(fb: *i64, w: i64, h: i64, confpath: *u8, out: *i64) -> i64