code wiki / _hdl_build / nx_symjudge.nx

nx_symjudge.nx

buildroot/runtime/_hdl_build/nx_symjudge.nx

29026 B655 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_store_seed_lib.nx nx_itoa_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_symjudge.nx

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

main sj_refuse sj_w sys_write sys_exit sys_mmap sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_cat ↻ ss_loadfile sys_map_file ss_readall ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile ↻ ss_r32 sys_munmap ssl_total_keys ss_r32 ↻ ssl_pow2 ssl_build ss_r32 ↻ ssl_hash_entry ssl_key_eq ss_r32 ↻ ssl_lookup ssl_hash_entry ↻ ssl_key_eq ↻

structs

none

consts

24const SJ_ROWCAP: i64 = 65536
25const SJ_FNCAP: i64 = 8192
26const SJ_HCAP: i64 = 131072
27const SJ_CAPCAP: i64 = 262144
28const SJ_TAB: i64 = 9
29const SJ_NL: i64 = 10
30const SJ_COMMA: i64 = 44
31const SJ_COLON: i64 = 58
32const SJ_QUOTE: i64 = 34
33const SJ_MAXPROPS: i64 = 12
34const SJ_MAXCOLS: i64 = 16
35const SJ_PROPCAP: i64 = 512
36const SJ_PATHCAP: i64 = 256
37const SJ_EXIT_VIOL: i64 = 1
38const SJ_EXIT_CRASH: i64 = 2
39const SJ_EXIT_REFUSE: i64 = 3
43const SJ_TIMEOUT_MS: i64 = 20000
44const SJ_POLL_MS: i64 = 50
45const SJ_TIMEOUT_RC: i64 = 0 - 99
46const SJ_P_ODD: i64 = 1
47const SJ_P_EVEN: i64 = 2
48const SJ_P_FIX0: i64 = 3
49const SJ_P_LIN2: i64 = 4
50const SJ_P_IDEM: i64 = 5
51const SJ_P_MONO: i64 = 6
52const SJ_P_NOCRASH: i64 = 7
53const SJ_P_RANGE: i64 = 8
54const SJ_P_COMM: i64 = 9
55const SJ_P_IDEM2: i64 = 10
59const SJ_P_ANCHOR: i64 = 11
60const SJ_P_ANCHOR2: i64 = 12

functions

62func 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 }
called by 1: sj_refuse calls 1: sys_write
67func sj_wn(v: i64) -> i64 { nxi_out(v); return 0 }
calls 1: nxi_out
68func sj_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
69func sj_find(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64
called by 2: sj_num_aftersj_extract calls 1: sj_slen
82func sj_slice_eq(q: *u8, a: i64, b: i64, s: *u8) -> i64
called by 1: main calls 1: sj_slen
89func sj_atoi_span(b: *u8, a0: i64, e: i64) -> i64
called by 1: main
101func sj_num_after(b: *u8, n: i64, pat: *u8) -> i64
calls 2: sj_findsj_slen
115func sj_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64
called by 1: main
128func sj_extract(path: *u8, name: *u8, fnbuf: *u8) -> i64
161func sj_catsrc_num(d: *u8, o0: i64, v: i64) -> i64
calls 2: ss_catss_catn
170func sj_catq(d: *u8, o: i64) -> i64 { d[o] = SJ_QUOTE as u8; return o + 1 }
called by 1: sj_emit_viol
173func sj_emit_viol(hb: *u8, o0: i64, pname: *u8, arity: i64) -> i64
calls 2: ss_catsj_catq
195func sj_refuse(msg: *u8) -> i64
called by 1: main calls 2: sj_wsys_exit
206func sj_run_timed(elfp: *u8, outf: *u8, timeout_ms: i64, poll_ms: i64) -> i64
236func main(argc: i64, argv: *i64) -> i64