code wiki / _hdl_build / nx_nofloat_scale_wide_gate.nx
nx_nofloat_scale_wide_gate.nx
buildroot/runtime/_hdl_build/nx_nofloat_scale_wide_gate.nx
about
nx_nofloat_scale_wide_gate.nx -- R4 the genuine SCALE test: real WIDTH scale-up. Prior R4 tests stayed at
dm=24/32 and ruled out optimizer/depth/batch/FFN -- but WIDTH (features per token) is distinct from depth and
is exactly what producing SHARP 4-way-conditional distributions needs. Maximal tractable model: dm=64,
ffn=128, the COMPLETE block (attn+FFN), mini-batch averaged grads (lowest noise). Richer 4-cat grammar.
floor = avg(ln2,ln4,ln5,ln5)=1324 milli-nats (ppl 3.76); uniform=2773; dm=32 plateaued ~2135 (ppl 8.5).
T1 held-out CE << uniform. T2 held-out CE ~= floor (near-OPTIMAL -> WIDTH-scale closes it -> R4 progresses).
If T2 fails too, even 2x width is insufficient at tractable compute -> R4-FULL needs massive (GPU-scale) compute.
expect_exit: 0 Sovereign: nx_nofloat_autograd + nx_syscalls. (run in background -- longer compute)
D001 MIGRATION 2026-08-25: this gate hand-rolled its own verdict -- a local pass/total pair, its own
"passed p / t" summary line, and its own verdict=GREEN/RED prints -- so the EXIT CODE carried the verdict
only while the author kept the two in step, and a tooth that silently stopped running would have lowered
BOTH numbers and still read GREEN. It now inherits nx_gate_verdict: gv_ctr makes declared and executed
tooth counts ONE number, and gv_verdict is the single writer of the last line. The two assertions are
UNCHANGED -- same expressions, same thresholds, same wording -- only the bookkeeping moved to the base
class. The two bars are now NAMED consts instead of bare literals sitting inside the comparisons.
dependencies 4 imports · 0 importers
imports: nx_nofloat_autograd.nxnx_syscalls.nxnx_gate_emit_lib.nxnx_gate_verdict.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
| 21 | const Q16: i64 = 65536 |
| 22 | const UNIFORM_MNAT: i64 = 2773 |
| 23 | const FLOOR_MNAT: i64 = 1324 |
| 27 | const T1_UNIFORM_FRAC_NUM: i64 = 7 |
| 28 | const T1_UNIFORM_FRAC_DEN: i64 = 10 |
| 30 | const T2_NEAR_FLOOR_TOL_MNAT: i64 = 200 |
functions
| 33 | func dini(a: *i64, n: i64, sd: i64) -> i64 { var i: i64=0; while i<n { a[i]=(((i*7+sd*13+1)%11)-5)*9362; i=i+1 } return 0 } called by 1: main |
| 34 | func lcg(st: *i64) -> i64 { st[0]=(st[0]*1103515245 + 12345) & 2147483647; return (st[0] >> 15) } called by 1: make_stream4 |
| 35 | func make_stream4(S: *i64, tgt: *i64, P: i64, st: *i64) -> i64 |
| 41 | func clm_ffn(tape: *i64, vals: *i64, st: *i64, W: *i64, ids: *i64, tgt: *i64, T: i64, dm: i64, ffn: i64, V: i64, scale: i64, lv: *i64) -> i64 called by 2: do_train_batcheval_ce calls 11: nfa_leafnfa_embednfa_rmsnorm_rowsnfa_matmulnfa_ropenfa_matmul_nt+5 |
| 75 | func do_train_batch(tape: *i64, vals: *i64, grads: *i64, st: *i64, W: *i64, WN: *i64, gacc: *i64, S: *i64, tgt: *i64, P: i64, dm: i64, ffn: i64, V: i64, scale: i64, lv: *i64, gb: *i64, outer: i64, B: i64, lr: i64, sdat: *i64) -> i64 |
| 95 | func eval_ce(tape: *i64, vals: *i64, st: *i64, W: *i64, S: *i64, tgt: *i64, P: i64, dm: i64, ffn: i64, V: i64, scale: i64, lv: *i64, N: i64, sdat: *i64) -> i64 |
| 102 | func main() -> i64 |