code wiki / (root) / nx_avatar_splat.nx

nx_avatar_splat.nx

buildroot/runtime/nx_avatar_splat.nx

35824 B643 linesdepth 5pulls 12 transitivereach 0 importersview sourcekind tooltopic avatar
docsdependenciesstructsconstsfunctions

about

nx_avatar_splat.nx -- ★THE LEAP (charsim R25; operator 2026-08-16: "dont build iterative junk, you can get us there from all the published research without gumby layers and then we can iterate on the last miles"). GENOME -> ANTHROPOMETRIC BODY MESH -> GAUSSIAN SPLAT COAT -> PORTRAIT PNG. A COMPOSITION OF PROVEN PARTS, ZERO NEW ALGORITHMS -- the published GaussianAvatars/HumanSplat architecture (mesh -> per-element gaussians -> splat) that nx_gsplat_face_gate already proves at face scale on this estate's own stack, generalized to the full body: nx_body_gen (forked; anthropometric .nxmesh from stature + the FEMALE canon knowledge/canon_f.dat; every non-genome knob passed = body_gen's OWN defaults, transcribed from its main: RS 28, SUB 4, RLF 1000, FAT 250 -- so only stature and canon vary from stock) nx_skin_ita (published ITA -> L*a*b* -> sRGB skin albedo; genome skin bits, face/torso region dl) nx_gsplat (sovereign integer 3DGS: one ANISOTROPIC surface-flattened gaussian per triangle, normal from the winding, tangent radius DERIVED from the triangle's own mean edge) nx_png (write_png, the face gate's own call) Genome bit layout TRANSCRIBED from the documented MC_GENE map: skin tone bits 9-10, height bits 5-6. Female stature band cited (ANSUR/NHANES women P5..P95 ~ 1505..1730mm): bits 0..3 -> 1520 + 70*b mm. ⚠DUPLICATE-DECODER DEBT, NAMED: av_rdbits/av_f32mul are the FOURTH inline copy of the NXMSH2 f32 decode (anat_sov, bodybench, curvebench carry the others). Extracting nx_nxmesh_lib and migrating all four is the named follow-on; a fifth copy is forbidden. LAST-MILE (after the leap, by order): photofit color refinement (gs_color_grad_step), hair as splat volume, head-band eye/mouth features, wasm delivery budget, yaw/pose drive via nx_gsplat4d_lib. nx_avatar_splat <out.png> [gene]

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_tool_run.nx nx_itrig.nx nx_gsplat.nx nx_skin_ita.nx nx_png.nx nx_avatar_splat.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_tool_run.nxnx_itrig.nxnx_gsplat.nxnx_skin_ita.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 av_puts sys_write av_len sys_chdir sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mmap ↻ av_num sys_mmap ↻ tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap sys_pipe2 sys_fork sys_close sys_default_signal sys_bind_parent_lifetime sys_exit ↻ sys_setpgid tr_capture_redirect sys_chdir ↻

structs

none

consts

