code wiki / _hdl_build / nx_nofloat_prose_gate.nx

nx_nofloat_prose_gate.nx

buildroot/runtime/_hdl_build/nx_nofloat_prose_gate.nx

8482 B146 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_prose_gate.nx -- CAP-NF-PROSE: the no-float char-LM trains on REAL ENGLISH PROSE (words + spaces, not the alphabet) at a LARGER scale (dm=24/ffn=48). Real prose is genuinely harder than a periodic sequence: the space char precedes many different words, so the model MUST use causal-attention history to disambiguate. Trains the full pre-norm transformer block (all weights) with clipped SGD. Honest: an INCREMENTAL step into CAP-AI-FRONTIER (real corpus + scale), not a claim to finish it. T1 started untrained (CE > 0) ; T2 CE drops substantially (>= 60%) ; T3 next-char accuracy >> chance (1/V) + prints the model's predicted text vs target (visible evidence it learned the prose). Lean: 2 clm_fwd call sites (train-loop + accuracy/print). Sovereign: nx_nofloat_autograd + nx_syscalls. expect_exit: 0

dependencies 3 imports · 0 importers

nx_nofloat_autograd.nx nx_syscalls.nx nx_gate_emit_lib.nx nx_nofloat_prose_gate.nx

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

main g_puts sys_write slen sys_mmap g_pn sys_mmap ↻ sys_write ↻ dini do_train clm_fwd nfa_leaf nfa_new nfa_embed nfa_new ↻ nfa_rmsnorm_rows nfa_new ↻ nfa_qmul nfa_isqrt nfa_matmul nfa_new ↻ nfa_rope nfa_new ↻ nfa_fxexp nfa_cosf nfa_reduce2pi nfa_cosq nfa_qmul ↻ nfa_sinf nfa_reduce2pi ↻ nfa_sinq nfa_qmul ↻ nfa_qmul ↻ nfa_matmul_nt nfa_new ↻ nfa_cmul nfa_new ↻ nfa_qmul ↻ nfa_softmax_rows nfa_new ↻

structs

none

consts

12const Q16: i64 = 65536

functions

15func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
16func dini(a: *i64, n: i64, sd: i64) -> i64 { var i: i64=0; while i<n { a[i]=(((i*7+sd*13+1)%11)-5)*13107; i=i+1 } return 0 }
called by 1: main
18func 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
58func step_all(tape: *i64, grads: *i64, W: *i64, WN: *i64, leaves: *i64, nW: i64, lr: i64, clip: i64, gb: *i64) -> i64
called by 1: do_train calls 2: nfa_gradnfa_sgd
64func do_train(tape: *i64, vals: *i64, grads: *i64, st: *i64, W: *i64, WN: *i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, leaves: *i64, gb: *i64, steps: i64, cf: *i64, cl: *i64) -> i64
77func main() -> i64