code wiki / _hdl_build / nx_char_identity.nx

nx_char_identity.nx

buildroot/runtime/_hdl_build/nx_char_identity.nx

13733 B280 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind librarytopic char
docsdependenciesstructsconstsfunctions

about

nx_char_identity.nx -- THE IDENTITY VECTOR: "a LoRA, but for riggable models" (operator 2026-07-27: "daz like models or whatever powers lust goddesses or nikke ... an emitter or proc generator but wireable, making CONSISTENT beauties almost like a lora on a diffusion but for riggable models"). WHAT A LoRA ACTUALLY IS, mechanically: a SMALL reproducible DELTA applied to a big frozen base, such that the same delta yields the same identity every time, under any prompt. The riggable equivalent is exactly the DAZ Genesis architecture: ONE base topology + a MORPH-DIAL VECTOR + a shared rig. Same dials => same woman, in any pose, any outfit, any art style. This organ is that dial vector. ★THE LAW IT ENFORCES (already written in nx_scene_contract.nx:9-13, now made GATE-ABLE): identity = f(seed) ONLY. STYLE transforms proportions and shading; it must NEVER touch identity. That single invariant is what "consistent beauties" means operationally, and T2 of the gate proves it. ★WHAT IT REUSES (check-before-build; none of this is rebuilt here): nx_morph.nx -- mo_begin/mo_add_delta/mo_apply: 32 dials x 0..256 weights, ADDITIVE and COMMUTATIVE, applied to the bind-pose mesh before skinning (industry standard). THE dial primitive. This organ emits weights FOR it. nx_body_proc.nx -- seed + {sex,build,musc,noise,stylize,eyecol} -> canon.dat, already deterministic and already carrying a realistic<->ANIME stylize axis (0..1000). nx_scene_contract -- the per-style proportion tables (anime head-ratio 205 vs realistic 137). nx_bodyatlas -- the base body + the 9-bone FK rig that glTF export already skins against. nx_canon_cid.nx -- the DURABLE character id (nxc1-<sha256>) at publish time. `idv_key` below is a fast in-memory dedup key ONLY, deliberately a different thing, not a rival CID. ★★WHAT IT REFUSES TO DO, AND WHY (the honest boundary): It does NOT score beauty. [[reference-beauty-canon-and-layered-anatomy-2026-07-26]]: Versluys 2018 found the aesthetic optimum FLIPS with stimulus realism -- silhouettes optimise BELOW baseline, detailed CG ABOVE. We render at clay fidelity, so a beauty judge calibrated here would teach the WRONG target and actively make the models worse. What IS honestly gate-able is CONSISTENCY, DIVERSITY, and conformance to MEASURED anthropometry -- so that is all this gates. Aesthetic judgement belongs to the high-fidelity lane, at the fidelity it will be used at. ★★AND IT HARD-REFUSES PHI: the golden ratio is ACTIVELY REFUTED for human proportion (Naini 2024; Burusapat 2019 measured 32 Miss Universe winners: "statistically significantly invalid"). WHR 0.7 is dead too -- our own ANSUR II parse found 0.0% of 1,986 women reach it. The gate carries a REGRESSION TOOTH so nobody can quietly reintroduce either. All integer, deterministic. LIB, no main. license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_game_genetics.nx nx_char_identity.nx nx_char_identity_gate.nx nx_char_identity_sheet.nx nx_sovereign_surface_gate.nx

imports: nx_syscalls.nxnx_game_genetics.nx

imported by: nx_char_identity_gate.nxnx_char_identity_sheet.nxnx_sovereign_surface_gate.nx

structs

none

consts

41const IDV_SLOTS: i64 = 24
43const IDV_SEED: i64 = 0 // the individual
44const IDV_SEX: i64 = 1 // 0..1000 body dimorphism (nx_body_proc scale)
45const IDV_BUILD: i64 = 2 // 0..1000 lean..heavy
46const IDV_MUSC: i64 = 3 // 0..1000 soft..muscular
47const IDV_STATURE:i64 = 4 // mm
48const IDV_LBR: i64 = 5 // leg-to-body ratio, PER-MILLE (measured canon: 491 +- 15)
49const IDV_SHIP: i64 = 6 // shoulder:hip x100
50const IDV_D0: i64 = 7 // ---- 8 FACE/BODY MORPH DIALS, each 0..256 = nx_morph's weight range ----
51const IDV_D1: i64 = 8
52const IDV_D2: i64 = 9
53const IDV_D3: i64 = 10
54const IDV_D4: i64 = 11
55const IDV_D5: i64 = 12
56const IDV_D6: i64 = 13
57const IDV_D7: i64 = 14
58const IDV_SKIN: i64 = 15 // packed r|g<<8|b<<16
59const IDV_HAIR: i64 = 16
60const IDV_EYE: i64 = 17
61const IDV_HAIRSTYLE: i64 = 18
62const IDV_ARCH: i64 = 19 // temperament/archetype, derived -- drives expression defaults
64const IDV_STYLE: i64 = 20 // 0 realistic 1 anime 2 cartoon 3 VN
65const IDV_POSE: i64 = 21
66const IDV_OUTFIT: i64 = 22
67const IDV_EXPR: i64 = 23
68const IDV_NIDENT: i64 = 20 // slots [0, IDV_NIDENT) are the identity half -- the gate asserts on this
70const IDV_NDIAL: i64 = 8
71const IDV_DIALMAX: i64 = 256 // nx_morph weight range
74const IDV_LBR_MEAN: i64 = 491 // Versluys 2018, leg-to-body ratio
75const IDV_LBR_SD: i64 = 15
76const IDV_SHIP_LO: i64 = 113 // Aich 2026 male shoulder:hip 1.13..1.45
77const IDV_SHIP_HI: i64 = 145

functions

79func idv_rng(s: *i64) -> i64
called by 1: idv_from_seed
86func idv_clamp(v: i64, lo: i64, hi: i64) -> i64
called by 2: idv_dialsfig_ell
94func idv_from_seed(idv: *i64, seed: i64) -> i64
134func idv_from_companion(idv: *i64, geno: i64, poly: i64, sexg: i64, epi: i64, nick: i64) -> i64
162func idv_dials(idv: *i64, weights: *i64) -> i64
called by 1: main calls 1: idv_clamp
175func idv_style_params(idv: *i64, style: i64, out: *i64) -> i64
called by 2: maindraw_figure
194func idv_bodyproc_args(idv: *i64, style: i64, out: *i64) -> i64
called by 1: main
212func idv_key(idv: *i64) -> i64
called by 2: mainmain
224func idv_distance(a: *i64, b: *i64) -> i64
called by 2: mainmain
242func idv_same(a: *i64, b: *i64) -> i64
called by 2: mainmain
252func idv_serialize(idv: *i64, S: *i64) -> i64
called by 1: main
257func idv_restore(idv: *i64, S: *i64) -> i64
called by 1: main
265func idv_canon_ok(idv: *i64) -> i64
called by 1: main
275func idv_style_name(s: i64) -> *u8
called by 1: main