code wiki / _hdl_build / nx_charjudge.nx
nx_charjudge.nx
buildroot/runtime/_hdl_build/nx_charjudge.nx
about
nx_charjudge.nx -- CLI for the v2 character-image judge (core = nx_charjudge_lib, gate =
nx_charjudge_gate). Decodes a PNG sovereignly, judges it, prints all axes as JSON.
HEADLINE = MIN(composition, palette, contour, face) -- see the lib header for why each axis exists
and which adversarial input it kills. Thresholds ride knowledge/charjudge.conf.
license_tier: ORIGINAL nx_charjudge <img.png> <label>
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_png_decoder.nxnx_charjudge_lib.nx
imported by: nx_charjudge_frame_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 21 | const CJG_OK: i64 = 0 |
| 22 | const CJG_NO_LABEL: i64 = 1 // argv[2] absent: the terminator, and the historical crash |
| 23 | const CJG_NO_PATH: i64 = 2 |
| 24 | const CJG_NO_HEADER: i64 = 3 |
| 25 | const CJG_NO_PIXELS: i64 = 4 |
| 26 | const CJG_BAD_DIMS: i64 = 5 // w or h non-positive -- h was never checked before |
| 27 | const CJG_BAD_CHANNELS: i64 = 6 |
| 28 | const CJG_SHORT_BUFFER: i64 = 7 // the decoder returned fewer bytes than w*h*ch implies |
| 29 | const CJG_AREA_OVERFLOW: i64 = 8 // w*h*8 would not fit in i64 |
| 30 | const CJG_ALLOC_FAILED: i64 = 9 |
| 31 | const CJG_N: i64 = 10 |
| 35 | const CJG_MAX_AREA: i64 = 1152921504606846975 |
| 36 | const CJG_MAX_CHANNELS: i64 = 4 |
| 37 | const CJG_EXIT_OK: i64 = 0 |
| 38 | const CJG_EXIT_ABSTAIN: i64 = 4 // distinct from graded(0), read(2) and decode(3): a THIRD state |
functions
| 40 | func cjc_hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 41 | func cjc_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 43 | func cjc_guard_name(c: i64) -> *u8 called by 1: cjc_abstain |
| 60 | func cjc_frame_guard(path_p: i64, label_p: i64, hdr_p: i64, px_p: i64, |
| 76 | func cjc_abstain(label_p: i64, code: i64) -> i64 |
| 83 | func main(argc: i64, argv: *i64) -> i64 |