code wiki / (root) / nx_skinneural.nx

nx_skinneural.nx

buildroot/runtime/nx_skinneural.nx

6651 B156 linesdepth 2pulls 3 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_skinneural.nx -- ★P4-R3: DEPLOY the trained skin-family model onto generated people. Loads the R2 artifact (knowledge/skinfam_w.bin: coordinate-MLP weights + the 6 learned patch latents), derives a NOVEL in-family latent from a person seed, and BAKES a seamless albedo RATIO tile (texel 128 = x1.0) for the anatstack as_set_skintex hook -- so a seed-grown person gets seed-grown NEURAL skin that modulates (never replaces) their seeded tone. Integer inference only; consts MUST match nx_skinfam_train_gate. license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_itrig.nx nx_skinneural.nx nx_gt_annotations_gate.nx nx_livingworld_gate.nx nx_skinneural_gate.nx

imports: nx_syscalls.nxnx_itrig.nx

imported by: nx_gt_annotations_gate.nxnx_livingworld_gate.nxnx_skinneural_gate.nx

structs

none

consts

8const SKN_MAGIC_6364136223846793005: i64 = 6364136223846793005
9const SKN_MAGIC_1442695040888963407: i64 = 1442695040888963407
10const SKN_MAGIC_2147483647: i64 = 2147483647
11const SKN_MAGIC_2654435761: i64 = 2654435761
12const SKN_MAGIC_1024: i64 = 1024
13const SKN_MAGIC_888888877: i64 = 888888877
14const SKN_MAGIC_12289: i64 = 12289
15const SKN_MAGIC_25736: i64 = 25736
16const SKN_MAGIC_4096: i64 = 4096
17const SKN_MAGIC_16384: i64 = 16384
18const SKN_MAGIC_65536: i64 = 65536
20const SKN_PS: i64 = 32
21const SKN_NFR: i64 = 5
22const SKN_NFF: i64 = 20
23const SKN_NL: i64 = 8
24const SKN_NIN: i64 = 28
25const SKN_NH: i64 = 56
26const SKN_NO: i64 = 3
27const SKN_NPAT: i64 = 6
28const SKN_BYTES: i64 = 14744 // (56*28 + 56 + 3*56 + 3 + 6*8) i64s * 8

functions

30func skn_lcg(st: *i64) -> i64 { var h: i64=st[0]; h=h*SKN_MAGIC_6364136223846793005+SKN_MAGIC_1442695040888963407; st[0]=h; return (h>>33)&SKN_MAGIC_2147483647 }
called by 2: skn_latentskn_bake
33func skn_load() -> i64
called by 3: mainmainmain calls 2: sys_mmapsys_read_file
42func skn_latent(blob: i64, seed: i64, zout: *i64) -> i64
called by 3: mainmainmain calls 2: sys_mmapskn_lcg
66func skn_bake(blob: i64, z: *i64, tile: *i64, tw: i64, seed: i64) -> i64