code wiki / (root) / nx_charjudge_census.nx

nx_charjudge_census.nx

buildroot/runtime/nx_charjudge_census.nx

79158 B1576 linesdepth 11pulls 56 transitivereach 0 importersview sourcekind tooltopic charjudge
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_tool_run.nx nx_img_to_rgb.nx nx_png_write.nx nx_nxfh_lib.nx nx_color_v2.nx nx_charjudge_census.nx

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

main cjx_p sys_write cjx_streq cjp_lens 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 ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close cjp_conf_int cjx_slen cjp_nl cjp_conf_str cjx_slen ↻ cjp_nl ↻ sys_mmap ↻ nx_img_to_rgb sys_mmap ↻ sys_read_file ↻ nx_img_bytes_to_rgb sys_mmap ↻ nx_jpeg_decode_rgb

structs

none

consts

62const CJX_PATHCAP: i64 = 1024
63const CJX_OUTCAP: i64 = 8192
64const CJX_TIMEOUT_MS: i64 = 60000
65const CJX_ARGV_SLOTS: i64 = 4
66const CJX_HASH: i64 = 35
67const CJX_NL: i64 = 10
68const CJX_CR: i64 = 13
69const CJX_TAB: i64 = 9
70const CJX_D0: i64 = 48
71const CJX_D9: i64 = 57
72const CJX_MINUS: i64 = 45
73const CJX_PERMIL_MAX: i64 = 1000
76const CJP_UNOBS: i64 = 0 - 9999 // a lens that could not see: abstain, never acquit
77const CJP_CONFCAP: i64 = 65536
78const CJP_RECEIPTCAP: i64 = 4096
79const CJP_CHILD_ARGV: i64 = 5
80const CJP_CHILD_OUTCAP: i64 = 16384
81const CJP_LABEL_GOOD: i64 = 1
82const CJP_LABEL_BAD: i64 = 0
83const CJP_LABEL_NONE: i64 = 0 - 1
84const CJP_FNV_BASIS: i64 = 2166136261
85const CJP_FNV_PRIME: i64 = 16777619
86const CJP_FNV_MASK: i64 = 4294967295
87const CJP_MODE_644: i64 = 420
88const CJP_BYTE: i64 = 256
89const CJP_LENSES: i64 = 5 // stats skin sym percept vlm
90const CJP_SKRULES: i64 = 3 // kovac | chroma | locus -- every run reports all three
91const CJP_SK_KOVAC: i64 = 0
92const CJP_SK_CHROMA: i64 = 1
93const CJP_SK_LOCUS: i64 = 2
94const CJP_L_STATS: i64 = 0
95const CJP_L_SKIN: i64 = 1
96const CJP_L_SYM: i64 = 2
97const CJP_L_PERCEPT: i64 = 3
98const CJP_L_VLM: i64 = 4
101const CJP_DEF_PERCEPT_W: i64 = 400
102const CJP_DEF_PERCEPT_H: i64 = 240
103const CJP_DEF_CENTER_PERMIL: i64 = 500
104const CJP_DEF_BG_TOL: i64 = 24
105const CJP_DEF_CROP_MARGIN_PERMIL: i64 = 50 // figcrop margin = 5 percent of the larger bbox side (conf: crop_margin_permil)
106const CJP_DEF_BG_INSET_PX: i64 = 4 // background sampled this far inside each corner (conf: bg_inset_px) --
108const CJP_DEF_EDGE_IGNORE_PX: i64 = 2 // figcrop ignores this edge ring when scanning for figure pixels (conf)
588const CJP_TIERS: i64 = 4
589const CJP_T_SIL: i64 = 0
590const CJP_T_CLAY: i64 = 1
591const CJP_T_TEX: i64 = 2
592const CJP_T_PHOTO: i64 = 3

functions

110func 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 }
111func cjx_n(v: i64) -> i64 { nxi_out(v); return 0 }
112func cjx_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
113func 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 }
114func cjx_catn(d: *u8, o: i64, v: i64) -> i64
called by 2: cjp_floor_strcjc_panel calls 1: sys_mmap
126func cjx_streq(a: *u8, b: *u8) -> i64
137func cjx_field(buf: *u8, n: i64, key: *u8) -> i64
173func cjx_sfield(buf: *u8, n: i64, key: *u8, absent: i64) -> i64
called by 2: cjp_lenscjc_panel
208func cjp_nl(b: *u8, at: i64) -> i64 { if (b[at] as i64) == CJX_NL { return 1 } return 0 }
212func cjp_conf_int(cf: *u8, n: i64, key: *u8, def: i64, found: *i64) -> i64
249func cjp_conf_str(cf: *u8, n: i64, key: *u8, def: *u8) -> *u8
282func cjp_fnv(s: *u8) -> i64
called by 1: cjp_lens
292func cjp_hex8(d: *u8, o: i64, v: i64) -> i64
called by 1: cjp_lens
308func cjp_corner_bg(rgb: *u8, w: i64, h: i64, inset: i64, out3: *i64) -> i64
called by 2: cjp_lenscjp_figcrop
339func cjp_lens(path: *u8, confp: *u8) -> i64
593func cjp_tier_of(s: *u8) -> i64
called by 1: cjc_panel calls 1: cjx_streq
600func cjp_tier_name(t: i64) -> *u8
607func cjp_lens_name(li: i64) -> *u8
616func cjp_tier_key(d: *u8, li: i64, t: i64) -> i64
625func cjp_tierset_str(d: *u8, o: i64, seen: *i64) -> i64
called by 1: cjc_panel calls 2: cjx_catcjp_tier_name
642func cjp_tierset_has(s: *u8, name: *u8) -> i64
called by 1: cjc_panel
666func cjp_floor_str(d: *u8, o: i64, has: i64, v: i64) -> i64
called by 1: cjp_floors_line calls 2: cjx_catcjx_catn
670func cjp_floors_line(d: *u8, o: i64, has: *i64, fl: *i64) -> i64
called by 1: cjc_panel calls 2: cjx_catcjp_floor_str
691func cjp_receipt_admits(rpath: *u8, floors: *u8, slens: *u8, srule: *u8, on_list: *i64, tadm: *i64) -> i64
717func cjc_panel(selfp: *u8, listp: *u8, confp: *u8, mode: i64) -> i64
1333func cjp_topng(inp: *u8, outp: *u8) -> i64
1353func cjp_figcrop(inp: *u8, outp: *u8, confp: *u8) -> i64
1450func main(argc: i64, argv: *i64) -> i64