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