code wiki / _hdl_build / nx_skinfam_train_gate.nx

nx_skinfam_train_gate.nx

buildroot/runtime/_hdl_build/nx_skinfam_train_gate.nx

19400 B473 linesdepth 9pulls 24 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_skinfam_train_gate.nx -- ★★P4 NEURAL RUNG 2: a GENERATIVE sovereign skin-texture FAMILY. R1 proved exemplar-fit; R2 proves GENERATION: an AUTO-DECODER (DeepSDF/GLO-style) coordinate-MLP with a LEARNED 8-dim LATENT per training patch, trained jointly on SIX real skin patches (Elara exemplar) by the R1 integer machinery (Q12 backprop + error-feedback + frequency-scaled init). After training, NEW latents (interpolations + in-range draws) generate NOVEL skin textures that never existed = seed -> novel skin, the persongen philosophy carried into the neural track. T1 joint training CONVERGES (err < half of untrained across all 6 patches) T2 per-patch reconstructions are FAITHFUL (avg err < 22/255) and DISTINCT (the latent separates patches) T3 ★GENERATION: novel latents -> textures that are (a) NOT a copy of any training patch, (b) skin-like (mean colour within the training family's range), (c) DIVERSE (two draws differ) T4 persist (weights+latents) -> reload -> re-render bit-identical + PNG knowledge/nx_skinfam.png (row 1 exemplars | row 2 reconstructions | row 3 NOVEL generations) license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itrig.nx nx_jpeg_ascii.nx nx_png.nx nx_skinfam_train_gate.nx

imports: nx_syscalls.nxnx_itrig.nxnx_jpeg_ascii.nxnx_png.nx

imported by: nobody (leaf or entry point)

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

main hw sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ prog_be16 ↻ nx_jpeg_dqt_parse nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_sos_parse prog_next_marker prog_scan sys_mmap ↻ nx_jpeg_huff_decode_symbol nx_jpeg_ent_extend nx_jpeg_ent_receive prog_refine_nz nx_jpeg_mcu_scratch_init sys_mmap ↻ nx_jpeg_idct_init_cos_tabl

structs

none

consts

22const PS: i64 = 32 // patch size
23const NPP: i64 = 1024 // px per patch
24const NPAT: i64 = 6 // training patches
25const NFR: i64 = 5 // Fourier freqs {1,2,4,8,16}
26const NFF: i64 = 20 // Fourier features
27const NL: i64 = 8 // latent dims
28const NIN: i64 = 28 // NFF + NL
29const NH: i64 = 56
30const NO: i64 = 3
31const EPOCHS: i64 = 500

functions

19func hw(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 1: main calls 1: sys_write
20func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main calls 2: sys_mmapsys_write
33func lcg(st: *i64) -> i64 { var h: i64=st[0]; h=h*6364136223846793005+1442695040888963407; st[0]=h; return (h>>33)&2147483647 }
called by 1: main
35func features(px: i64, py: i64, f: *i64) -> i64
called by 1: main calls 3: sys_mmapit_sin4096it_cos4096
52func infer(W1: *i64, B1: *i64, W2: *i64, B2: *i64, fin: *i64, h: *i64) -> i64
called by 1: main
81func main() -> i64