code wiki / _hdl_build / nx_research_sim_gate.nx

nx_research_sim_gate.nx

buildroot/runtime/_hdl_build/nx_research_sim_gate.nx

8256 B140 linesdepth 10pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic research
docsdependenciesstructsconstsfunctions

about

nx_research_sim_gate.nx -- the RESEARCH-ENGINE reproducibility loop, end to end and sovereign (operator: "discover new capabilities through different math/chemistry/physics via simulations we run... s class exceed on research capabilities AND their reproducibility"). The loop: RESEARCHER -> locates the relevant knowledge in our foundationed no-link-rot library (the AlphaTensor doc: "Discovering faster matrix multiplication"). TESTING-TEAM -> runs a SOVEREIGN simulation that REPRODUCES a KNOWN published result -- Strassen's 1969 algorithm: a 2x2 matrix product in 7 scalar multiplications instead of the naive 8 -- and proves it bit-exact against the canonical hand-checkable answer AND over many random matrices, while COUNTING the multiplications (7 vs 8 = the discovered efficiency). VERIFIER -> the exact-comparison check that a discovery loop needs: a BROKEN candidate scheme is REJECTED (liar-kill), so "this scheme is correct" can never be rubber-stamped. Pure integer algebra (no float), deterministic PRNG (reproducible by anyone running it), no 3rd party. This is the substrate the alphatensor-class search needs: propose a low-mult scheme -> verify exactness here. GREEN iff 6/6. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_library.nx nx_research_sim_gate.nx

imports: nx_syscalls.nxnx_library.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 g_w sys_write rs_lib_contains sys_mmap ↻ lib_list cat_list ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 ssc_retire_handle cat_idx_load sys_mmap ↻ ss_hget sys_mmap ↻ ss_idx_find cat_idx_key lib_get cat_get ar_get_by_cid ss_open_cached ↻ ss_hget ↻ rs_has mm_naive rs_mul mm_strassen rs_mul ↻ mm_strassen_broken rs_mul ↻ g_n g_w ↻ sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

18func g_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 3: g_ng_rowmain calls 1: sys_write
19func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-");m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1}; sys_write(1,o,k); return 0 }
called by 1: main calls 3: g_wsys_mmapsys_write
20func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" "); g_w(id); g_w(": "); if ok==1 { g_w("OK\n"); pass[0]=pass[0]+1 } else { g_w("FAIL\n") } return 0 }
called by 1: main calls 1: g_w
23func rs_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: rs_lib_contains
31func rs_lib_contains(needle: *u8) -> i64
called by 1: main calls 4: sys_mmaplib_listlib_getrs_has
44func rs_mul(cnt: *i64, a: i64, b: i64) -> i64 { cnt[0] = cnt[0] + 1; return a * b }
47func mm_naive(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64
called by 1: main calls 1: rs_mul
55func mm_strassen(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64
called by 1: main calls 1: rs_mul
70func mm_strassen_broken(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64
called by 1: main calls 1: rs_mul
85func rs_rng(state: *i64) -> i64 { var x: i64 = state[0]; x = x ^ (x << 13); x = x ^ (x >> 7); x = x ^ (x << 17); state[0] = x; return x }
called by 1: main
86func mm_eq(x: *i64, y: *i64) -> i64 { if x[0]!=y[0]{return 0} if x[1]!=y[1]{return 0} if x[2]!=y[2]{return 0} if x[3]!=y[3]{return 0} return 1 }
called by 1: main
88func main() -> i64