code wiki / _hdl_build / nx_mt_r1_gate.nx

nx_mt_r1_gate.nx

buildroot/runtime/_hdl_build/nx_mt_r1_gate.nx

8754 B209 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic mt
docsdependenciesstructsconstsfunctions

about

nx_mt_r1_gate.nx -- GATE for MT-R1: SEQUENCES. Proves, by RUNNING, that the sovereign MT core (nx_mt_core) translates multi-token SEQUENCES with a SHARED, position-independent learned word-map -- and that the map GENERALIZES to HELD-OUT sentences it was never trained on. This is the seq2seq plumbing + the no-overfit test harness the rest of the arc rides on; R0 proved the single-token atom, R2 will add cross-token CONTEXT (reordering) via fnet_mix. Dictionary (EN->ES), target indices are a PERMUTATION (not identity): tgt_map=[2,0,5,1,3,4]. src EN: 0 hello 1 family 2 love 3 good 4 day 5 water tgt ES: 0 familia 1 bueno 2 hola 3 dia 4 agua 5 amor TRAIN = 4 sentences x 3 tokens, arranged so EVERY word occurs EXACTLY TWICE (m=2) -> with lr=1/8 the GD factor (1-2*lr*m)=0.5 is stable+monotone for all weights. HELD-OUT = 3 sentences whose token TRIPLES never appear in training (novel combinations of the same vocab). FOUR GATES: A LEARNS (train set): per-token acc == all-train-tokens, sum-loss < 1/1000, loss decreased. B GENERALIZES (held-out): per-token acc == all-held-tokens on sentences NEVER trained -> the shared map is compositional/position-independent, not a per-sentence memorization. C BIT-EXACT: retrain from zero-init -> identical W bits. D UNTRAINED FAILS (liar-kill): zero-epoch model scores < all-held-tokens on held-out. genealogy_id: rumelhart_1986_backprop (realized_in nx_autograd) lineage_id: sovereign_neural_mt_r1_sequences_v1 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_mt_core.nx nx_autograd.nx nx_syscalls.nx nx_mt_r1_gate.nx

imports: nx_mt_core.nxnx_autograd.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap ag_constf nx_f32_div nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_i32_to_f32 mt_train sys_mmap ↻ ag_leaf ag_sub ag_mk nx_f32_sub nx_f32_add nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_neg ag_mul ag_mk ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ ag_add ag_mk ↻ nx_f32_add ↻ ag_backward nx_f32_add ↻ nx_f32_mul ↻ nx_f32_neg ↻ nx_f32_gt nx_f32_lt nx_f32_is_nan

structs

none

consts

29const MR_LOG: *u8 = "knowledge/status/mt_r1.log"
30const MR_S: i64 = 6
31const MR_T: i64 = 6
32const MR_L: i64 = 3 // sequence length
34const EN0: *u8 = "hello" as *u8
35const EN1: *u8 = "family" as *u8
36const EN2: *u8 = "love" as *u8
37const EN3: *u8 = "good" as *u8
38const EN4: *u8 = "day" as *u8
39const EN5: *u8 = "water" as *u8
40const ES0: *u8 = "familia" as *u8
41const ES1: *u8 = "bueno" as *u8
42const ES2: *u8 = "hola" as *u8
43const ES3: *u8 = "dia" as *u8
44const ES4: *u8 = "agua" as *u8
45const ES5: *u8 = "amor" as *u8
46const ESQ: *u8 = "?" as *u8

functions

48func mr_en(i: i64) -> *u8
called by 1: mr_demo
57func mr_es(j: i64) -> *u8
called by 1: mr_demo
67func mr_w(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 }
called by 2: mr_demomr_emit calls 1: sys_write
68func mr_wn(fd: i64, v: i64) -> i64
called by 1: mr_emit calls 2: sys_mmapsys_write
78func mr_f32_to_milli(v: i64) -> i64
97func mr_demo(fd: i64, W: *i64, held_src: *i64, n_held: i64) -> i64
called by 1: main calls 4: mr_wmt_argmaxmr_enmr_es
111func mr_emit(fd: i64, r: *i64) -> i64
called by 1: main calls 2: mr_wmr_wn
124func main() -> i64