nx_charjudge_census.nx
buildroot/runtime/nx_charjudge_census.nx
about
nx_charjudge_census.nx -- THE CHARACTER REFEREE AS A STANDING INSTRUMENT: judge an ENTIRE named corpus in
one call, one line per image, with the partition reconciled -- AND (2026-08-19, GR1 of /compare/graphics,
Phase 0 of the past-MetaHuman roadmap) THE JUDGE PANEL `cjc_panel`: a multi-lens referee that can see
what the single statistics judge is proven blind to.
WHY IT EXISTS: the judge was a single-image CLI, so grading a corpus meant one invocation per file. That
cost is exactly what turns "measure the population" into "measure a sample", and a tooling gap is never a
licence to sample. The whole render corpus is now one call.
WHY THE PANEL EXISTS (measured 2026-08-16, both directions): nx_charjudge scored a GREEN CLAY figure crop
257 (the operator saw gumby) and a smooth photoreal-class splat render 0 ("smooth = no detail"). Its axes
(composition, palette, contour, face) are hue- and semantics-agnostic BY CONSTRUCTION, so every fidelity
claim graded through it alone is ungradeable. The panel COMPOSES incumbents, never re-implements:
stats = ./nx_charjudge.elf (the statistics judge, forked -- the artifact that ships)
skin = nx_color_kovac_skin_pixel (Kovac 2003 published skin gamut, over the figure / centre)
sym = ./nx_image_beauty.elf path (bilateral symmetry Q1000, forked)
percept = ./nx_percept.elf judge (RELATIVE perceptual position vs the 10 human-confirmed
commercial frames minus the junk controls; admitted only
while its own ladder reproduces the human ordering)
vlm = UNOBSERVABLE (no sovereign VLM oracle exists on the estate -- measured
2026-08-19 by tree grep + local probe; the slot abstains,
it never acquits)
THE LAW THE PANEL IS BUILT UNDER: AN UNCALIBRATED CLASSIFIER REPORTS NUMBERS, NEVER VERDICTS. `panel`
prints every lens value for every image always; it prints a GOOD/BAD verdict ONLY while an admission
receipt written by `calibrate` says FP=0 and FN=0 on a LABELLED corpus with both classes present -- and
the receipt is bound to the exact floors it was measured at, so editing the conf silently un-admits.
Floors are DATA (knowledge/cjc_panel.conf), never literals here. A lens with no floor in the conf is
REPORT-ONLY (printed, not voting): that is how a lens proven blind is retired from the vote by evidence.
Composite = AND over voting lenses (the MIN-headline doctrine: no lens may be compensated by another).
WHY IT FORKS rather than looping in-process: chj_judge allocates several w*h*8 working buffers per frame,
so an in-process sweep multiplies every one of them by the corpus size -- measured, that is gigabytes of
address space on a box already sitting at 727 permil swap. A child returns its entire working set to the
OS on exit, so peak RSS is ONE frame regardless of corpus size. Forking also means this census measures
the artifact that ACTUALLY SHIPS rather than a second compiled copy of the same lib: if the promoted
binary is stale or missing, that surfaces here instead of being hidden by an identical rebuild.
The panel keeps that design: the parent forks ITSELF (`lens <path> <conf>`) per image; the child decodes
once (nx_img_to_rgb: PNG/JPEG/GIF/WebP-lossless/BMP/...), computes the in-process lenses on a bounded
fit-resampled frame, forks the three sibling judges, and prints ONE anchored line.
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_tool_run.nxnx_img_to_rgb.nxnx_png_write.nxnx_nxfh_lib.nxnx_color_v2.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
| 62 | const CJX_PATHCAP: i64 = 1024 |
| 63 | const CJX_OUTCAP: i64 = 8192 |
| 64 | const CJX_TIMEOUT_MS: i64 = 60000 |
| 65 | const CJX_ARGV_SLOTS: i64 = 4 |
| 66 | const CJX_HASH: i64 = 35 |
| 67 | const CJX_NL: i64 = 10 |
| 68 | const CJX_CR: i64 = 13 |
| 69 | const CJX_TAB: i64 = 9 |
| 70 | const CJX_D0: i64 = 48 |
| 71 | const CJX_D9: i64 = 57 |
| 72 | const CJX_MINUS: i64 = 45 |
| 73 | const CJX_PERMIL_MAX: i64 = 1000 |
| 76 | const CJP_UNOBS: i64 = 0 - 9999 // a lens that could not see: abstain, never acquit |
| 77 | const CJP_CONFCAP: i64 = 65536 |
| 78 | const CJP_RECEIPTCAP: i64 = 4096 |
| 79 | const CJP_CHILD_ARGV: i64 = 5 |
| 80 | const CJP_CHILD_OUTCAP: i64 = 16384 |
| 81 | const CJP_LABEL_GOOD: i64 = 1 |
| 82 | const CJP_LABEL_BAD: i64 = 0 |
| 83 | const CJP_LABEL_NONE: i64 = 0 - 1 |
| 84 | const CJP_FNV_BASIS: i64 = 2166136261 |
| 85 | const CJP_FNV_PRIME: i64 = 16777619 |
| 86 | const CJP_FNV_MASK: i64 = 4294967295 |
| 87 | const CJP_MODE_644: i64 = 420 |
| 88 | const CJP_BYTE: i64 = 256 |
| 89 | const CJP_LENSES: i64 = 5 // stats skin sym percept vlm |
| 90 | const CJP_SKRULES: i64 = 3 // kovac | chroma | locus -- every run reports all three |
| 91 | const CJP_SK_KOVAC: i64 = 0 |
| 92 | const CJP_SK_CHROMA: i64 = 1 |
| 93 | const CJP_SK_LOCUS: i64 = 2 |
| 94 | const CJP_L_STATS: i64 = 0 |
| 95 | const CJP_L_SKIN: i64 = 1 |
| 96 | const CJP_L_SYM: i64 = 2 |
| 97 | const CJP_L_PERCEPT: i64 = 3 |
| 98 | const CJP_L_VLM: i64 = 4 |
| 101 | const CJP_DEF_PERCEPT_W: i64 = 400 |
| 102 | const CJP_DEF_PERCEPT_H: i64 = 240 |
| 103 | const CJP_DEF_CENTER_PERMIL: i64 = 500 |
| 104 | const CJP_DEF_BG_TOL: i64 = 24 |
| 105 | const CJP_DEF_CROP_MARGIN_PERMIL: i64 = 50 // figcrop margin = 5 percent of the larger bbox side (conf: crop_margin_permil) |
| 106 | const CJP_DEF_BG_INSET_PX: i64 = 4 // background sampled this far inside each corner (conf: bg_inset_px) -- |
| 108 | const CJP_DEF_EDGE_IGNORE_PX: i64 = 2 // figcrop ignores this edge ring when scanning for figure pixels (conf) |
| 588 | const CJP_TIERS: i64 = 4 |
| 589 | const CJP_T_SIL: i64 = 0 |
| 590 | const CJP_T_CLAY: i64 = 1 |
| 591 | const CJP_T_TEX: i64 = 2 |
| 592 | const CJP_T_PHOTO: i64 = 3 |
functions
| 110 | func cjx_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 111 | func cjx_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 112 | func cjx_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 113 | func cjx_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 } |
| 114 | func cjx_catn(d: *u8, o: i64, v: i64) -> i64 |
| 126 | func cjx_streq(a: *u8, b: *u8) -> i64 |
| 137 | func cjx_field(buf: *u8, n: i64, key: *u8) -> i64 |
| 173 | func cjx_sfield(buf: *u8, n: i64, key: *u8, absent: i64) -> i64 |
| 208 | func cjp_nl(b: *u8, at: i64) -> i64 { if (b[at] as i64) == CJX_NL { return 1 } return 0 } |
| 212 | func cjp_conf_int(cf: *u8, n: i64, key: *u8, def: i64, found: *i64) -> i64 |
| 249 | func cjp_conf_str(cf: *u8, n: i64, key: *u8, def: *u8) -> *u8 |
| 282 | func cjp_fnv(s: *u8) -> i64 called by 1: cjp_lens |
| 292 | func cjp_hex8(d: *u8, o: i64, v: i64) -> i64 called by 1: cjp_lens |
| 308 | func cjp_corner_bg(rgb: *u8, w: i64, h: i64, inset: i64, out3: *i64) -> i64 |
| 339 | func cjp_lens(path: *u8, confp: *u8) -> i64 |
| 593 | func cjp_tier_of(s: *u8) -> i64 |
| 600 | func cjp_tier_name(t: i64) -> *u8 |
| 607 | func cjp_lens_name(li: i64) -> *u8 |
| 616 | func cjp_tier_key(d: *u8, li: i64, t: i64) -> i64 |
| 625 | func cjp_tierset_str(d: *u8, o: i64, seen: *i64) -> i64 |
| 642 | func cjp_tierset_has(s: *u8, name: *u8) -> i64 called by 1: cjc_panel |
| 666 | func cjp_floor_str(d: *u8, o: i64, has: i64, v: i64) -> i64 |
| 670 | func cjp_floors_line(d: *u8, o: i64, has: *i64, fl: *i64) -> i64 |
| 691 | func cjp_receipt_admits(rpath: *u8, floors: *u8, slens: *u8, srule: *u8, on_list: *i64, tadm: *i64) -> i64 |
| 717 | func cjc_panel(selfp: *u8, listp: *u8, confp: *u8, mode: i64) -> i64 |
| 1333 | func cjp_topng(inp: *u8, outp: *u8) -> i64 |
| 1353 | func cjp_figcrop(inp: *u8, outp: *u8, confp: *u8) -> i64 |
| 1450 | func main(argc: i64, argv: *i64) -> i64 |