nx_phi.nx
buildroot/runtime/nx_phi.nx
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
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
| 36 | const NX_Q10: i64 = 1024 |
| 37 | const NX_PHI_Q10: i64 = 1657 // 1.618 * 1024 |
| 38 | const NX_PHI_INV_Q10: i64 = 633 // 0.618 * 1024 |
| 39 | const NX_PHI_SQ_Q10: i64 = 2681 // 2.618 * 1024 |
| 40 | const NX_PHI_INV_SQ_Q10: i64 = 391 // 0.382 * 1024 |
| 41 | const NX_PHI_TOLERANCE_Q10: i64 = 102 // 0.1 default band |
| 44 | const NX_PHI_BAND_WITHIN: i64 = 0 |
| 45 | const NX_PHI_BAND_BELOW: i64 = 1 |
| 46 | const NX_PHI_BAND_ABOVE: i64 = 2 |
functions
| 49 | func nx_ratio_q10(a: i64, b: i64) -> i64 |
| 55 | func nx_q10_abs_distance(a_q10: i64, b_q10: i64) -> i64 |
| 61 | func nx_distance_to_target(ratio_q10: i64, target_q10: i64) -> i64 calls 1: nx_q10_abs_distance |
| 66 | func nx_phi_band_check(ratio_q10: i64, tolerance_q10: i64) -> i64 |
| 75 | func nx_proportion_score_q10(ratio_q10: i64, target_q10: i64, |
| 83 | func nx_fib(n: i64) -> i64 |
| 99 | func nx_fib_ratio_q10(n: i64) -> i64 |