GF Competitive Analysis — Proving GoldenFloat is Not Random
Date: 2026-04-07
Status: Working Draft
Architecture: every step = tri CLI + experience/ source of truth .trinity
Why This Work Is Needed
The t27 project implements GoldenFloat (GF) — a family of 7 floating-point formats (GF4, GF8, GF12, GF16, GF20, GF24, GF32) designed around the golden ratio φ ≈ 1.618. Current benchmarks exist but we need:
- GMP Integration — arbitrary precision verification (100+ digits via Python mpmath)
- Mathematical proof that GF is not random — derived from sacred geometry
- Competitive comparison against IEEE 754, OCP MXFP, mainstream languages
- Scientific documentation following zig-golden-float whitepaper standards
- Cross-language verification proving ternary computes more decimal places accurately
Phase 0 — GMP / mpmath Integration (P0 TODAY)
0.1 Create scripts/verify_precision.py
Python mpmath script outputting all sacred constants at 100 decimal digits:
from mpmath import mp, mpf, sqrt
import json
mp.dps = 100 # 100 decimal digits
phi = (mp.mpf(1) + sqrt(mp.mpf(5))) / mp.mpf(2)
phi_inv = 1 / phi
phi_sq = phi * phi
# Pellis closed form (FORMULA_TABLE.md row 31)
term1 = 360 / phi_sq
term2 = -2 / (phi ** 4)
term3 = 1 / (3 * phi) ** 5
pellis = term1 + term2 + term3
results = {
"precision_digits": 100,
"phi": str(phi),
"phi_inv": str(phi_inv),
"phi_sq": str(phi_sq),
"pellis_100_digits": str(pellis),
"pi": str(mp.pi),
"e": str(mp.e),
"phi_identity_check": str(phi_sq - phi - 1), # should be ~0
"trinity_identity_check": str(phi_sq + 1/phi_sq - 3) # should be ~0
}
print(json.dumps(results, indent=2))
Output: JSON with all sacred constants at 100 digits, stored in .trinity/experience/precision_verify.json
0.2 Update research/trinity-pellis-paper/FORMULA_TABLE.md
Add row 31 with Pellis value pre-registered to 50 digits:
137.03599916476639345... (50 digits fixed)
- Mark as "verified via mpmath (100 digits)"
- Add pre-registered checkpoint section for CODATA 2026/2030 comparison
0.3 Future: tri math compare --precision N
Add --precision-bits flag to bootstrap/src/math_compare.rs to compute sacred constants at N digits via Python subprocess.
Phase 1 — New Spec: specs/numeric/gf_competitive.t27
Create spec with:
test golden_float_phi_representation — GF32 error < 5.0e-4
test golden_float_vs_ieee_sacred_constants — GF16 mean error <= IEEE × 0.9
test roundtrip_uniform_distribution — NMSE GF16 <= IEEE FP16 × 1.01
test addition_precision_phi_relation — φ² = φ+1 identity in GF16
test accumulation_stability — sum 10^6 terms, rel_error < 1e-4
test ternary_vs_python_decimal_places — ternary >= IEEE f64 places
invariant gf16_phi_distance_is_measurable
invariant phi_split_is_optimal
bench gf16_encode_decode_latency — target < 50 ns
Compliance: L4 TESTABILITY — must include test/invariant/bench sections (SOUL.md Art II).
Phase 2 — New Spec: specs/numeric/pellis_verify.t27
GMP-backed Pellis verification spec:
- Import from
specs/physics/pellis-formulas.t27
test pellis_100_digit_verification — compare mpmath output with CODATA 2022 α⁻¹
invariant pellis_preregistered_checkpoint — fixed 50-digit value
Phase 3 — Language Harness Directory: benchmarks/language_tests/
Create harnesses outputting JSON {test_name, input, result, decimal_places, error, time_ns}:
| File |
Language |
Type |
python_float64.py |
Python |
IEEE f64 baseline |
python_decimal.py |
Python |
Decimal exact |
python_fractions.py |
Python |
Rational arithmetic |
javascript_number.js |
Node.js |
Web standard |
rust_f64.rs |
Rust |
System reference |
cpp_double.cpp |
C++ |
Low-level reference |
Test scenarios: π calculation, φ iteration φ_{n+1} = 1 + 1/φ_n, accumulation Σ 1/n for n=1..10⁶.
Phase 4 — Whitepaper: docs/WHITEPAPER/gf_not_random.md
Structure:
- Abstract — GF derived from sacred geometry via optimization
- Background — problem statement, φ in nature
- Mathematical Foundation — Phi-Split Optimality Theorem + proof
- Anti-Randomness Arguments — algebraic derivation, universality, falsifiability
- Experimental Results — sacred constants accuracy, roundtrip precision, cross-language
- Use Case Recommendations — GF16 primary, GF32 high precision, GF8 weight compression
- Conclusion + References
All Files to Create/Modify
| File |
Action |
Priority |
scripts/verify_precision.py |
CREATE |
P0 TODAY |
research/trinity-pellis-paper/FORMULA_TABLE.md |
MODIFY (add row 31 + 50-digit Pellis) |
P0 TODAY |
specs/numeric/gf_competitive.t27 |
CREATE |
P1 |
specs/numeric/pellis_verify.t27 |
CREATE |
P1 |
bootstrap/src/math_compare.rs |
MODIFY (add --precision N) |
P1 |
benchmarks/language_tests/python_float64.py |
CREATE |
P2 |
benchmarks/language_tests/python_decimal.py |
CREATE |
P2 |
benchmarks/language_tests/rust_f64.rs |
CREATE |
P2 |
benchmarks/language_tests/javascript_number.js |
CREATE |
P2 |
docs/WHITEPAPER/gf_not_random.md |
CREATE |
P2 |
conformance/gf_competitive_bench.json |
CREATE |
P2 |
Verification Gates
# Phase 1: Spec validation
./scripts/tri parse specs/numeric/gf_competitive.t27
./scripts/tri gen specs/numeric/gf_competitive.t27
./bootstrap/target/release/t27c test specs/numeric/gf_competitive.t27
# Phase 2: mpmath precision check
python3 scripts/verify_precision.py > .trinity/experience/precision_verify.json
# Phase 3: Language harnesses
cd benchmarks/language_tests && python3 python_float64.py > results/python_float64.json
# Phase 4: Competitive suite
./scripts/tri math compete --sacred --roundtrip --languages --full --format json
Success Criteria
Invariant Laws Compliance (per SOUL.md / AGENTS.md)
- L1 TRACEABILITY: All PRs implementing this work must include
Closes #<this-issue>
- L2 GENERATION:
gen/ output generated from specs — no hand-editing
- L3 PURITY: All
.t27 files ASCII-only, English identifiers
- L4 TESTABILITY: Every new
.t27 spec must contain test/invariant/bench
- L7 UNITY: Python scripts in
scripts/ are permitted; no new *.sh on critical path
φ² + 1/φ² = 3 | TRINITY
GF Competitive Analysis — Proving GoldenFloat is Not Random
Date: 2026-04-07
Status: Working Draft
Architecture: every step =
triCLI +experience/source of truth.trinityWhy This Work Is Needed
The t27 project implements GoldenFloat (GF) — a family of 7 floating-point formats (GF4, GF8, GF12, GF16, GF20, GF24, GF32) designed around the golden ratio φ ≈ 1.618. Current benchmarks exist but we need:
Phase 0 — GMP / mpmath Integration (P0 TODAY)
0.1 Create
scripts/verify_precision.pyPython mpmath script outputting all sacred constants at 100 decimal digits:
Output: JSON with all sacred constants at 100 digits, stored in
.trinity/experience/precision_verify.json0.2 Update
research/trinity-pellis-paper/FORMULA_TABLE.mdAdd row 31 with Pellis value pre-registered to 50 digits:
137.03599916476639345...(50 digits fixed)0.3 Future:
tri math compare --precision NAdd
--precision-bitsflag tobootstrap/src/math_compare.rsto compute sacred constants at N digits via Python subprocess.Phase 1 — New Spec:
specs/numeric/gf_competitive.t27Create spec with:
test golden_float_phi_representation— GF32 error < 5.0e-4test golden_float_vs_ieee_sacred_constants— GF16 mean error <= IEEE × 0.9test roundtrip_uniform_distribution— NMSE GF16 <= IEEE FP16 × 1.01test addition_precision_phi_relation— φ² = φ+1 identity in GF16test accumulation_stability— sum 10^6 terms, rel_error < 1e-4test ternary_vs_python_decimal_places— ternary >= IEEE f64 placesinvariant gf16_phi_distance_is_measurableinvariant phi_split_is_optimalbench gf16_encode_decode_latency— target < 50 nsCompliance: L4 TESTABILITY — must include
test/invariant/benchsections (SOUL.md Art II).Phase 2 — New Spec:
specs/numeric/pellis_verify.t27GMP-backed Pellis verification spec:
specs/physics/pellis-formulas.t27test pellis_100_digit_verification— compare mpmath output with CODATA 2022 α⁻¹invariant pellis_preregistered_checkpoint— fixed 50-digit valuePhase 3 — Language Harness Directory:
benchmarks/language_tests/Create harnesses outputting JSON
{test_name, input, result, decimal_places, error, time_ns}:python_float64.pypython_decimal.pypython_fractions.pyjavascript_number.jsrust_f64.rscpp_double.cppTest scenarios: π calculation, φ iteration
φ_{n+1} = 1 + 1/φ_n, accumulation Σ 1/n for n=1..10⁶.Phase 4 — Whitepaper:
docs/WHITEPAPER/gf_not_random.mdStructure:
All Files to Create/Modify
scripts/verify_precision.pyresearch/trinity-pellis-paper/FORMULA_TABLE.mdspecs/numeric/gf_competitive.t27specs/numeric/pellis_verify.t27bootstrap/src/math_compare.rs--precision N)benchmarks/language_tests/python_float64.pybenchmarks/language_tests/python_decimal.pybenchmarks/language_tests/rust_f64.rsbenchmarks/language_tests/javascript_number.jsdocs/WHITEPAPER/gf_not_random.mdconformance/gf_competitive_bench.jsonVerification Gates
Success Criteria
scripts/verify_precision.pyoutputs 100-digit Pellis valueFORMULA_TABLE.mdrow 31 pre-registered at 50 digits with mpmath verification notespecs/numeric/gf_competitive.t27passestri test(L4 compliant)specs/numeric/pellis_verify.t27passestri testdocs/WHITEPAPER/gf_not_random.mdcompleteconformance/gf_competitive_bench.jsonNOW.mdupdated with ring iteration entry.trinity/experience/clara_track1.jsonlInvariant Laws Compliance (per SOUL.md / AGENTS.md)
Closes #<this-issue>gen/output generated from specs — no hand-editing.t27files ASCII-only, English identifiers.t27spec must containtest/invariant/benchscripts/are permitted; no new*.shon critical pathφ² + 1/φ² = 3 | TRINITY