code wiki / _hdl_build / nx_nofloat_deepstack_gate.nx
nx_nofloat_deepstack_gate.nx
buildroot/runtime/_hdl_build/nx_nofloat_deepstack_gate.nx
about
nx_nofloat_deepstack_gate.nx -- HARD-EVIDENCE gate that the no-float transformer scales in DEPTH: a
2-BLOCK (depth-2) transformer LM trains end-to-end on next-token prediction, pure integer Q16. Each block is
the verified pre-norm block (attn+RoPE+causal-softmax+SwiGLU+residuals); stacking = composing blk forward N
times (NO new ops -- depth is pure composition). Trained with the Q16 AdamW optimizer.
A1 depth-2 gradcheck wrt Wlm : the LM-head gradient == finite differences.
A2 depth-2 gradcheck wrt E : E's gradient flows back through BOTH blocks (the deep-backprop proof) == FD.
D neg-control teeth (E, largest component) ; C bit-exact.
B the depth-2 LM TRAINS : next-token CE drops substantially (AdamW on E+Wlm through the 2-block stack).
(informational) depth-1 vs depth-2 final CE printed for transparency.
Evidence -> knowledge/status/nofloat_deepstack.log. Sovereign: nx_nofloat_autograd + nx_syscalls. expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_nofloat_autograd.nxnx_syscalls.nxnx_gate_emit_lib.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
| 17 | const DLOG: *u8 = "knowledge/status/nofloat_deepstack.log" |
| 18 | const Q16: i64 = 65536 |
functions
| 21 | func g_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 22 | func d_ws(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 23 | func d_wn(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(fd,"-" as *u8,1);m=0-m} 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)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(fd,b,k); return 0 } |
| 24 | func dini(arr: *i64, n: i64, seed: i64) -> i64 { var i: i64=0; while i<n { arr[i] = (((i*7 + seed*13 + 1) % 11) - 5) * 13107; i=i+1 } return 0 } called by 1: build_W |
| 27 | func stack_fwd(tape: *i64, vals: *i64, st: *i64, W: *i64, D: i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, leaves: *i64) -> i64 called by 4: stack_lossvalstack_gcstack_trainmain calls 12: nfa_leafnfa_embednfa_rmsnorm_rowsnfa_matmulnfa_ropenfa_matmul_nt+6 |
| 72 | func stack_lossval(tape: *i64, vals: *i64, st: *i64, W: *i64, D: i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64) -> i64 |
| 78 | func stack_gc(tape: *i64, vals: *i64, grads: *i64, st: *i64, W: *i64, D: i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, leaves: *i64, lidx: i64, arr: *i64, cnt: i64, h: i64, tol_q: i64, floor_q: i64, worst: *i64, anabuf: *i64) -> i64 |
| 99 | func stack_train(tape: *i64, vals: *i64, grads: *i64, st: *i64, W: *i64, D: i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, steps: i64, lf0: *i64) -> i64 |
| 121 | func build_W(D: i64, dm: i64, ffn: i64, V: i64) -> *i64 |
| 140 | func main() -> i64 |