code wiki / _hdl_build / nx_symjudge.nx
nx_symjudge.nx
buildroot/runtime/_hdl_build/nx_symjudge.nx
about
nx_symjudge.nx -- THE SYMBOLIC JUDGE (autonomous-builder lane, 2026-07-20). The non-LLM half of
the neuro-symbolic builder loop: a maker's patch that PASSES the baked tests can still be wrong on
every untested input (the overfit-patch class) or crash on edge inputs. This organ judges ONE pure
integer function against a DATA-DRIVEN property contract (a symprop- plane row, store-law: no flat
files) by GENERATING a sweep harness, compiling it fresh with the sovereign toolchain, running it:
- domain fits budget -> EXHAUSTIVE sweep = bounded-model-check style proof over the whole domain
- larger -> deterministic stride sample (never random-flaky; step derived from budget)
- crash/SIGFPE/no-output -> RED (the fuzz-crash finding class, sovereign + deterministic)
Property NAMES are plane data (odd,even,fix0,lin2,idem,mono,nocrash,range:a:b,comm,idem2);
checker bodies are code here; domains/budget live in the row (rule 11: no magic numbers).
symprop- row schema (7 col, tab): fn arity lo hi budget props note
Verdict: SYMJUDGE fn=<f> mode=EXH|SAMP checked=<n> viol=<v> verdict=GREEN|RED [reason=...]
exit: 0 GREEN | 1 property violation | 2 crash-or-nocompile | 3 refused (fail-closed)
argv: <srcfile> <fn> <planeprefix> [harnessname] (harness written runtime/<name>.nx)
v1 scope: the judged fn must be self-contained (no calls into other candidate fns) -- the
multi-fn closure extraction is a filed rung, not silently wrong (unknown props REFUSE too).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 5 imports · 0 importers
imports: nx_store_seed_lib.nxnx_itoa_lib.nxnx_seg_store.nxnx_deploy_lib.nxnx_syscalls.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
| 24 | const SJ_ROWCAP: i64 = 65536 |
| 25 | const SJ_FNCAP: i64 = 8192 |
| 26 | const SJ_HCAP: i64 = 131072 |
| 27 | const SJ_CAPCAP: i64 = 262144 |
| 28 | const SJ_TAB: i64 = 9 |
| 29 | const SJ_NL: i64 = 10 |
| 30 | const SJ_COMMA: i64 = 44 |
| 31 | const SJ_COLON: i64 = 58 |
| 32 | const SJ_QUOTE: i64 = 34 |
| 33 | const SJ_MAXPROPS: i64 = 12 |
| 34 | const SJ_MAXCOLS: i64 = 16 |
| 35 | const SJ_PROPCAP: i64 = 512 |
| 36 | const SJ_PATHCAP: i64 = 256 |
| 37 | const SJ_EXIT_VIOL: i64 = 1 |
| 38 | const SJ_EXIT_CRASH: i64 = 2 |
| 39 | const SJ_EXIT_REFUSE: i64 = 3 |
| 43 | const SJ_TIMEOUT_MS: i64 = 20000 |
| 44 | const SJ_POLL_MS: i64 = 50 |
| 45 | const SJ_TIMEOUT_RC: i64 = 0 - 99 |
| 46 | const SJ_P_ODD: i64 = 1 |
| 47 | const SJ_P_EVEN: i64 = 2 |
| 48 | const SJ_P_FIX0: i64 = 3 |
| 49 | const SJ_P_LIN2: i64 = 4 |
| 50 | const SJ_P_IDEM: i64 = 5 |
| 51 | const SJ_P_MONO: i64 = 6 |
| 52 | const SJ_P_NOCRASH: i64 = 7 |
| 53 | const SJ_P_RANGE: i64 = 8 |
| 54 | const SJ_P_COMM: i64 = 9 |
| 55 | const SJ_P_IDEM2: i64 = 10 |
| 59 | const SJ_P_ANCHOR: i64 = 11 |
| 60 | const SJ_P_ANCHOR2: i64 = 12 |
functions
| 62 | func sj_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 67 | func sj_wn(v: i64) -> i64 { nxi_out(v); return 0 } calls 1: nxi_out |
| 68 | func sj_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 69 | func sj_find(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64 |
| 82 | func sj_slice_eq(q: *u8, a: i64, b: i64, s: *u8) -> i64 |
| 89 | func sj_atoi_span(b: *u8, a0: i64, e: i64) -> i64 called by 1: main |
| 101 | func sj_num_after(b: *u8, n: i64, pat: *u8) -> i64 |
| 115 | func sj_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64 called by 1: main |
| 128 | func sj_extract(path: *u8, name: *u8, fnbuf: *u8) -> i64 |
| 161 | func sj_catsrc_num(d: *u8, o0: i64, v: i64) -> i64 |
| 170 | func sj_catq(d: *u8, o: i64) -> i64 { d[o] = SJ_QUOTE as u8; return o + 1 } called by 1: sj_emit_viol |
| 173 | func sj_emit_viol(hb: *u8, o0: i64, pname: *u8, arity: i64) -> i64 |
| 195 | func sj_refuse(msg: *u8) -> i64 |
| 206 | func sj_run_timed(elfp: *u8, outf: *u8, timeout_ms: i64, poll_ms: i64) -> i64 |
| 236 | func main(argc: i64, argv: *i64) -> i64 |