code wiki / _hdl_build / nx_ladder_tick.nx

nx_ladder_tick.nx source

↩ module page · 38 lines · 1880 B

1// nx_ladder_tick.nx -- ONE AUTONOMOUS TICK of the S-class-exceed ladder loop (team-owned, NO Claude): 2// 1. run the WIRED horizontal gates (bench races vs the C lane on the runner-built corpus) 3// 2. (their BENCH lines append to /tmp/nishi_ladder.log) 4// 3. regenerate the wiki ladder page (/tmp/ladder.html) from the log 5// The polite daemon (nx_polite_daemon) calls THIS each beat -> gates run, grades refresh, page 6// regenerates -- the whole vertical+horizontal program self-running. Exec spine = existing sovereign 7// ELFs only. Exit = count of failed steps (0 = clean tick). license_tier: ORIGINAL 8import "nx_syscalls.nx" 9 10func lt_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 11 12func lt_run1(path: *u8, a1: *u8) -> i64 { 13 let envp: *i64 = sys_mmap(32) as *i64 14 envp[0] = "PATH=/usr/bin:/bin" as *u8 as i64; envp[1] = 0 15 let av: *i64 = sys_mmap(40) as *i64 16 av[0] = path as i64; av[1] = a1 as i64; av[2] = 0 17 if (a1 as i64) == 0 { av[1] = 0 } 18 let pid: i64 = sys_fork() 19 if pid == 0 { sys_execve(path, av, envp); sys_exit(127) } 20 let st: *i64 = sys_mmap(16) as *i64 21 sys_wait4(pid, st, 0) 22 let sig: i64 = st[0] & 0x7f 23 if sig != 0 { return 128 + sig } 24 return (st[0] >> 8) & 0xff 25} 26 27func main() -> i64 { 28 var fails: i64 = 0 29 lt_w("[ladder-tick] gates...\n" as *u8) 30 if lt_run1("/tmp/nx_bench_vs_c.sov.elf" as *u8, "nx_mmap_probe" as *u8) != 0 { fails = fails + 1 } 31 if lt_run1("/tmp/nx_bench_vs_c.sov.elf" as *u8, "nx_ladder_page" as *u8) != 0 { fails = fails + 1 } 32 lt_w("[ladder-tick] publish...\n" as *u8) 33 if lt_run1("/tmp/nx_ladder_page.sov.elf" as *u8, 0 as *u8) != 0 { fails = fails + 1 } 34 lt_w("[ladder-tick] fails=" as *u8) 35 let b: *u8 = sys_mmap(8); b[0] = (48 + fails) as u8 36 sys_write(1, b, 1); lt_w("\n" as *u8) 37 sys_exit(fails); return fails 38}