code wiki / _hdl_build / nx_nofloat_corpus_gate.nx
nx_nofloat_corpus_gate.nx
buildroot/runtime/_hdl_build/nx_nofloat_corpus_gate.nx
about
nx_nofloat_corpus_gate.nx -- HARD-EVIDENCE: a CHARACTER-LEVEL language model trains on REAL TEXT, pure
integer Q16 (CAP-NF-REALCORPUS). Off the toy cyclic task: the corpus is a real sentence, the vocab is its
distinct characters, and the space char recurs before different words -- so the model MUST use causal-attention
HISTORY to disambiguate (a genuine context task, not a context-free lookup). Trains ALL weights with AdamW.
T1 started untrained (CE > 0) ; T2 CE drops >= 70% (it learned the text)
T3 next-char accuracy >= 90% on the corpus (argmax predicts the real next char from history)
T4 bit-exact (train twice -> identical integer weights)
+ prints the model's predicted text vs the target for transparency (you can SEE it learned).
Evidence -> knowledge/status/nofloat_corpus.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
| 16 | const CLOG: *u8 = "knowledge/status/nofloat_corpus.log" |
| 17 | const Q16: i64 = 65536 |
functions
| 20 | func c_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 } |
| 21 | func c_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 } |
| 22 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 23 | 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: main |
| 26 | func clm_fwd(tape: *i64, vals: *i64, st: *i64, W: *i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, leaves: *i64) -> i64 |
| 68 | func step_all(tape: *i64, grads: *i64, W: *i64, WN: *i64, leaves: *i64, nW: i64, lr_q: i64, clip: i64, gbuf: *i64) -> i64 |
| 80 | func acc_count(tape: *i64, vals: *i64, logn: i64, tgt: *i64, T: i64, V: i64) -> i64 called by 1: main |
| 93 | func main() -> i64 |