nx_hifigan_run.nx
buildroot/runtime/nx_hifigan_run.nx
about
nx_hifigan_run.nx -- run the FULL real-weight HiFi-GAN generator at REAL dims (512ch). Loads all 158 tensors
from the .bin into a weight pool (data/N -> pool offset), then executes the complete forward on our sovereign
nx_vocops: normalize (mel-mean)/scale -> conv_pre -> [leaky -> upsample -> MRF(3 resblocks[K=3,7,11], each 3
dilation branches[1,3,5])]x4 -> leaky -> conv_post -> tanh. Verifies it runs end-to-end at real dims + output is
finite + tanh-bounded. (Synthetic mel here => output is not speech; a REAL mel makes it speech. This proves the
real-weight forward EXECUTES correctly.) CPU f32 = minutes/utterance -> GPU is the speed lever. license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_f32.nxnx_f32_activations.nxnx_vocops.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
| 11 | const F_MAGIC_67108864: i64 = 67108864 |
| 12 | const F_MAGIC_16777216: i64 = 16777216 |
| 13 | const F_MAGIC_262144: i64 = 262144 |
| 15 | const SLOPE01: i64 = 0x3DCCCCCD // 0.1 |
| 16 | const F_THIRD: i64 = 0x3EAAAAAB // 1/3 |
functions
| 18 | func p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func pn(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let d: *u8=sys_mmap(24); var k: i64=0; while m>0 {d[k]=(48+(m%10)) as u8; m=m/10; k=k+1} var i: i64=k-1; while i>=0 {let o: *u8=sys_mmap(1); o[0]=d[i]; sys_write(1,o,1); i=i-1} return 0 } |
| 20 | func phx(v: i64) -> i64 { let b: *u8=sys_mmap(8); var i: i64=0; while i<8 { let n: i64=(v>>((7-i)*4))&0xF; if n<10 {b[i]=(48+n) as u8} else {b[i]=(87+n) as u8} i=i+1 } sys_write(1,b,8); return 0 } |
| 21 | func u16le(b: *u8, o: i64) -> i64 { return (b[o]&0xff) | ((b[o+1]&0xff)<<8) } called by 1: main |
| 22 | func u32le(b: *u8, o: i64) -> i64 { return (b[o]&0xff) | ((b[o+1]&0xff)<<8) | ((b[o+2]&0xff)<<16) | ((b[o+3]&0xff)<<24) } called by 1: main |
| 23 | func f32_sub(a: i64, b: i64) -> i64 { return nx_f32_add(a, (b & 0xFFFFFFFF) ^ 0x80000000) } |
| 24 | func vcopy(d: *i64, s: *i64, n: i64) -> i64 { var i: i64=0; while i<n { d[i]=s[i]; i=i+1 } return 0 } called by 1: main |
| 25 | func vaddto(d: *i64, s: *i64, n: i64) -> i64 { var i: i64=0; while i<n { d[i]=nx_f32_add(d[i],s[i]); i=i+1 } return 0 } |
| 26 | func vzero(d: *i64, n: i64) -> i64 { var i: i64=0; while i<n { d[i]=0; i=i+1 } return 0 } called by 1: main |
| 27 | func vscale(d: *i64, n: i64, s: i64) -> i64 { var i: i64=0; while i<n { d[i]=nx_f32_mul(d[i],s); i=i+1 } return 0 } |
| 28 | func f32_exp(x: i64) -> i64 { return (x>>23)&0xFF } called by 1: main |
| 30 | func main() -> i64 |