code wiki / _hdl_build / nx_char_identity.nx
nx_char_identity.nx
buildroot/runtime/_hdl_build/nx_char_identity.nx
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
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
| 41 | const IDV_SLOTS: i64 = 24 |
| 43 | const IDV_SEED: i64 = 0 // the individual |
| 44 | const IDV_SEX: i64 = 1 // 0..1000 body dimorphism (nx_body_proc scale) |
| 45 | const IDV_BUILD: i64 = 2 // 0..1000 lean..heavy |
| 46 | const IDV_MUSC: i64 = 3 // 0..1000 soft..muscular |
| 47 | const IDV_STATURE:i64 = 4 // mm |
| 48 | const IDV_LBR: i64 = 5 // leg-to-body ratio, PER-MILLE (measured canon: 491 +- 15) |
| 49 | const IDV_SHIP: i64 = 6 // shoulder:hip x100 |
| 50 | const IDV_D0: i64 = 7 // ---- 8 FACE/BODY MORPH DIALS, each 0..256 = nx_morph's weight range ---- |
| 51 | const IDV_D1: i64 = 8 |
| 52 | const IDV_D2: i64 = 9 |
| 53 | const IDV_D3: i64 = 10 |
| 54 | const IDV_D4: i64 = 11 |
| 55 | const IDV_D5: i64 = 12 |
| 56 | const IDV_D6: i64 = 13 |
| 57 | const IDV_D7: i64 = 14 |
| 58 | const IDV_SKIN: i64 = 15 // packed r|g<<8|b<<16 |
| 59 | const IDV_HAIR: i64 = 16 |
| 60 | const IDV_EYE: i64 = 17 |
| 61 | const IDV_HAIRSTYLE: i64 = 18 |
| 62 | const IDV_ARCH: i64 = 19 // temperament/archetype, derived -- drives expression defaults |
| 64 | const IDV_STYLE: i64 = 20 // 0 realistic 1 anime 2 cartoon 3 VN |
| 65 | const IDV_POSE: i64 = 21 |
| 66 | const IDV_OUTFIT: i64 = 22 |
| 67 | const IDV_EXPR: i64 = 23 |
| 68 | const IDV_NIDENT: i64 = 20 // slots [0, IDV_NIDENT) are the identity half -- the gate asserts on this |
| 70 | const IDV_NDIAL: i64 = 8 |
| 71 | const IDV_DIALMAX: i64 = 256 // nx_morph weight range |
| 74 | const IDV_LBR_MEAN: i64 = 491 // Versluys 2018, leg-to-body ratio |
| 75 | const IDV_LBR_SD: i64 = 15 |
| 76 | const IDV_SHIP_LO: i64 = 113 // Aich 2026 male shoulder:hip 1.13..1.45 |
| 77 | const IDV_SHIP_HI: i64 = 145 |
functions
| 79 | func idv_rng(s: *i64) -> i64 called by 1: idv_from_seed |
| 86 | func idv_clamp(v: i64, lo: i64, hi: i64) -> i64 |
| 94 | func idv_from_seed(idv: *i64, seed: i64) -> i64 |
| 134 | func idv_from_companion(idv: *i64, geno: i64, poly: i64, sexg: i64, epi: i64, nick: i64) -> i64 |
| 162 | func idv_dials(idv: *i64, weights: *i64) -> i64 |
| 175 | func idv_style_params(idv: *i64, style: i64, out: *i64) -> i64 |
| 194 | func idv_bodyproc_args(idv: *i64, style: i64, out: *i64) -> i64 called by 1: main |
| 212 | func idv_key(idv: *i64) -> i64 |
| 224 | func idv_distance(a: *i64, b: *i64) -> i64 |
| 242 | func idv_same(a: *i64, b: *i64) -> i64 |
| 252 | func idv_serialize(idv: *i64, S: *i64) -> i64 called by 1: main |
| 257 | func idv_restore(idv: *i64, S: *i64) -> i64 called by 1: main |
| 265 | func idv_canon_ok(idv: *i64) -> i64 called by 1: main |
| 275 | func idv_style_name(s: i64) -> *u8 called by 1: main |