code wiki / _hdl_build / nx_gsplat_elara_gate.nx
nx_gsplat_elara_gate.nx
buildroot/runtime/_hdl_build/nx_gsplat_elara_gate.nx
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
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
structs
| none |
consts
| 21 | const R: i64 = 4096 // camz 4 * 1024 |
| 22 | const FOC: i64 = 586 |
| 23 | const CROP_Y0: i64 = 110 // crop the 512x640 photo to the 512x384 face region |
functions
| 17 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func 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 } |
| 19 | func 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 |
| 25 | func main() -> i64 |