code wiki / (root) / nx_phi.nx

nx_phi.nx

buildroot/runtime/nx_phi.nx

3886 B103 linesdepth 2pulls 2 transitivereach 17 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_phi.nx -- golden ratio + Fibonacci primitives for S-class anatomy canon. phi = (1 + sqrt(5)) / 2 = 1.6180339887... In Q10 (1024 = 1.0): phi = 1657 1/phi = 633 phi^2 = 2681 1/phi^2 = 391 Every canonical body ratio (bust:waist / hip:waist / total:navel / shoulder:waist / face_height:face_width / pupil-pair:pupil-mouth) converges to a phi-power. Substrate scores measured ratios by their Q10 distance to the nearest phi-power. Fibonacci sequence underwrites: limb-segment ratios, finger phalanges, spiral floral patterns -- ratio of successive terms converges to phi. Useful for proportional CHECK on limb segments AND for procedurally generating phi-progression seeds. nx_safety_envelope: intended_use: "Golden ratio (phi) constant + progression primitives -- visual/audio aesthetic composition + procedural seeding" sil_target: SIL1 asil_target: QM dal_target: NONE evidence: [Q14_fixed_point_phi_constant, bit_equal_reproducible, no_FP] hazard_register: [bug-tape-phi-precision-drift-on-iteration, bug-tape-fibonacci-overflow-i64] residual_risk: "Q14 phi has ~5 decimal digits accuracy. Substrate cannot exceed without higher precision (Q24 / i128 queued)." verdict: NOT_YET_EVALUATED

dependencies 1 imports · 7 importers

nx_syscalls.nx nx_phi.nx nx_beauty_score.nx nx_beauty_score_test.nx nx_breast_drape_pose.nx nx_canon_proportions.nx nx_canon_proportions_test.nx nx_perineum_distance.nx nx_phi_test.nx

imports: nx_syscalls.nx

imported by: nx_beauty_score.nxnx_beauty_score_test.nxnx_breast_drape_pose.nxnx_canon_proportions.nxnx_canon_proportions_test.nxnx_perineum_distance.nxnx_phi_test.nx

structs

none

consts

36const NX_Q10: i64 = 1024
37const NX_PHI_Q10: i64 = 1657 // 1.618 * 1024
38const NX_PHI_INV_Q10: i64 = 633 // 0.618 * 1024
39const NX_PHI_SQ_Q10: i64 = 2681 // 2.618 * 1024
40const NX_PHI_INV_SQ_Q10: i64 = 391 // 0.382 * 1024
41const NX_PHI_TOLERANCE_Q10: i64 = 102 // 0.1 default band
44const NX_PHI_BAND_WITHIN: i64 = 0
45const NX_PHI_BAND_BELOW: i64 = 1
46const NX_PHI_BAND_ABOVE: i64 = 2

functions

49func nx_ratio_q10(a: i64, b: i64) -> i64
55func nx_q10_abs_distance(a_q10: i64, b_q10: i64) -> i64
61func nx_distance_to_target(ratio_q10: i64, target_q10: i64) -> i64
66func nx_phi_band_check(ratio_q10: i64, tolerance_q10: i64) -> i64
called by 1: main calls 1: nx_q10_abs_distance
75func nx_proportion_score_q10(ratio_q10: i64, target_q10: i64,
83func nx_fib(n: i64) -> i64
99func nx_fib_ratio_q10(n: i64) -> i64
called by 1: main calls 2: nx_fibnx_ratio_q10