code wiki / _hdl_build / _autograd_authored.nx

_autograd_authored.nx

buildroot/runtime/_hdl_build/_autograd_authored.nx

8516 B195 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic autograd
docsdependenciesstructsconstsfunctions

about

AUTHORED BY THE NISHI BUILDER (nx_module_author autograd template) -- L1 training substrate rung 1. Tape reverse-mode autograd on the sovereign f32 tower; tutoring: specs/2026-06-09-tutoring-training-substrate-rung1.md

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_f32.nx nx_f32_div.nx nx_f32_cvt.nx _autograd_authored.nx

imports: nx_syscalls.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nx

imported by: nobody (leaf or entry point)

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

main _ag_puts sys_write sys_mmap gate_a sys_mmap ↻ ag_q 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 ag_leaf ag_node ag_relu nx_f32_lt nx_f32_is_nan nx_f32_classify ↻ nx_f32_is_zero nx_f32_classify ↻ ag_node ↻ ag_add ag_node ↻ nx_f32_add nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ ag_mul ag_node ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ ag_backward nx_i32_to_f32 ↻

structs

none

consts

none

functions

7func _ag_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: gate_aag_trainmain calls 1: sys_write
8func _ag_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; 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);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
9func ag_q(n: i64, d: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(n), nx_i32_to_f32(d)) }
10func ag_milli(v: i64) -> i64
24func ag_node(tape: *i64, nb: *i64, op: i64, ai: i64, bi: i64, v: i64) -> i64
34func ag_leaf(tape: *i64, nb: *i64, v: i64) -> i64 { return ag_node(tape, nb, 0, 0, 0, v) }
called by 2: gate_aag_train calls 1: ag_node
35func ag_add(tape: *i64, nb: *i64, x: i64, y: i64) -> i64 { return ag_node(tape, nb, 1, x, y, nx_f32_add(tape[x*5+3], tape[y*5+3])) }
called by 2: gate_aag_train calls 2: ag_nodenx_f32_add
36func ag_mul(tape: *i64, nb: *i64, x: i64, y: i64) -> i64 { return ag_node(tape, nb, 2, x, y, nx_f32_mul(tape[x*5+3], tape[y*5+3])) }
called by 2: gate_aag_train calls 2: ag_nodenx_f32_mul
37func ag_sub(tape: *i64, nb: *i64, x: i64, y: i64) -> i64 { return ag_node(tape, nb, 3, x, y, nx_f32_sub(tape[x*5+3], tape[y*5+3])) }
called by 1: ag_train calls 2: ag_nodenx_f32_sub
38func ag_relu(tape: *i64, nb: *i64, x: i64) -> i64
called by 1: gate_a calls 2: nx_f32_ltag_node
43func ag_backward(tape: *i64, nt: i64, root: i64) -> i64
72func gc_fwd(w1: i64, b1: i64, w2: i64, b2: i64, x: i64) -> i64
78func gate_a(tape: *i64, nb: *i64) -> i64
119func ag_train(tape: *i64, nb: *i64, out: *i64) -> i64
162func main() -> i64