code wiki / _hdl_build / nx_gsplat_elara_gate.nx

nx_gsplat_elara_gate.nx

buildroot/runtime/_hdl_build/nx_gsplat_elara_gate.nx

7798 B153 linesdepth 9pulls 25 transitivereach 0 importersview sourcekind gate/prooftopic gsplat
docsdependenciesstructsconstsfunctions

about

nx_gsplat_elara_gate.nx -- ★FIT GAUSSIANS TO THE ACTUAL ELARA PHOTO (operator correction 2026-07-08: "that's not the elara photo, that's the clay thing" -- my earlier photofit target was our SDF CLAY render, not the real photograph). Here the TARGET is the real Elara photo (elara_face_hi.jpg) directly. A cloud of Gaussians starts GREY and the differentiable-splatting optimizer fits their colours to REPRODUCE THE PHOTO -> the splat looks like Elara (not clay). HONEST BOUNDARY: this is a SINGLE-VIEW image fit (a 3D-Gaussian representation of the 2D photo) -- it reproduces Elara from the front; true 3D-consistent Elara from one photo needs single-image-3D reconstruction (the neural frontier method), a trained net. But the SPLAT + OPTIMIZER are ours. T1 the optimizer reproduces the ELARA PHOTO: L1(render, photo) drops hard from the grey start (< 12%) T2 close match (final per-pixel error small) = the splat looks like the photo T3 PNG knowledge/nx_gsplat_elara.png (elara photo | grey start | fitted) + determinism license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_jpeg_ascii.nx nx_gsplat.nx nx_png.nx nx_gsplat_elara_gate.nx

imports: nx_syscalls.nxnx_jpeg_ascii.nxnx_gsplat.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 gs_w gs_h 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

structs

none

consts

21const R: i64 = 4096 // camz 4 * 1024
22const FOC: i64 = 586
23const CROP_Y0: i64 = 110 // crop the 512x640 photo to the 512x384 face region

functions

17func 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
18func 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
19func l1(a: *i64, b: *i64, n: i64) -> i64 { var s: i64=0; var i: i64=0; while i<n { var dr: i64=(a[i]&255)-(b[i]&255); if dr<0{dr=0-dr} var dg: i64=((a[i]>>8)&255)-((b[i]>>8)&255); if dg<0{dg=0-dg} var db: i64=((a[i]>>16)&255)-((b[i]>>16)&255); if db<0{db=0-db} s=s+dr+dg+db; i=i+1 } return s }
called by 1: main
25func main() -> i64