code wiki / (root) / nx_gen_blockbench.nx

nx_gen_blockbench.nx

buildroot/runtime/nx_gen_blockbench.nx

10339 B236 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind benchtopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_blockbench.nx -- SOVEREIGN runner for the whole gen verification suite. NO SHELL. Walks a complete DiT block op by op, running each verifier organ and reporting a table. This replaces the _block.sh / _suite.sh scaffolding: the suite definition, the argument vectors, the process spawning and the scoring all live in one NishiLang organ. The only third-party thing left in the loop was /bin/sh, and a sovereign stack that needs a POSIX shell to prove it works has not finished the job. Usage: nx_gen_blockbench <model_id> [elf_dir] Spawns each organ with sys_fork + sys_execve and collects its exit code -- the same fork/exec primitives the estate already uses for its worker pools. It does NOT re-implement the checks: each organ stays independently runnable, so a single failing op can still be re-run alone with the exact arguments printed here. THE CHAIN (Z-Image block 0; every step's reference is an oracle dump from stable-diffusion.cpp): blk_in -[prenorm+mod ch0]- h_attn -[qkv]- qkv -[qk-norm]- q/k -[RoPE]- -[SDPA]- ao_pre -[out proj]- attn_out -[rmsnorm]- attn_norm2 -[gate ch1]- mid -[prenorm+mod ch2]- h_ffn -[w1][w3]- -[swiglu]- ffn_act -[w2]- ffn_down -[rmsnorm]- ffn_norm2 -[gate ch3]- layers.1.blk_in license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_strconv.nx nx_gen_blockbench.nx

imports: nx_syscalls.nxnx_strconv.nx

imported by: nobody (leaf or entry point)

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

main bb_puts sys_write bb_step bb_puts ↻ bb_pad sys_write ↻ bb_run sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_fork sys_execve sys_exit ↻ sys_wait4 wait_exit_code bb_elf_path sys_mmap ↻ bb_num sys_mmap ↻ nx_strconv_format_i64 sys_write ↻ bb_args sys_mmap ↻ bb_num ↻

structs

none

consts

26const NX_BB_MAX_ARGS: i64 = 16

functions

28func bb_puts(s: *u8) -> i64
called by 2: bb_stepmain calls 1: sys_write
34func bb_num(v: i64) -> i64
40func bb_pad(s: *u8, width: i64) -> i64
called by 1: bb_step calls 1: sys_write
50func bb_elf_path(dir: *u8, organ: *u8) -> *u8
called by 1: bb_step calls 1: sys_mmap
67func bb_run(elf: *u8, argv_tail: *i64) -> i64
93func bb_args(a0: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8, a8: *u8) -> *i64
called by 1: main calls 1: sys_mmap
112func bb_step(label: *u8, dir: *u8, organ: *u8, args: *i64) -> i64
128func main(argc: i64, argv: *i64) -> i64