32const AV_BODYGEN: *u8 = "/volume1/homes/elderwesto/nishihost/nx_body_gen.elf"
33const AV_CANON: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/canon_f.dat" // ABSOLUTE: this
37const AV_MESH: *u8 = "/tmp/avatar_splat.nxmesh"
38const AV_OUTCAP: i64 = 65536
39const AV_TIMEOUT_MS: i64 = 120000
40const AV_POSQ0: i64 = 4096 // fixed pre-pass precision (anat_sov's own scale-invariance pattern)
41const AV_SPAN: i64 = 1200 // normalized max-axis span in gsplat model units
42const AV_TARGET: i64 = 200000 // DECODE precision target (anat_sov's own AS_TARGET, transcribed):
46const AV_CAMZ: i64 = 2 // R = 2048: half-height on screen = 586*600/2048 = 171 of 192 px
48const AV_F32_MANT_SCALE: i64 = 8388608
49const AV_F32_MANT_MASK: i64 = 8388607
50const AV_BIG: i64 = 2000000000
51const AV_OP: i64 = 235 // splat opacity: the face gate's proven value, transcribed
52const AV_RTAN_NUM: i64 = 1 // tangent radius = mean edge / 2: 3-sigma still covers 1.5 edges
53const AV_RTAN_DEN: i64 = 2 // (closed surface holds) -- 3/4 melted every feature, measured by
55const AV_SKIN_SH: i64 = 9 // MC_GENE skin bits (transcribed)
56const AV_SKIN_MASK: i64 = 3
57const AV_HGT_SH: i64 = 5 // MC_GENE height bits (transcribed)
58const AV_HGT_MASK: i64 = 3
59const AV_STAT_BASE_MM: i64 = 1520 // ANSUR/NHANES female stature band, P5..P95 in 4 stops
60const AV_STAT_STEP_MM: i64 = 70
61const AV_LIGHT_X: i64 = 0-121 // the face gate's proven key light direction, transcribed
62const AV_LIGHT_Y: i64 = 191
63const AV_LIGHT_Z: i64 = 0-121
64const AV_HEAD_BAND: i64 = 2 // head = top 2/15 of stature -- the 7.5-head canon unit
65const AV_HEAD_DEN: i64 = 15
70const AV_CONF: *u8 = "knowledge/avatar_splat.conf"
71const AV_PERMIL: i64 = 1000
72const AV_NFX: i64 = 256 // the fx256 unit-normal scale gs_set_aniso declares
73const AV_DEF_SH_AMB: i64 = 130 // v1 shipped shade base
74const AV_DEF_SH_GAIN: i64 = 90 // v1 shipped lambert gain
75const AV_DEF_SH_MIN: i64 = 70 // v1 shipped shade floor
76const AV_DEF_SH_MAX: i64 = 255
77const AV_DEF_HAIR_ON: i64 = 0 // hair OFF by default = v1 behaviour; the conf turns it on
78const AV_DEF_HAIR_TOP_PERMIL: i64 = 550
79const AV_DEF_HAIR_LEN_PERMIL: i64 = 1400
80const AV_DEF_HAIR_RAD_PERMIL: i64 = 60
81const AV_DEF_HAIR_STEP_PERMIL: i64 = 1200 // step between strand discs, permil of disc radius
82const AV_DEF_HAIR_SEED_EVERY: i64 = 3
83const AV_DEF_HAIR_DROOP: i64 = 820
84const AV_DEF_HAIR_R: i64 = 144 // measured mean of the banked WebGL reference's hair band
85const AV_DEF_HAIR_G: i64 = 118 // (cjc_ref_rig_03, 10330 px, 2026-08-19) -- a measurement, not a taste
86const AV_DEF_HAIR_B: i64 = 89
87const AV_DEF_HAIR_JITTER: i64 = 28
88const AV_DEF_HAIR_FACE_Z: i64 = 1 // +z is the face (measured, y90 profile 2026-08-19)
89const AV_DEF_HAIR_CROWN_PERMIL: i64 = 300
90const AV_DEF_HAIR_DROOP_BASE: i64 = 0 // v1-equivalent: no initial bend
91const AV_DEF_HAIR_CROWN_BACK: i64 = 0 // v1-equivalent: no backward sweep on face-side crown strands
92const AV_DEF_SKIN_JITTER: i64 = 0 // v1-equivalent: no per-splat skin variation
93const AV_DEF_FACE_ON: i64 = 0 // v1-equivalent: no face features
94const AV_DEF_EYE_LINE_PERMIL: i64 = 450 // eye line below head top, permil of head height
95const AV_DEF_EYE_SEP_PERMIL: i64 = 420 // eye separation, permil of head width at the eye line
96const AV_DEF_EYE_RAD_PERMIL: i64 = 70 // sclera radius, permil of head height
97const AV_DEF_MOUTH_LINE_PERMIL: i64 = 760
98const AV_DEF_MOUTH_W_PERMIL: i64 = 280 // mouth half-width, permil of head width
99const AV_FACE_GAUSS: i64 = 16 // fixed feature budget added to the buffer bound
100const AV_HAIR_HASH_A: i64 = 1103515245 // the estate's LCG constants (charjudge gate), per-strand jitter
101const AV_HAIR_HASH_C: i64 = 12345
102const AV_HAIR_HASH_M: i64 = 2147483647

functions

106func av_conf_int(cf: *u8, n: i64, key: *u8, def: i64) -> i64
called by 1: main
141func av_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: av_puts
142func av_puts(s: *u8) -> i64 { sys_write(1, s, av_len(s)); return 0 }
called by 1: main calls 2: sys_writeav_len
143func av_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
144func av_num(d: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
159func av_rdbits(b: *u8, o: i64) -> i64
called by 2: av_f32mulmain
162func av_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: main calls 1: av_rdbits
176func main(argc: i64, argv: *i64) -> i64