code wiki / _hdl_build / nx_doctor_sov_verify.nx

nx_doctor_sov_verify.nx

buildroot/runtime/_hdl_build/nx_doctor_sov_verify.nx

6792 B135 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic doctor
docsdependenciesstructsconstsfunctions

about

nx_doctor_sov_verify.nx -- the NISHI DOCTOR's one-step batch sovereign verifier (operator: "have the nishi doctor get tutored to do this in one step and less than ten seconds"). ONE invocation builds + runs + reports MANY modules through the pure-sovereign path (nx_cc -> nxasm_x86 -> run, NO gcc, NO .sh, NO shell loop -- the loop is NishiLang, so it never hits the wsl $VAR-mangling trap). Each module: compile (stdout->/tmp/<m>.s, stderr muted, recompile-retry), assemble+link with nxasm_x86_main, run, capture the real exit via sys_wait4. Prints one line per module + a PASS/FAIL summary; exits 0 iff all passed (treats the module's own expect_exit==0 convention). Usage: nx_doctor_sov_verify <module1> <module2> ... license_tier: ORIGINAL Reuses the sovereign spine from nx_sov_build_run.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_doctor_sov_verify.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main dsv_puts sys_write sys_exit sys_mmap sys_openat_wr dsv_build_run_one sys_mmap ↻ dsv_cat sys_openat_rd sys_close sys_openat_wr ↻ dsv_run sys_fork sys_dup3 sys_execve sys_exit ↻ sys_mmap ↻ sys_wait4 dsv_filesize sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ dsv_run_watchdog sys_fork ↻ sys_execve ↻ sys_exit ↻ sys_sleep_ms sys_mmap ↻ sys_munmap nx_kill sys_mmap ↻ sys_wait4 ↻ dsv_putn sys_mmap ↻ sys_write ↻

structs

none

consts

11const DSV_MAGIC_4096: i64 = 4096
13const DSV_MIN_ASM_BYTES: i64 = 128
14const DSV_MAX_RETRIES: i64 = 12
15const DSV_RUN_TIMEOUT_MS: i64 = 8000 // the <10s law: a hung module is KILLED + reported, never waited on

functions

17func dsv_puts(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: main calls 1: sys_write
18func dsv_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m;sys_write(1,"-" as *u8,1)}; 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 }
called by 1: main calls 2: sys_mmapsys_write
19func dsv_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
called by 1: dsv_build_run_one
22func dsv_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64
35func dsv_filesize(path: *u8) -> i64
48func dsv_build_run_one(name: *u8, compiler: *u8, asm_tool: *u8, envp: *i64, devnull: i64) -> i64
86func dsv_run_watchdog(path: *u8, argv: *i64, envp: *i64, timeout_ms: i64) -> i64
107func main(argc: i64, argv: *i64) -> i64