Skip to content

feat(igla): Trinity Constants + φ-LR Schedule (IGLA-GF16 Modules 1 & 5)#58

Closed
gHashTag wants to merge 7 commits into
mainfrom
feat/issue-3-igla-gf16-core
Closed

feat(igla): Trinity Constants + φ-LR Schedule (IGLA-GF16 Modules 1 & 5)#58
gHashTag wants to merge 7 commits into
mainfrom
feat/issue-3-igla-gf16-core

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

Implements Modules 1 and 5 from IGLA-GF16 (#3).

Module 1: Trinity Constants (src/trinity_constants.zig)

  • PHI, PHI_SQ, PHI_INV, PHI_INV_SQ, TRINITY (φ² + 1/φ² = 3)
  • ALPHA_PHI = PHI - 1.5 = 0.118034 — matches strong coupling constant α_s
  • Fibonacci array: {1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987}
  • Architecture constants: d_model=144, n_heads=8, d_head=18, d_ffn=233, n_layers=7
  • Trinity weight init stds: gauge/higgs/lepton/cosmology sectors
  • trinityInitStd() function for init std lookup

Module 5: φ-LR Schedule

  • phiLrSchedule(step, total_steps): warmup over Fib(7)=21 steps, then φ-decay
  • LR_INIT = ALPHA_PHI = 0.118034, LR_TAU = 228.9

Tests (6)

  • Trinity Identity: PHI² + PHI⁻² = 3 (tolerance 1e-12)
  • ALPHA_PHI correctness
  • Fibonacci: 144 × φ ≈ 233
  • Architecture dimensions
  • Init std ordering and ratio
  • LR schedule warmup+decay

Part of #3

The test file does #include <goldenfloat/gf16.hpp> but the cpp/include
directory was not in the include path, causing a build failure.

Closes #36
- Fix root Cargo.toml malformed cfg: cfg(unix(all(not(...)))) -> cfg(unix)
- Add #include "gf16.h" to Go cgo preamble (was missing, all C names unresolved)
- Add zig-out/bin to Python library search paths for CI compatibility
Closes #28 — replace goto-bus/setup-zig with mlugg/setup-zig in both
test-bindings.yml and release.yml.

Closes #35 — add #![allow(non_camel_case_types)] to goldenfloat-sys
lib.rs for FFI-style type names.

Closes #38 — GF16.fromF32 now maps NaN to exp=0x3F,mant=1 (not inf).
GF16.toF32 returns std.math.nan when exp=0x3F and mant!=0.

Closes #36 — add cpp/include to CMakeLists include_directories so
<goldenfloat/gf16.hpp> resolves.

Closes #37 — remove import "C" from gf16_test.go (Go forbids cgo
in test files). Rewrite tests as exported Test* functions using the
Go wrapper API from gf16.go.
…path

- Rust ffi_example.rs: use .0 for UpperHex, inline bit extraction
  instead of missing GF16_SIGN/EXP/MANT macros
- Go gf16.go: add #include "gf16.h", fix C type conversions
  (C.float/float32, C.bool/bool, C.uint16_t/Gf16)
- C++: remove committed cpp/build/ from git, add to .gitignore,
  CI now rm -rf build before cmake
- Python: add GOLDENFLOAT_LIB_DIR env var support
- CI: set GOLDENFLOAT_LIB_DIR and LD_LIBRARY_PATH after zig build shared
The 'shared' named step depended on c_abi_lib.step (compile) instead of
the install step returned by installArtifact(). This meant 'zig build
shared' compiled the library but never copied it to zig-out/lib/, so
all bindings failed to find it at link/runtime.
Implements IGLA-GF16 Module 1 from #3:
- PHI, PHI_SQ, PHI_INV, PHI_INV_SQ, TRINITY constants
- ALPHA_PHI = PHI - 1.5 = 0.118034 (matches alpha_s coupling)
- Fibonacci sequence array (16 terms up to 987)
- IGLA-GF16 architecture constants (d_model=144, n_heads=8, d_ffn=233)
- Trinity weight init stds (gauge/higgs/lepton/cosmology sectors)
- φ-LR schedule with warmup (Module 5)
- 6 tests including Trinity Identity and architecture verification

Part of #3
@gHashTag
Copy link
Copy Markdown
Owner Author

Replaced by clean PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant