code wiki / _hdl_build / nx_research_sim_gate.nx
nx_research_sim_gate.nx
buildroot/runtime/_hdl_build/nx_research_sim_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 18 | func 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 } |
| 19 | func 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 } |
| 20 | func 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 } |
| 23 | func rs_has(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: rs_lib_contains |
| 31 | func rs_lib_contains(needle: *u8) -> i64 |
| 44 | func rs_mul(cnt: *i64, a: i64, b: i64) -> i64 { cnt[0] = cnt[0] + 1; return a * b } |
| 47 | func mm_naive(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64 |
| 55 | func mm_strassen(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64 |
| 70 | func mm_strassen_broken(a: *i64, b: *i64, c: *i64, cnt: *i64) -> i64 |
| 85 | func 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 |
| 86 | func 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 |
| 88 | func main() -> i64 |