code wiki / (root) / nx_id_palette.nx

nx_id_palette.nx

buildroot/runtime/nx_id_palette.nx

4451 B87 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind librarytopic id
docsdependenciesstructsconstsfunctions

about

nx_id_palette.nx -- THE CORRELATED IDENTITY PALETTE. /compare/procgen C33, symbol gn_palette_sample. The first consumer of nx_id_param_core, and the direct answer on the GENERATOR side to the operator's "our colour palette is barely used". WHAT WAS THERE BEFORE, MEASURED: nx_breeding carries exactly ONE colour trait, GN_T_HUE, drawn as an independent uniform. nx_skin_ita then maps that single scalar onto a straight L* locus at fixed a* and fixed b*. So a cast of N characters occupies a ONE-DIMENSIONAL, UNCORRELATED colour space: nothing about a character's hair relates to anything about her skin, because there is no hair gene at all -- the live page tints the iris with the same scalar. WHAT THIS EMITS: three swatch genes -- skin, hair, eye -- drawn from ONE shared melanin factor with a per-tissue loading, so they COVARY. Each lands on nx_breeding's own 0..1000 range, so a swatch is a drop-in for the single hue trait it supersedes rather than a parallel colour system. THE LOADINGS ARE THE MODEL'S ONLY FREE PARAMETERS AND THEIR ORDERING IS THE FALSIFIABLE CLAIM: skin is the most strongly determined by the shared melanin factor, hair next, eye least -- iris colour is the most independently varying of the three. That ordering, not the exact values, is what the gate tests, and the values live in knowledge/id_palette.conf with their provenance. THE INCUMBENT IS KEPT RUNNABLE below as the control. A baseline you cannot re-run is a number and not a control, so the gate measures the old behaviour at runtime instead of quoting a figure. LIB, no main (ecosystem convention). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_id_param_core.nx nx_skin_ita.nx nx_id_palette.nx nx_id_param_gate.nx

imports: nx_syscalls.nxnx_id_param_core.nxnx_skin_ita.nx

imported by: nx_id_param_gate.nx

structs

none

consts

28const IDPAL_FACTOR_MELANIN: i64 = 0 // the shared chromophore. Factor ids are split streams too.
29const IDPAL_AX_SKIN: i64 = 0
30const IDPAL_AX_HAIR: i64 = 1
31const IDPAL_AX_EYE: i64 = 2
32const IDPAL_N: i64 = 3
34const IDPAL_LOAD_SKIN: i64 = 900
35const IDPAL_LOAD_HAIR: i64 = 750
36const IDPAL_LOAD_EYE: i64 = 600
37const IDPAL_SPAN: i64 = 1000 // nx_breeding's GN_T_HUE range, matched deliberately
38const IDPAL_V: i64 = 1

functions

40func gn_palette_version() -> i64 { return IDPAL_V }
called by 1: main
41func gn_palette_load(axis: i64) -> i64
called by 1: gn_palette_sample
50func gn_palette_sample(seed: i64, out3: *i64) -> i64
63func gn_palette_sample_uncorrelated(seed: i64, out3: *i64) -> i64
called by 1: main calls 2: idp_to_spanidp_fan
76func gn_palette_sample_collapsed(seed: i64, out3: *i64) -> i64
called by 1: main calls 2: idp_masteridp_to_span
85func gn_palette_skin_srgb(skin_gene: i64, region_dl: i64, out3: *i64) -> i64
called by 1: main calls 1: si_albedo_of_gene