code wiki / _hdl_build / nx_overnight.nx

nx_overnight.nx

buildroot/runtime/_hdl_build/nx_overnight.nx

9548 B149 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_overnight.nx -- UNSUPERVISED overnight runner: the team mines a large search space in chunks, beat after beat, banking what it finds and JOURNALING every beat to a log the operator + Claude review in the morning. Resource-bounded (a parallel pool of K workers, each a fork whose RAM is reclaimed on exit) so it runs all night without growing. Each beat also EXEC-VERIFIES a sample, so any correctness regression is logged as an ISSUE to address. The operator kicks it off (background it / loop the binary); Claude reads the journal next day to critique + build the team up. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_mulchain_deep.nx nx_superopt_emit.nx nx_engineer_crash.nx nx_syscalls.nx nx_overnight.nx

imports: nx_mulchain_deep.nxnx_superopt_emit.nxnx_engineer_crash.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 sys_mmap ov_main ov_puts sys_write ov_slen ov_shared ov_ingest sys_mmap ↻ sys_fork ov_work sys_mmap ↻ mc_cost_select mulchain_deep_verified mulchain_find_deep mc_eval sg_decide sys_exit sys_wait4 ov_verify sys_mmap ↻ mulchain_find mc_abs mc_enum mc_avslot mc_abs ↻ mc_enum ↻ se_emit_full se_str se_num se_emit_synth so_is_shift se_str ↻ se_rn se_num ↻ se_slot_isreg se_slot se_str ↻ se_rn ↻ se_opmn

structs

none

consts

13const K_MAGIC_8192: i64 = 8192
14const K_MAGIC_20000: i64 = 20000

functions

16func ov_shared(size: i64) -> *u8 { let r: i64 = __syscall(SYS_MMAP, 0, size, 3, 0x21, 0 - 1, 0); return r as *u8 }
called by 1: ov_main
23func ov_work(c: i64) -> i64 { let op: *i64 = sys_mmap(8*20) as *i64; let a: *i64 = sys_mmap(8*20) as *i64; let b: *i64 = sys_mmap(8*20) as *i64; return mc_cost_select(c, 5, 3, op, a, b) }
called by 1: ov_ingest calls 2: sys_mmapmc_cost_select
26func ov_ingest(lo: i64, hi: i64, K: i64, bank: *u8) -> i64
45func ov_verify(c: i64) -> i64
57func ov_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
58func ov_puts(s: *u8) -> i64 { sys_write(1, s, ov_slen(s)); return 0 }
called by 1: ov_main calls 2: sys_writeov_slen
59func ov_pn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 }
62func ov_jline(buf: *u8, s: *u8) -> i64 { var n: i64 = 0; var oi: i64 = 0; while buf[oi] != (0 as u8) { oi = oi + 1 } while s[n] != (0 as u8) { buf[oi] = s[n]; oi = oi + 1; n = n + 1 } buf[oi] = 0 as u8; return 0 }
called by 2: ov_jrecov_esc
63func ov_jnum(buf: *u8, v: i64) -> i64 { var oi: i64 = 0; while buf[oi] != (0 as u8) { oi = oi + 1 } let t: *u8 = sys_mmap(28); var m: i64=v; var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var z: i64=0; while z<k {buf[oi]=t[k-1-z]; oi=oi+1; z=z+1} buf[oi]=0 as u8; return 0 }
called by 2: ov_jrecov_esc calls 1: sys_mmap
65func ov_jrec(beat: i64, lo: i64, hi: i64, chainwin: i64, imulwin: i64, vok: i64) -> i64
82func ov_esc(typ: *u8, detail: *u8, a: i64, b: i64) -> i64
93func ov_main(r: *i64) -> i64
140func main() -> i64