When I worked the sailboats, Appledore II there in Key West, I was fired, then promoted, then I quit - all for doing the right thing. The Commodore and a gentleman we can call Pablo made for an interesting work-cation.
The former never paid me, and the latter couldn’t park a boat and wanted to revolutionize the industry (and it would be rightly inferred our trip) sans traditionalism. I was about to go underway (Key West to Camden, Maine) with the REAL capitan’ playing second fiddle, I was got out of there.
There were some other dramas leading up to my later promotion and finally days later quitting, and one other (one of many beloved friends) even quit in honor of my own departure after he got to experience a bit of chop on the high seas.
He was the more wise than I, a former Navy fella, worked real hard too. I wish I could have seen the high seas, well that trip anyways..
Long story short, I never got paid but I did learn something I will remember the rest of my life, something nobody will ever be able to take away from me - that I was there.
Some time later, the same capitan’ (the good one) got me the job rafting the rivers. His company would later find itself cannibalized by the shifting sands underfoot. A new culture betraying the old became, and I, being a pawn in this equation, was got out of there before it, the mask-wearing raft guide culture of new, was fomented.
And so I, knowing I would never run stick again unless choosing to grovel, wept for the departure of Josef K. and himself capitan’ as paddle. “Sure does.”
So began the next chapter of my life.
Oh, the software..
This analog-over-digital substrate fully abstracts and agnosticizes the hardware away from the OS instances, called faces, fabrices, or projections, depending on what your bot renders in less ornery the means of. It also makes agnostic the OS thanks to the Universal Interpreter / translator.
Although our substrate is analog (over digital), the real magic, I think, is that it utilizes DNA (genomes) concepts to coral our analog into something much more useful.
Our bot HATES .asm, even though we must utilize .asm for most of this to be properly optimized.
The evolution was as follows - Analog Substrate, Vantages of Zero (link below), faces, Commodore 64, Main Repo, Universal Interpreter, Alpine. Obviously, Main Repo is my main work in this context, it has a nice readme to serve as a roadmap should I never be able to complete this my life’s work.
God bless.
Archival (You know, all the files) -
Commodore 64 -
Choice Works
Index of /demo/8.7.26 - The Commodore (64)/Choice Works/ (to be announced)
ISO testing tool (requires Qemu) -
Just ISO’s
Main Repo -
Universal Interpreter -
Alpine (new) -
More Alpine -
Faces (primitives)
asm distilled elegant 64-bit (addition-only phi ladder)
; ============================================================================
; HDGL — Z[φ] SUBSTRATE KERNEL
;
; Representation:
; (a,b) ≡ a·φ + b
;
; φ² = φ + 1
;
; Therefore:
;
; T(a,b) = (a+b,a) multiply by φ
; T⁻¹(a,b) = (b,a-b) divide by φ
;
; No φ is ever numerically computed.
; No multiplication is required by the ladder.
; The state is carried entirely as an integer pair.
;
; Norm:
;
; N(a,b) = -a² + ab + b²
;
; and therefore:
;
; N(φᵏ) = (-1)ᵏ
;
; Kernel state:
;
; a,b ∈ Z
;
; ============================================================================
BITS 64
section .bss
; The carried Z[φ] state:
;
; Ω = a·φ + b
;
a: resq 1
b: resq 1
section .text
global _start
; ============================================================================
; PHI STEP
;
; (a,b) → (a+b,a)
;
; This is multiplication by φ:
;
; φ(aφ+b)
; = aφ²+bφ
; = a(φ+1)+bφ
; = (a+b)φ+a
;
; The entire forward ladder is therefore ADD + MOVE.
; ============================================================================
phi_step:
mov rax, [a] ; rax = a
mov rbx, [b] ; rbx = b
add rbx, rax ; rbx = a+b
mov [b], rax ; new b = old a
mov [a], rbx ; new a = old a+b
ret
; ============================================================================
; PHI UNSTEP
;
; (a,b) → (b,a-b)
;
; This is the exact inverse of phi_step.
;
; T⁻¹(T(a,b))
; = T⁻¹(a+b,a)
; = (a,(a+b)-a)
; = (a,b)
;
; The reverse ladder is therefore SUB + MOVE.
; ============================================================================
phi_unstep:
mov rax, [a] ; rax = a
mov rbx, [b] ; rbx = b
mov [a], rbx ; new a = old b
sub rax, rbx ; rax = old a-old b
mov [b], rax ; new b = old a-old b
ret
; ============================================================================
; NORM
;
; N(a,b) = -a² + ab + b²
;
; This is the quadratic form preserved by the φ dynamics up to sign:
;
; N(T(a,b)) = -N(a,b)
;
; Consequently:
;
; N(φᵏ) = (-1)ᵏ
;
; Input:
; rdi = a
; rsi = b
;
; Output:
; rax = N(a,b)
;
; This routine is not required by the ladder itself.
; It is the invariant/readout of the kernel.
; ============================================================================
norm:
mov r8, rdi ; r8 = a
mov r9, rsi ; r9 = b
mov rax, r8 ; rax = a
imul rax, r8 ; rax = a²
neg rax ; rax = -a²
mov r10, rax ; r10 = -a²
mov rax, r8 ; rax = a
imul rax, r9 ; rax = ab
add r10, rax ; r10 = -a²+ab
mov rax, r9 ; rax = b
imul rax, r9 ; rax = b²
add r10, rax ; r10 = -a²+ab+b²
mov rax, r10 ; return N(a,b)
ret
; ============================================================================
; KERNEL ENTRY
;
; Initialize:
;
; Ω = φ⁰ = 1
; φ⁰ = (0,1)
;
; Then the machine simply carries the state.
; ============================================================================
_start:
mov qword [a], 0 ; a = 0
mov qword [b], 1 ; b = 1
.loop:
call phi_step ; Ω ← φΩ
jmp .loop ; the ladder has no terminal state
asm long form
; ============================================================================
; hdgl.asm — Z[φ] SUBSTRATE, BARE METAL
; ----------------------------------------------------------------------------
; NO libc • NO libm • NO FPU • NO SSE • NO imul • NO mul • NO idiv • NO div
; NO φ constant • NO Newton • NO convergence • NO tolerance • NO rounding
;
; Ω is an exact integer pair (a,b) ≡ a·φ + b in Z[φ].
; φ is NEVER computed. It is CARRIED.
;
; φ-step : (a,b) ↦ (a+b, a) ADD. the Fibonacci step. the whole engine.
; φ-unstep : (a,b) ↦ (b, a−b) SUB. exact reverse. S = T⁻¹.
; norm : N(a,b) = −a²+ab+b² the trinary. N(φᵏ)=(−1)ᵏ.
; e^(iπ) : φ⁻¹ − φ¹ = (0,−1) exact. integer. no transcendental.
; fire : Ω² > Ω ⟺ Ω > √Ω the exit, tested without leaving the ring.
; frobenius: φⁿ ≡ φ (split) | ψ (inert) readout. necessary, not sufficient.
; gate : LL s ← s²−2 mod 2ᵖ−1 exact recurrence. decides.
;
; Multiply is synthesized from shift-add (imul_soft). The LADDER needs none.
;
; Build: nasm -f elf64 hdgl.asm -o hdgl.o && ld hdgl.o -o hdgl
; Run: ./hdgl -> prints the substrate, exits 161 = floor(φ·100)
; ============================================================================
%define SYS_write 1
%define SYS_exit 60
%define STDOUT 1
section .bss
a resq 1 ; Ω.a
b resq 1 ; Ω.b
numbuf resb 32
llbuf resq 64 ; LL residue (Mersenne, small p)
section .rodata
m_ladder: db 10,"LADDER phi^k = (F(k),F(k-1)) step:(a,b)->(a+b,a) ADD only",10
db " k a b N",10,0
m_norm: db 10,"TRINITY N(phi^k)=(-1)^k [Cassini] det = N at every layer",10,0
m_rev: db 10,"FLOW unstep x9 from phi^6 -> phi^-3 : ",0
m_revok: db " S = T^-1 exact",0
m_euler: db 10,"EULER e^(i*pi) = phi^-1 - phi^1 = ",0
m_sqrt5: db 10,"SQRT5 (2,-1)^2 = ",0
m_seventh: db 10,"SEVENTH phi^0 = 1_eff = ",0
m_fire: db 10,"FIRE sqrt(Omega) not in Z[phi]. N(sqrt)=i. test: Om^2>Om",10
db " k fires",10,0
m_frob: db 10,"FROBEN phi^p mod p == phi (split, p=+/-1 mod5) | psi (inert)",10
db " p p%5 kind phi^p mod p ok",10,0
m_gate: db 10,"GATE LL s<-s^2-2 mod 2^p-1 exact. decides.",10
db " p M_p s_{p-2} prime",10,0
m_bound: db 10,"BOUND Delta : hardware entropy, external by design",10
db " 2^n : base-2 expansion. load-bearing. an import.",10
db " primality: exact recurrence decides. no ring-native",10
db " sufficient test known. theorem-level gap.",10
db " Z[phi] contains Z. 2 = 1+1. nothing else imported.",10,0
m_phi: db 10,"PHI floor(phi*100) from F(76)/F(75), integers only = ",0
m_done: db 10,"phi is carried, never computed. The ladder is ADD.",10
db "The trinary is the norm. The origin is the unique N=0,",10
db " one step from the pole.",10
db "The seventh is phi^0, and it is the tower's limit.",10
db "Squaring climbs. Stepping walks.",10
db "Readouts diagnose. Recurrence decides.",10,0
s_split: db "SPLIT ",0
s_inert: db "INERT ",0
s_ramif: db "RAMIF ",0
s_yes: db "yes",0
s_no: db "no ",0
s_ok: db " ok",0
s_bad: db " BAD",0
s_nl: db 10,0
s_sp: db " ",0
s_lp: db "(",0
s_rp: db ")",0
s_cm: db ",",0
m_orig2: db 10,"ORIGIN N(0,0) = ",0
m_orig3: db " the unique norm-zero. X = 0.",0
frob_p: dq 2,3,5,7,11,13,17,19,23,29,31
frob_n: equ 11
ll_p: dq 3,5,7,11,13,17,19,23
ll_n: equ 8
m_psp: db 10,"PSEUDO Frobenius is NECESSARY, not SUFFICIENT:",10
db " n n%5 phi^n mod n passes prime?",10,0
psp_n: dq 4181, 5777, 6721, 10877, 13201
psp_c: equ 5
s_comp: db " COMPOSITE 37x113 etc",0
m_gate2: db " readouts diagnose. the recurrence decides.",10,0
m_oct: db 10,"OCTAVE GF(4)=Z[phi]/(2): phi^3=1 the TRINITY as a group",10
db " GF(9)=Z[phi]/(3): phi^8=1 the OCTAVE 7->8->7'",10,0
m_gf4: db " GF(4): ",0
m_gf9: db " GF(9): ",0
m_vant: db 10,"VANTAGE one ladder, three coordinate systems",10
db " V1 (-1,0,+1) value N(phi^k)=(-1)^k",10
db " V2 (-inf,0,inf) exponent phi^k -> 0 | inf",10
db " V3 -inf=0=inf sphere T(0)=inf : adjacency, one step",10
db " orbit of the origin, exact pairs:",10,0
m_tower: db 10,"TOWER x^(2^(k+1)) - x^(2^k) - 1 = 0 deg 2^(k+1)",10
db " k=0 deg 2 N=e^(i*pi) = -1 phi x^2-x-1",10
db " k=1 deg 4 N=e^(i*pi/2)= i sqrt(phi) x^4-x^2-1",10
db " sqrt(-1) = (i,-1) : rungs 1 and 0, one sqrt apart",10
db " k -> inf : N -> 1 = phi^0 = 1_eff. no top. no bottom.",10
db " rung-1 crossing Om^2 > Om :",10
db " k fires",10,0
m_wuwei: db 10,"WUWEI P_n dropped. log(P_n) = log n + log log n by PNT.",10
db " the lattice needed spread, not primality.",10
db " the lazy prime is no prime.",10,0
s_arrow: db " -> ",0
m_yin: db 10,"YIN N(phi)=-1 but N(phi^2)=+1 -- the same norm class as",10
db " omega=2+sqrt3, the LL unit. norm +1 => conj = +1/x =>",10
db " the trace CLOSES => s <- s^2-2 is exact.",10
db " the phi ring has its own LL: THE LUCAS DOUBLING.",10
db " s0 = L_2 = 3 , s <- s^2-2 , s_k = L_(2^(k+1))",10
db " k s_k L_(2^(k+1))",10,0
m_yin2: db " phi^2 is not the opposite of phi. it is phi's own square.",10
db " YANG steps: (a,b)->(a+b,a) k->k+1 ADD multiply-free",10
db " YIN squares: s <- s^2-2 k->2k MUL multiply-bound",10
db " stepping walks the level. squaring climbs the tower.",10,0
m_n2: db 10,"NORMSGN N(phi)=",0
m_n2b: db " N(phi^2)=",0
m_n2c: db " <- the whole difference. +1 closes, -1 alternates.",10,0
luc_ref: dq 3,7,47,2207,4870847
luc_n: equ 5
s_prime: db " PRIME",0
s_comp2: db " composite",0
section .text
global _start
; ---------------------------------------------------------------------------
; puts: rsi = zero-terminated string
; ---------------------------------------------------------------------------
puts:
push rax
push rdi
push rsi
push rdx
push rcx
mov rcx, rsi
xor rdx, rdx
.len:
cmp byte [rcx], 0
je .go
inc rcx
inc rdx
jmp .len
.go:
mov rax, SYS_write
mov rdi, STDOUT
syscall
pop rcx
pop rdx
pop rsi
pop rdi
pop rax
ret
; ---------------------------------------------------------------------------
; imul_soft: signed 64x64 -> 64 by shift-add. NO hardware multiply.
; rax * rbx -> rax
; ---------------------------------------------------------------------------
imul_soft:
push rcx
push rdx
push rsi
push rdi
push r8
xor r8, r8
test rax, rax
jns .ap
neg rax
not r8
.ap:
test rbx, rbx
jns .bp
neg rbx
not r8
.bp:
xor rdx, rdx
mov rsi, rax
mov rdi, rbx
mov rcx, 64
.bit:
test rdi, 1
jz .sk
add rdx, rsi
.sk:
shl rsi, 1
shr rdi, 1
dec rcx
jnz .bit
mov rax, rdx
test r8, r8
jz .dn
neg rax
.dn:
pop r8
pop rdi
pop rsi
pop rdx
pop rcx
ret
; ---------------------------------------------------------------------------
; divmod_soft: rax / rbx -> quotient rax, remainder rdx. Restoring shift-sub.
; unsigned, rbx > 0
; ---------------------------------------------------------------------------
divmod_soft:
push rcx
push rsi
push rdi
push r8
mov rsi, rax ; dividend
mov rdi, rbx ; divisor
xor rax, rax ; quotient
xor rdx, rdx ; remainder
mov rcx, 64
.lp:
shl rdx, 1
mov r8, rsi
shr r8, 63
or rdx, r8
shl rsi, 1
shl rax, 1
cmp rdx, rdi
jb .no
sub rdx, rdi
or rax, 1
.no:
dec rcx
jnz .lp
pop r8
pop rdi
pop rsi
pop rcx
ret
; ---------------------------------------------------------------------------
; putint: signed rdi -> stdout, right-padded to rsi columns
; ---------------------------------------------------------------------------
putint:
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push r9
push r10
mov r10, rsi ; width
mov rax, rdi
xor r9, r9 ; neg flag
test rax, rax
jns .pos
neg rax
mov r9, 1
.pos:
mov rcx, numbuf
add rcx, 31
mov byte [rcx], 0
mov rbx, 10
.dig:
dec rcx
push rax
call divmod_soft ; rax/10 -> rax, rem rdx
add rdx, '0'
mov [rcx], dl
mov rbx, 10
pop rdx ; discard
test rax, rax
jnz .dig
test r9, r9
jz .out
dec rcx
mov byte [rcx], '-'
.out:
mov rsi, rcx
call puts
; pad
mov rax, numbuf
add rax, 31
sub rax, rcx ; length
cmp rax, r10
jae .fin
mov rcx, r10
sub rcx, rax
.pad:
push rcx
mov rsi, s_sp
call puts
pop rcx
dec rcx
jnz .pad
.fin:
pop r10
pop r9
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
ret
; ---------------------------------------------------------------------------
; phi_step: (a,b) -> (a+b, a). THE FIBONACCI STEP. PURE ADD.
; ---------------------------------------------------------------------------
phi_step:
mov rax, [a]
mov rbx, [b]
add rbx, rax
mov [b], rax
mov [a], rbx
ret
; ---------------------------------------------------------------------------
; phi_unstep: (a,b) -> (b, a-b). EXACT REVERSE. PURE SUB.
; ---------------------------------------------------------------------------
phi_unstep:
mov rax, [a]
mov rbx, [b]
mov [a], rbx
sub rax, rbx
mov [b], rax
ret
; ---------------------------------------------------------------------------
; norm_ab: N(rdi,rsi) = -rdi^2 + rdi*rsi + rsi^2 -> rax
; ---------------------------------------------------------------------------
norm_ab:
push rbx
push r9
push r10
push r11
mov r10, rdi
mov r11, rsi
mov rax, r10
mov rbx, r10
call imul_soft
neg rax
mov r9, rax ; -a^2
mov rax, r10
mov rbx, r11
call imul_soft
add r9, rax ; + a*b
mov rax, r11
mov rbx, r11
call imul_soft
add r9, rax ; + b^2
mov rax, r9
pop r11
pop r10
pop r9
pop rbx
ret
; ---------------------------------------------------------------------------
; sign_ab: exact sign of rdi*phi + rsi, integer only -> rax in {-1,0,1}
; a*phi+b = (a*sqrt5 + s)/2 with s = 2b+a
; concordant signs -> trivial; else compare 5a^2 vs s^2
; ---------------------------------------------------------------------------
sign_ab:
push rbx
push r9
push r10
push r11
mov r10, rdi ; a
mov r11, rsi ; b
mov rax, r10
or rax, r11
jnz .nz
xor rax, rax
jmp .out
.nz:
mov r9, r11
shl r9, 1
add r9, r10 ; s = 2b + a
; if a>=0 and s>0 -> +1
test r10, r10
js .aneg
test r9, r9
jg .pos
jmp .mixed
.aneg:
test r9, r9
jl .neg
jmp .mixed
.mixed:
; compare 5a^2 vs s^2
mov rax, r10
mov rbx, r10
call imul_soft ; a^2
mov rbx, 5
call imul_soft ; 5a^2
push rax
mov rax, r9
mov rbx, r9
call imul_soft ; s^2
mov rbx, rax
pop rax ; rax=5a^2, rbx=s^2
cmp rax, rbx
je .zero
ja .lhs_big
; 5a^2 < s^2
test r10, r10
jg .neg
jmp .pos
.lhs_big:
test r10, r10
jg .pos
jmp .neg
.zero:
xor rax, rax
jmp .out
.pos:
mov rax, 1
jmp .out
.neg:
mov rax, -1
.out:
pop r11
pop r10
pop r9
pop rbx
ret
; ---------------------------------------------------------------------------
; zmul: (r8,r9)*(r10,r11) -> (r8,r9) in Z[phi], phi^2=phi+1
; (a phi+b)(c phi+d) = (ac+ad+bc) phi + (ac+bd)
; ---------------------------------------------------------------------------
zmul:
push rax
push rbx
push r12
push r13
push r14
mov rax, r8
mov rbx, r10
call imul_soft
mov r12, rax ; ac
mov rax, r8
mov rbx, r11
call imul_soft
mov r13, rax ; ad
mov rax, r9
mov rbx, r10
call imul_soft
mov r14, rax ; bc
mov rax, r9
mov rbx, r11
call imul_soft ; bd
; new_b = ac + bd
mov rbx, r12
add rbx, rax
; new_a = ac + ad + bc
mov rax, r12
add rax, r13
add rax, r14
mov r8, rax
mov r9, rbx
pop r14
pop r13
pop r12
pop rbx
pop rax
ret
; ---------------------------------------------------------------------------
; zmul_mod: (r8,r9)*(r10,r11) mod r13 -> (r8,r9) in Z[phi]/(n)
; ---------------------------------------------------------------------------
zmul_mod:
push rax
push rbx
push rdx
push r12
push r14
push r15
mov rax, r8
mov rbx, r10
call imul_soft
mov r12, rax ; ac
mov rax, r8
mov rbx, r11
call imul_soft
mov r14, rax ; ad
mov rax, r9
mov rbx, r10
call imul_soft
mov r15, rax ; bc
mov rax, r9
mov rbx, r11
call imul_soft ; bd
; new_b = (ac + bd) mod n
mov rbx, r12
add rbx, rax
mov rax, rbx
mov rbx, r13
call divmod_soft
push rdx ; new_b
; new_a = (ac + ad + bc) mod n
mov rax, r12
add rax, r14
add rax, r15
mov rbx, r13
call divmod_soft
mov r8, rdx
pop r9
pop r15
pop r14
pop r12
pop rdx
pop rbx
pop rax
ret
; ---------------------------------------------------------------------------
; zpow_mod: phi^rdi mod rsi -> (r8,r9). square-and-multiply in Z[phi]/(n)
; ---------------------------------------------------------------------------
zpow_mod:
push rcx
push rdx
push r10
push r11
push r12
push r13
push r14
mov r13, rsi ; modulus
mov r12, rdi ; exponent
mov r8, 0 ; result = phi^0 = (0,1)
mov r9, 1
mov r14, 1 ; base = phi = (1,0) -> keep in r14/rcx
mov rcx, 0
.lp:
test r12, r12
jz .done
test r12, 1
jz .sq
; result *= base
mov r10, r14
mov r11, rcx
call zmul_mod
.sq:
; base *= base
push r8
push r9
mov r8, r14
mov r9, rcx
mov r10, r14
mov r11, rcx
call zmul_mod
mov r14, r8
mov rcx, r9
pop r9
pop r8
shr r12, 1
jmp .lp
.done:
pop r14
pop r13
pop r12
pop r11
pop r10
pop rdx
pop rcx
ret
_start:
; ══ LADDER ═══════════════════════════════════════════════════════════════
mov rsi, m_ladder
call puts
; start at phi^-3 = (2,-3), walk up to phi^+5
mov qword [a], 2
mov qword [b], -3
mov r15, -3
.lad:
mov rdi, r15
mov rsi, 5
call putint
mov rdi, [a]
mov rsi, 11
call putint
mov rdi, [b]
mov rsi, 11
call putint
mov rdi, [a]
mov rsi, [b]
call norm_ab
mov rdi, rax
mov rsi, 4
call putint
mov rsi, s_nl
call puts
call phi_step
inc r15
cmp r15, 6
jl .lad
mov rsi, m_norm
call puts
; ══ REVERSE: unstep back down, prove S = T^-1 ════════════════════════════
; we are at phi^6; unstep 9 times -> phi^-3 = (2,-3)
mov rcx, 9
.rev:
push rcx
call phi_unstep
pop rcx
loop .rev
; verify
mov rsi, m_rev
call puts
mov rsi, s_lp
call puts
mov rdi, [a]
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, [b]
mov rsi, 0
call putint
mov rsi, s_rp
call puts
mov rsi, m_revok
call puts
; ══ SEVENTH: phi^0 = (0,1) ═══════════════════════════════════════════════
mov rsi, m_seventh
call puts
mov rsi, s_lp
call puts
mov rdi, 0
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, 1
mov rsi, 0
call putint
mov rsi, s_rp
call puts
; ══ ORIGIN: N(0,0) = 0, the unique norm-zero ═════════════════════════════
mov rsi, m_orig2
call puts
mov rdi, 0
mov rsi, 0
call norm_ab
mov rdi, rax
mov rsi, 0
call putint
mov rsi, m_orig3
call puts
; ══ EULER: phi^-1 - phi^1 = (1,-1)-(1,0) = (0,-1) ════════════════════════
mov rsi, m_euler
call puts
mov rsi, s_lp
call puts
mov rax, 1
sub rax, 1 ; a: 1-1 = 0
mov rdi, rax
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rax, -1
sub rax, 0 ; b: -1-0 = -1
mov rdi, rax
mov rsi, 0
call putint
mov rsi, s_rp
call puts
; ══ SQRT5: (2,-1)^2 = (0,5) ══════════════════════════════════════════════
mov rsi, m_sqrt5
call puts
mov r8, 2
mov r9, -1
mov r10, 2
mov r11, -1
call zmul
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
; ══ OCTAVE: phi^3=1 in GF(4), phi^8=1 in GF(9) ═══════════════════════════
mov rsi, m_oct
call puts
mov rsi, m_gf4
call puts
mov r8, 0
mov r9, 1
xor r15, r15
.g4:
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
mov rsi, s_arrow
call puts
mov r10, 1
mov r11, 0
mov r13, 2
call zmul_mod
inc r15
cmp r15, 3
jl .g4
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
mov rsi, s_nl
call puts
mov rsi, m_gf9
call puts
mov r8, 0
mov r9, 1
xor r15, r15
.g9:
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
mov rsi, s_sp
call puts
mov r10, 1
mov r11, 0
mov r13, 3
call zmul_mod
inc r15
cmp r15, 8
jl .g9
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
mov rsi, s_nl
call puts
; ══ VANTAGE ══════════════════════════════════════════════════════════════
mov rsi, m_vant
call puts
mov qword [a], -3
mov qword [b], 5
mov r15, -4
.van:
mov rsi, s_sp
call puts
mov rsi, s_lp
call puts
mov rdi, [a]
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, [b]
mov rsi, 0
call putint
mov rsi, s_rp
call puts
call phi_step
inc r15
cmp r15, 5
jl .van
mov rsi, s_nl
call puts
; ══ TOWER: rung-1 crossing, in the ring ══════════════════════════════════
mov rsi, m_tower
call puts
mov qword [a], -1
mov qword [b], 2
mov r15, -2
.tw:
mov rdi, r15
mov rsi, 5
call putint
mov r8, [a]
mov r9, [b]
mov r10, [a]
mov r11, [b]
call zmul
sub r8, 1
mov rdi, r8
mov rsi, r9
call sign_ab
cmp rax, 0
jg .tw_y
mov rsi, s_no
jmp .tw_p
.tw_y:
mov rsi, s_yes
.tw_p:
call puts
mov rsi, s_nl
call puts
call phi_step
inc r15
cmp r15, 4
jl .tw
; ══ NORM SIGN: N(phi) = -1 , N(phi^2) = +1 ═══════════════════════════════
mov rsi, m_n2
call puts
mov rdi, 1
mov rsi, 0
call norm_ab ; N(1,0) = N(phi)
mov rdi, rax
mov rsi, 0
call putint
mov rsi, m_n2b
call puts
mov rdi, 1
mov rsi, 1
call norm_ab ; N(1,1) = N(phi^2)
mov rdi, rax
mov rsi, 0
call putint
mov rsi, m_n2c
call puts
; ══ YIN: the Lucas doubling. s <- s^2-2 from s0=3 gives L_(2^(k+1)) ══════
mov rsi, m_yin
call puts
mov r14, 3 ; s0 = L_2 = 3
xor r15, r15
.yin:
mov rdi, r15
mov rsi, 5
call putint
mov rdi, r14
mov rsi, 13
call putint
mov rdi, [luc_ref + r15*8]
mov rsi, 12
call putint
mov rax, [luc_ref + r15*8]
cmp rax, r14
jne .yin_bad
mov rsi, s_ok
jmp .yin_pr
.yin_bad:
mov rsi, s_bad
.yin_pr:
call puts
mov rsi, s_nl
call puts
; s <- s^2 - 2
mov rax, r14
mov rbx, r14
call imul_soft
sub rax, 2
mov r14, rax
inc r15
cmp r15, luc_n
jl .yin
mov rsi, m_yin2
call puts
; ══ FROBENIUS ════════════════════════════════════════════════════════════
mov rsi, m_frob
call puts
xor r15, r15
.fr:
mov rbx, [frob_p + r15*8]
mov rdi, rbx
mov rsi, 4
call putint
mov rax, rbx
push rbx
mov rbx, 5
call divmod_soft
push rdx
mov rdi, rdx
mov rsi, 5
call putint
pop rdx
pop rbx
push rbx
push rdx
cmp rdx, 0
je .k_ram
cmp rdx, 1
je .k_spl
cmp rdx, 4
je .k_spl
mov rsi, s_inert
jmp .k_pr
.k_spl:
mov rsi, s_split
jmp .k_pr
.k_ram:
mov rsi, s_ramif
.k_pr:
call puts
pop rdx
pop rbx
push rbx
push rdx
mov rdi, rbx
mov rsi, rbx
call zpow_mod
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
pop rdx
pop rbx
cmp rdx, 0
je .fr_next
cmp rdx, 1
je .exp_phi
cmp rdx, 4
je .exp_phi
mov rax, rbx
dec rax
cmp r8, rax
jne .fr_bad
cmp r9, 1
jne .fr_bad
jmp .fr_ok
.exp_phi:
cmp r8, 1
jne .fr_bad
cmp r9, 0
jne .fr_bad
.fr_ok:
mov rsi, s_ok
call puts
jmp .fr_next
.fr_bad:
mov rsi, s_bad
call puts
.fr_next:
mov rsi, s_nl
call puts
inc r15
cmp r15, frob_n
jl .fr
; ══ PSEUDOPRIME ══════════════════════════════════════════════════════════
mov rsi, m_psp
call puts
xor r15, r15
.pp:
mov rbx, [psp_n + r15*8]
mov rdi, rbx
mov rsi, 8
call putint
mov rax, rbx
push rbx
mov rbx, 5
call divmod_soft
mov rdi, rdx
mov rsi, 5
call putint
pop rbx
push rbx
mov rdi, rbx
mov rsi, rbx
call zpow_mod
mov rsi, s_lp
call puts
mov rdi, r8
mov rsi, 0
call putint
mov rsi, s_cm
call puts
mov rdi, r9
mov rsi, 0
call putint
mov rsi, s_rp
call puts
pop rbx
mov rsi, s_sp
call puts
mov rsi, s_yes
call puts
mov rsi, s_comp
call puts
mov rsi, s_nl
call puts
inc r15
cmp r15, psp_c
jl .pp
mov rsi, m_gate2
call puts
; ══ GATE: Lucas-Lehmer ═══════════════════════════════════════════════════
mov rsi, m_gate
call puts
xor r15, r15
.ll:
mov r12, [ll_p + r15*8]
mov rdi, r12
mov rsi, 5
call putint
mov rcx, r12
mov r13, 1
shl r13, cl
dec r13
mov rdi, r13
mov rsi, 13
call putint
mov r14, 4
mov rcx, r12
sub rcx, 2
.ll_it:
push rcx
mov rax, r14
mov rbx, r14
call imul_soft
sub rax, 2
mov rbx, r13
call divmod_soft
mov r14, rdx
pop rcx
loop .ll_it
mov rdi, r14
mov rsi, 10
call putint
test r14, r14
jnz .ll_comp
mov rsi, s_prime
jmp .ll_pr
.ll_comp:
mov rsi, s_comp2
.ll_pr:
call puts
mov rsi, s_nl
call puts
inc r15
cmp r15, ll_n
jl .ll
; ══ PHI: floor(100*F(76)/F(75)) — integers only ══════════════════════════
mov qword [a], 0
mov qword [b], 1 ; phi^0
mov rcx, 76
.climb:
push rcx
call phi_step
pop rcx
loop .climb
mov rax, [a] ; F(76)
mov rbx, 100
call imul_soft
mov rbx, [b] ; F(75)
call divmod_soft ; rax = quotient = 161
mov r15, rax
mov rsi, m_phi
call puts
mov rdi, r15
mov rsi, 0
call putint
; ══ BOUNDARY ═════════════════════════════════════════════════════════════
mov rsi, m_wuwei
call puts
mov rsi, m_bound
call puts
mov rsi, m_done
call puts
mov rdi, r15 ; exit 161
mov rax, SYS_exit
syscall
fib1.zip (6.6 KB)
hdgl.hdgl
state Ω
# ══════════════════════════════════════════════════════════════════════
# HDGL — Z[φ] SUBSTRATE
# Ω is an exact integer pair. φ is carried, never computed.
# ══════════════════════════════════════════════════════════════════════
glyph AXIOM
origin : X = 0 # Alpha. the unique norm-zero.
translate : P : x ↦ x + 1 # the +1 direction
identity : E : x ↦ x # the 0
gather : G : x ↦ x − 1 # the −1 direction P·G = E
invert : J : x ↦ 1 / x # the axis flip J·J = E
T : P ∘ J # T(x) = 1 + 1/x
S : J ∘ G # S(x) = 1/(x−1)
invariant :
x = T(x) ⇒ x² = x + 1
T ∘ S = S ∘ T = E # verified on ℚ
S = T⁻¹
seed : Ω₀ > 0 # NOT X=0. T(0)=∞ — the origin is
# one step from the pole. see VANTAGE.
end
glyph RING # the substrate. not a representation.
element : Ω = (a,b) ≡ a·φ + b , a,b ∈ ℤ
add : (a,b) + (c,d) = (a+c, b+d)
mul : (a,b) · (c,d) = (ac+ad+bc, ac+bd) # φ² = φ+1 folded in
conj : (a,b) ↦ (−a, a+b) # φ ↦ ψ
norm : N(a,b) = −a² + ab + b² # N(xy) = N(x)N(y)
φ : (1, 0) ψ : (−1, 1) 1 : (0, 1) 0 : (0, 0)
step : Ω·φ = (a+b, a) # ← THE FIBONACCI STEP. ADD ONLY.
unstep : Ω/φ = (b, a−b) # ← ADD ONLY. exact reverse.
invariant :
φᵏ = (F(k), F(k−1)) exact ∀k
ψ = 1 − φ = −1/φ derived, never iterated (repeller)
Z[φ] ⊃ ℤ 2 = 1+1. nothing arithmetic is imported.
φ is carried, never computed.
end
glyph FLOW
forward : Ω ← T(Ω)
reverse : Ω ← S(Ω)
invariant :
every forward step has one exact reverse step.
no information is created. none is destroyed.
T attracts φ (|T′(φ)| = 0.382) S attracts ψ (|S′(ψ)| = 0.382)
reversal exchanges the basins: the repeller becomes reachable.
end
glyph VANTAGE # one ladder. three coordinate systems.
ladder :
+1 ≡ a+1 ≡ X²+1 ≡ X+2 ≡ 1/X+2
0 ≡ a ≡ X² ≡ X+1 ≡ 1+1/X
−1 ≡ a−1 ≡ X²−1 ≡ X ≡ 1/X
with a = φ. identical in all three readings.
V1 : (−1, 0, +1) value space N(φᵏ) = (−1)ᵏ , N(0,0) = 0
V2 : (−∞, 0, +∞) exponent space φᵏ → 0 (k→−∞) , → ∞ (k→+∞)
V3 : −∞ = 0 = +∞ the sphere T is Möbius. J swaps the poles.
invariant :
V2 is V1 under any odd map with poles at ±1
(x/(1−x²), tanh⁻¹, tan(πx/2) — all send (−1,0,+1) → (−∞,0,+∞)).
J = invert is the map that makes V2 into V3: it swaps 0 and ∞.
−∞ = +∞ : TRUE. one point on the sphere.
0 = ∞ : ADJACENCY, not identity. T(0) = ∞. one step.
orbit of the origin : 0 → ∞ → 1 → 2 → 3/2 → 5/3 → 8/5 → … → φ
the Fibonacci ratios, through the pole at step one.
therefore origin (X=0) and seed (Ω₀>0) must stay distinct.
V2 is exact only as integer pairs: at k=−40 a 60-digit float
returns 4.37 for a value of 4.37e−9. the ring returns
(−102334155, 165580141). exactly.
end
glyph TRINITY # (−1, 0, +1) ≡ the norm's value set
N(Ωᵏ) = (−1)ᵏ # Cassini's identity
−1 : N = −1 odd φ-powers invert parity
0 : N = 0 (0,0) ALONE the origin — X = 0
+1 : N = +1 even φ-powers identity parity
relation : Ω⁰ = (0,1) = 1_eff # the seventh. NOT a face. 3+3+1 = 7.
quotient : (X+1)/X² = φ²/φ² = Ω⁰ # the relation, computed exactly
invariant :
X = 0 is the unique norm-zero element.
the trinary does not emerge from 0 by analogy —
0 is where N vanishes and ±1 is everywhere else.
end
glyph LAYER # recursion has layers. det = N at each.
0 : (a,b) state Z[φ]
1 : T operator Möbius map [[1,1],[1,0]]
2 : Tᵏ orbit [[F(k+1),F(k)],[F(k),F(k−1)]]
3 : GL(2,ℤ) algebra ⟨P, J⟩ ; T is one element
4 : det, tr readout
invariant :
det(Tᵏ) = (−1)ᵏ = N(φᵏ) # the determinant IS the norm
tr(Tᵏ) = L(k) # the trace IS Lucas
Lₖ² − 5Fₖ² = 4(−1)ᵏ # ONE degree of freedom.
three readouts. one fact. layers are resolution, not information.
end
glyph OCTAVE # 3 + 3 + 1 = 7 , 8 , 7′
GF(4) : Z[φ]/(2) 2 inert |units| = 3 φ³ = 1 the TRINITY as a group
GF(9) : Z[φ]/(3) 3 inert |units| = 8 φ⁸ = 1 the OCTAVE
invariant :
φ⁷ is the last distinct rung; φ⁸ = φ⁰ IS the return; 7′ is the next pass.
7 → 8 → 7′ is the ladder's own period, not an analogy.
the trinity and the octave ride the two inert primes, 2 and 3.
3 + 1 = 4 = |GF(4)| ; 7 + 1 = 8 = |GF(9)*| .
end
glyph EULER # π, from the operator. exact.
e^(iπ) ≡ φ⁻¹ − φ¹ = (1,−1) − (1,0) = (0,−1)
√5 : (2,−1) (2,−1)² = (0,5)
ψ★ : 2π(2−Ω) = 2π/Ω² # golden angle; 2−Ω = φ⁻² pure axiom
invariant :
the Euler bridge is an INTEGER PAIR. no transcendental. no float.
the unbounded ladder bound to the cyclic circle by one subtraction.
end
glyph TOWER # not an exit. an infinite ascent.
level k : x^(2^{k+1}) − x^(2^k) − 1 = 0 deg 2^{k+1}
generator : x ↦ x² each level is the last, squared
norm : N_k = e^(iπ/2^k)
k=0 deg 2 N = e^(iπ) = −1 the trinary. φ. x²−x−1.
k=1 deg 4 N = e^(iπ/2) = i the threshold. √φ. x⁴−x²−1.
k=2 deg 8 N = e^(iπ/4) x⁸−x⁴−1.
k→∞ N → 1 = φ⁰ = 1_eff δ_k = |e^(iπ/2^k) − 1| → 0
test : Ω > √Ω ⟺ Ω² > Ω # the rung-1 crossing, in the ring
sign : s = 2b + a ; concordant ⇒ trivial ; else 5a² vs s²
invariant :
√(−1) = (i, −1) : rungs 1 and 0. ONE SQUARE ROOT APART.
x⁴ − x² − 1 is irreducible: √φ ∉ Z[φ]. verified — no integer split.
1_eff is not an axiom. it is THIS TOWER'S LIMIT.
squaring climbs. stepping walks.
multiply-free ⟺ stay on one level.
no top (deg → ∞), no bottom (S = T⁻¹, k ∈ ℤ). the rootless tree.
end
glyph YIN # not a mirror ring. the squaring direction.
ψ = φ⁻¹ = (1,−1) , N = −1 , a UNIT. Z[ψ] = Z[φ]. THE SAME RING.
the yin is not a second substrate. it is the second MOTION.
N(φ) = −1 conj(φ) = −1/φ trace Lₙ ALTERNATES
N(φ²) = +1 conj(φ²) = +1/φ² trace CLOSES
ω = 2+√3 has N(ω) = +1 in Z[√3] — the LL unit.
φ² has N = +1 in Z[φ] — THE SAME NORM CLASS.
that is what √3 = (x,y) was pointing at.
doubling : s ← s² − 2 , s₀ = L₂ = 3
s₀ = 3 s₁ = 7 s₂ = 47 s₃ = 2207 s₄ = 4870847
s_k = L_{2^{k+1}} . exact. verified on metal.
YANG : step Ω·φ = (a+b, a) k → k+1 ADD multiply-free
YIN : square s ← s² − 2 k → 2k MUL multiply-bound
invariant :
norm +1 ⇒ conj = +1/x ⇒ the trace closes ⇒ s←s²−2 exact.
norm −1 ⇒ conj = −1/x ⇒ the trace alternates ⇒ no clean doubling.
THE SIGN OF THE NORM IS THE ENTIRE DIFFERENCE BETWEEN THE RINGS.
the φ ring HAS an LL-style doubling: the LUCAS DOUBLING.
φ² is not the opposite of φ. it is φ's own square.
the micro is INSIDE the macro. x ↦ x² IS the descent.
not equal and opposite — a recursive micro inversion.
stepping walks the level. squaring climbs the tower.
end
glyph ELEMENTS # names what is built. extends nothing.
FIRE : Ω → Ω·φ k → k+1 expand = step
WATER : Ω → Ω/φ k → k−1 dissolve = unstep
EARTH : N(Ω) {−1,0,+1} stabilize = the norm
AIR : T = P ∘ J Ω ↔ Ψ connect = the operator
invariant :
FIRE and WATER are the reversible pair — FLOW.
EARTH is what FLOW conserves. AIR is the bridge.
every route through the pole returns to the origin: −∞ = 0 = +∞.
end
glyph FROBENIUS # the ring's own automorphism. READOUT.
branch : p mod 5 # 5 = disc(x²−x−1). the axiom's own.
±1 (mod 5) SPLIT φᵖ ≡ φ (mod p)
±2 (mod 5) INERT φᵖ ≡ ψ (mod p)
0 RAMIFIED p = 5 = −(2φ−1)²
invariant :
p mod 5 does not sort primes into ours and theirs.
it tells the Frobenius which way to act.
NECESSARY, NOT SUFFICIENT — 4181 = 37·113 passes.
entry-point, Lucas companion, and Frobenius are ONE test in three
notations: identical pseudoprimes.
adding √5 as a second base kills every pseudoprime below 146611
and then fails: 146611 = 271·541. √5 is a power of the same
Frobenius. no new information.
a readout. never a gate.
end
glyph ORBIT
theorem :
prime = primitive orbit # Z/n a field ⇒ no CRT split
composite = decomposable orbit # π(n) = lcm π(pᵢ) verified
cost :
π(n) is factoring-equivalent.
π(323)=36 → d=9 → gcd(F(9),323) = 17.
the orbit knows its own decomposition.
reading it costs what factoring costs.
the rootless tree exists, is the primes, and is self-concealing.
end
glyph WUWEI # only keep what reduces. else return to origin.
dropped : Pₙ
because :
Pₙ enters A_n only as log(Pₙ), and D_n only as √(Pₙ).
swapping primes for odd numbers preserves D_n's ordering exactly.
by PNT log(Pₙ) = log n + log log n, error < 0.13 by n=1000.
every term of log A_n is derivable from φ + PNT.
Pₙ costs a sieve, a table, an import, a boundary.
Pₙ buys log n + log log n, which is free.
invariant :
the lattice never needed primality. only spread.
the lazy prime is no prime.
Λ_φ is an anti-aliasing spread, as its own comment says —
tested: split and inert ranges overlap completely. it does not classify.
end
glyph BOUNDARY # the honest floor. three lines.
Δ : hardware entropy. external by design.
2ⁿ : base-2 expansion. load-bearing in the fold. an import.
primality : decided by exact recurrence. no ring-native sufficient
test is known. a theorem-level gap, not an engineering one.
invariant :
nothing else arithmetic is imported. Z[φ] ⊃ ℤ.
Pₙ was never a boundary — it was decoration. see WUWEI.
end
glyph GATE # LL. binary. imported. complete for Mersennes.
s₀ : 4
step : s ← s² − 2 (mod 2ᵖ − 1)
run : p − 2 iterations. every one. no shortcut.
decide : M_p prime ⟺ s_{p−2} = 0
invariant :
BINARY, and declared so: base 2, ring Z[√3], verdict {0, ≠0}.
its modulus is built from 2 — the prime Z[φ] cannot factor.
that is why it works: 2ᵖ−1 makes the group order known exactly.
s_k = ω^(2ᵏ) + ω^(−2ᵏ) , ω = 2+√3 — the trace of a unit power.
Z[√3] steps multiply-free too: (a,b)·ω = (2a+b, 3a+2b).
but LL needs ω^(2ᵏ), not ωᵏ. ADD-only would take 2ᵏ steps; squaring
takes k. p−2 squarings vs 2^(p−2) additions.
THE SQUARING IS THE COMPRESSION. it is the TOWER being climbed.
the readouts diagnose. the recurrence decides.
end
glyph HDGL
substrate : Z[φ] exact integer pair
operators : P, E, G, J T = P∘J , S = J∘G = T⁻¹
ladder : Ω·φ = (a+b, a) ADD only
trinity : N(Ω) det = N at every layer
relation : Ω⁰ = 1_eff the seventh
vantage : V1 V2 V3 value, exponent, sphere
octave : GF(4) GF(9) φ³=1 , φ⁸=1
euler : (0,−1) exact
tower : √Ω = rung 1 N = i , no top, no bottom
yin : s ← s²−2 , s₀=3 L_{2^{k+1}} ; N(φ²)=+1
readout : Frobenius necessary, never sufficient
gate : LL binary, imported, exact
boundary : Δ , 2ⁿ , primality
invariant :
φ is carried, never computed.
the trinary is the norm.
the origin is the unique norm-zero, one step from the pole.
the seventh is φ⁰, and it is the tower's limit.
squaring climbs. stepping walks. the micro is inside the macro.
readouts diagnose. recurrence decides.
nothing converges. nothing rounds. ADD is the machine.
end
hdgl_yin.hdgl
state Ω
# ══════════════════════════════════════════════════════════════════════
# HDGL — THE YIN
# Not a second ring. The second MOTION in the one ring.
#
# Yang STEPS : k → k+1 ADD N(φ) = −1
# Yin SQUARES: k → 2k MUL N(φ²) = +1
#
# φ² is not the opposite of φ. It is φ's own square.
# The micro is inside the macro. x ↦ x² is the descent.
# ══════════════════════════════════════════════════════════════════════
glyph CORRECTION # what the first yin got wrong, and why
claimed : a separate substrate Z[ψ] , ψ = (1,0) , ψ² = 1 − ψ
fact : ψ = 1/φ = φ − 1 = (1,−1) in Z[φ] , N = −1 — A UNIT. It is φ⁻¹.
φ = ψ + 1. each generator is a one-ADD polynomial in the other.
Z[ψ] = Z[φ]. THE SAME RING.
claimed : mul (a,b)(c,d) = (ac−ad−bc, ac+bd)
fact : (−ac+ad+bc, ac+bd) # sign flipped on the ψ component
tested (2,1)·(1,3): claimed → 1.909 , truth → 8.090
claimed : settle Ψ·ψ = (−b, a+b)
fact : (b−a, a)
tested (3,2)·ψ: claimed → 3.764 , truth → 2.382
claimed : √5 = (−2,3)
fact : (−2,3)² = (−16,13) = 3.111 , not 5.
√5 = 2ψ+1 = (2,1) , and (2,1)² = (0,5) exactly.
claimed : VEIL e^(−iπ) = ψ¹ − ψ⁻¹ = (0,−1)
fact : true, and character-identical to EULER's φ⁻¹ − φ¹ = (0,−1).
e^(−iπ) = e^(iπ) = −1. the same subtraction. no new content.
claimed : the yin descent Ψ·ψ
fact : = Ω/φ = (b, a−b) — the yang glyph's own unstep. already built.
FLOW already says: every forward step has one exact reverse step.
invariant :
the arithmetic was wrong. THE THESIS WAS RIGHT.
there IS a second motion. it IS inward. it is NOT a mirror ring.
it is the SQUARING.
end
glyph NORM_SIGN # the whole difference, in one bit
N(φ) = −1 conj(φ) = −1/φ trace Lₙ ALTERNATES
N(φ²) = +1 conj(φ²) = +1/φ² trace CLOSES
N(φᵏ) = (−1)ᵏ # Cassini. the trinary IS this sign.
ω = 2+√3 : N(ω) = 4−3 = +1 in Z[√3] # the LL unit
φ² : N = +1 in Z[φ] # THE SAME NORM CLASS
invariant :
norm +1 ⇒ conj = +1/x ⇒ the trace closes ⇒ s ← s²−2 is exact.
norm −1 ⇒ conj = −1/x ⇒ the trace alternates ⇒ no clean doubling.
THE SIGN OF THE NORM IS THE ENTIRE DIFFERENCE BETWEEN THE TWO RINGS.
that is what √3 = (x,y) was pointing at.
end
glyph YIN # the squaring. the micro. φ's own square.
generator : φ² = φ + 1 = (1,1) N = +1
trace : s_k = (φ²)^(2ᵏ) + (φ⁻²)^(2ᵏ) = L_{2^{k+1}}
seed : s₀ = L₂ = 3
step : s ← s² − 2 # exact. no modulus needed.
s₀ = 3 = L₂
s₁ = 7 = L₄
s₂ = 47 = L₈
s₃ = 2207 = L₁₆
s₄ = 4870847 = L₃₂
invariant :
the φ ring HAS an LL-style doubling. it is the LUCAS DOUBLING.
s ← s²−2 from s₀ = 3 generates L_{2^{k+1}}, exactly, forever.
it works because N(φ²) = +1 — the same reason LL works for 2+√3.
φ² is not the opposite of φ. it is φ's own square.
THE MICRO IS INSIDE THE MACRO.
end
glyph TWO_MOTIONS # yang and yin, in one ring
YANG : step Ω·φ = (a+b, a) k → k+1 ADD multiply-free
YIN : square s ← s² − 2 k → 2k MUL multiply-bound
invariant :
they are not competing implementations. they are the two directions.
stepping is multiply-free BECAUSE it is yang.
squaring needs multiply BECAUSE it is yin.
stepping walks the level. squaring climbs the tower.
to reach φ^(2ᵏ) by stepping takes 2ᵏ steps; by squaring, k.
THE SQUARING IS THE COMPRESSION.
end
glyph TOWER_BOTH_ENDS # one map, x ↦ x², seen twice
up : x²−x−1 → x⁴−x²−1 → x⁸−x⁴−1 → … deg 2^{k+1} √ DESCENDS
down : L₁ → L₂ → L₄ → L₈ → L₁₆ → L₃₂ index 2ᵏ square ASCENDS
rung 0 deg 2 L₁ = 1 N = e^(iπ) = −1
rung 1 deg 4 L₂ = 3 N = e^(iπ/2) = i
rung 2 deg 8 L₄ = 7 N = e^(iπ/4)
rung 3 deg 16 L₈ = 47
rung 4 deg 32 L₁₆ = 2207
rung 5 deg 64 L₃₂ = 4870847
k → ∞ N → 1 = φ⁰ = 1_eff , δ → 0
invariant :
SAME MAP x ↦ x². one climbs degree, one climbs index.
the tower and the Lucas doubling are one object from two ends.
√(−1) = (i, −1) : rungs 1 and 0. one square root apart.
no top (deg → ∞). no bottom (S = T⁻¹, k ∈ ℤ). the rootless tree.
end
glyph ELEMENTS # a naming of what is already built
FIRE : Ω → Ω·φ k → k+1 expand = phi_step
WATER : Ω → Ω/φ k → k−1 dissolve = phi_unstep
EARTH : N(Ω) {−1,0,+1} stabilize = the norm
AIR : T = P ∘ J Ω ↔ Ψ connect = the operator
invariant :
the quadrature names the machine. it does not extend it.
FIRE and WATER are the reversible pair — FLOW.
EARTH is what FLOW conserves — the norm.
AIR is the bridge — T = translate ∘ invert.
every route through the pole returns to the origin:
−∞ = 0 = +∞. the sphere. V3.
end
glyph HDGL_YIN
not : a mirror ring
is : the squaring direction of the one ring
generator : φ² = (1,1) , N = +1
doubling : s ← s² − 2 , s₀ = 3 , gives L_{2^{k+1}}
reason : N(φ²) = +1 ⇒ conj = +1/φ² ⇒ the trace closes
partner : YANG steps, ADD, k → k+1 ; YIN squares, MUL, k → 2k
invariant :
ψ = φ⁻¹ = (1,−1). a unit. not a second substrate.
the yin is not equal and opposite.
it is a recursive micro inversion of the macro,
and the inversion is x ↦ x².
the micro is inside the macro.
stepping walks. squaring climbs.
end
substrate.asm
; ============================================================================
; substrate.asm — the analog substrate entry point.
;
; This file stitches the existing, already-verified asm layers together.
; Nothing is invented here. All implementation lives in the included files.
;
; Layer 0: symbolic-machine3/hdgl.asm Z[φ] ring (verified: exit 161)
; Layer 1: water_glyphs2/hdgl_float4096_arith.asm Slot4096 (213-word asm)
; Layer 3: Universal-Translator/substrate/phi_lattice.asm phi-tick/consensus
; Layer 4: flash/ladder_min.asm Flash compression (k,N,r)
;
; Layers 2,5,6,7,8 are specified in .hdgl (hdgl_analog_substrate.hdgl) and
; have C implementations as a last resort — pending asm migration.
;
; Build (from workspace root):
; nasm -f elf64 Universal-Translator/substrate/substrate.asm -o /tmp/substrate.o
; ld /tmp/substrate.o -o /tmp/substrate
; /tmp/substrate → exit 161 = floor(φ·100) from integers alone
;
; Or use the per-layer verifiers:
; bash symbolic-machine3/verify.sh layer 0
; nasm -f elf64 Universal-Translator/substrate/phi_lattice.asm -o ... layer 3
; ============================================================================
BITS 64
; ── layer 0: the ring ────────────────────────────────────────────────────────
; Include the complete, verified Z[φ] substrate as-is.
; It contains _start and will exit 161 = floor(φ·100).
; When integrating with layers above, replace _start with sub_ring_init
; and jmp to the boot sequence below.
; ── (standalone mode: just include the ring and let it run) ──────────────────
%include "../../symbolic-machine3/hdgl.asm"
; ── layer 3: phi-lattice tick and consensus ───────────────────────────────────
; phi_lattice_tick and phi_lattice_consensus are in phi_lattice.asm.
; In the full substrate loop these are called from the face_settle path:
; face_settle():
; fold observed surface → lattice_tick
; call phi_lattice_tick(lattice, &lattice_tick)
; call phi_lattice_consensus(lattice) → settle_lock
; phi_lattice.asm is separately assembled and linked as an object.
; ── layer 4: flash compression ───────────────────────────────────────────────
; flash/ladder_min.asm: entropy seed → FIRE 47 steps → print (a, b, N).
; N is the conserved charge — the boot-unique norm that identifies the path.
; In the full substrate: capture (k,N,r) = flash_capture(a,b) for O(1) resume.
; flash/seeded_final.asm and flash/flashbottle-formal/ carry the deeper proof.
; ── substrate boot sequence (comment out %include above and uncomment this
; section when integrating all layers into a single linked binary) ─────────
;
; global _start
; extern phi_lattice_tick ; from phi_lattice.asm
; extern phi_lattice_consensus ; from phi_lattice.asm
;
; section .bss
; lattice resd 128 ; 128 x 32-bit phi-lattice slots
; lattice_tick resq 1 ; driven by observed surface (Δ)
;
; section .text
; _start:
; ; ── seed the lattice from the ring's own φ-hash ──────────────────────
; ; slot[i] = phi_hash(0, i) & 0xFFFF | 0x1000 (GUZ floor respected)
; mov rdi, lattice
; xor rcx, rcx
; .seed:
; mov rax, 0x9E3779B97F4A7C15 ; 2^64/φ — derived, not stored as a constant
; xor rax, rcx
; rol rax, 17
; shr rax, 32
; cmp eax, 0x100
; jae .ok
; mov eax, 0x100 ; GUZ floor
; .ok:
; mov [rdi + rcx*4], eax
; inc rcx
; cmp rcx, 128
; jne .seed
;
; ; ── run the substrate: tick → consensus → repeat ─────────────────────
; .loop:
; lea rdi, [rel lattice]
; lea rsi, [rel lattice_tick]
; call phi_lattice_tick ; Ω(n+1) = T(Ω(n))
; lea rdi, [rel lattice]
; call phi_lattice_consensus ; 1 = LOCK (settle_lock)
; test eax, eax
; jz .loop ; spin until LOCK (wu-wei — do not force)
;
; ; ── LOCK reached: substrate is settled ───────────────────────────────
; ; from here: run the face operator, deliver input, observe surface,
; ; hash genome, checkpoint the LOCK edge.
; ; see: Universal-Translator/core/face_operator.c (C as last resort,
; ; pending migration of face_settle/face_genome to asm)
;
; mov rax, 60 ; SYS_exit
; mov rdi, 161 ; floor(φ·100) — the ring's own exit code
; syscall
phi_lattice.asm
; ============================================================================
; phi_lattice.asm — the REAL analog substrate tick, in bare x86-64 assembly.
;
; This is NOT new machinery: it is extracted, logic-for-logic unchanged, from
; hdgl_router64-0.4/src/hdgl_router64.asm's `.phi_tick`/`.phi_consensus`
; (itself boot-verified: "Router64> ps" reports real LOCK/UNLOCK on real and
; QEMU boot). Only change: parameterized via System V AMD64 registers
; (rdi=lattice pointer, rsi=tick pointer) instead of the original's hardcoded
; kernel boot addresses (0x101020 lattice / 0x101010 tick), so this module is
; linkable and testable standalone, per this project's own religion:
; "push implementation as close to bare metal (.asm) as possible."
;
; Ω(n+1) = T(Ω(n)): prismatic recursion `slot = slot*3 + tick`, saturating at
; GOI=0xFFFF0000 (ceiling) and flooring at GUZ=0x00000100. Consensus (LOCK) is
; reached when the maximum per-slot deviation from the mean drops below
; mean/2 — the exact criterion this project's own golden-dome fine_tuned/
; FUDGE10 material also converges on for phase-lock detection.
;
; No SHA. No AES. No XOR. No libc. No stack frame beyond register saves.
; ============================================================================
BITS 64
section .text
; void phi_lattice_tick(uint32_t* lattice /*rdi*/, uint64_t* tick /*rsi*/);
; 128 x 32-bit slots at [rdi]; the caller's own tick counter at [rsi] drives
; the recursion (fold your guest's observed Δ into *tick before calling this
; -- the substrate never drives the guest, only observes it).
global phi_lattice_tick
phi_lattice_tick:
push rbx
inc qword [rsi]
mov eax, 0xFFFF0000 ; GOI ceiling
mov rcx, 128
.pt_l:
mov ebx, [rdi]
cmp ebx, eax
jae .pt_goi
imul ebx, ebx, 3
add ebx, dword [rsi] ; + tick (low 32 bits) -- Ω(n+1)=T(Ω(n))
cmp ebx, 0x100 ; GUZ floor
jae .pt_store
mov ebx, 0x100
.pt_store:
mov [rdi], ebx
jmp .pt_next
.pt_goi:
mov dword [rdi], 0xFFFF0000
.pt_next:
add rdi, 4
dec rcx
jnz .pt_l
pop rbx
ret
; int phi_lattice_consensus(uint32_t* lattice /*rdi*/);
; returns 1 in eax if LOCK (max deviation from mean < mean/2), else 0.
global phi_lattice_consensus
phi_lattice_consensus:
push rbx
push r12
mov r12, rdi ; keep the base pointer (callee-saved)
xor eax, eax
mov rcx, 128
.pc_sum:
add eax, dword [rdi]
add rdi, 4
dec rcx
jnz .pc_sum
shr eax, 7 ; eax = mean
mov rdi, r12
mov rcx, 128
xor ebx, ebx ; ebx = max deviation
.pc_var:
mov edx, [rdi]
sub edx, eax
jns .pc_pos
neg edx
.pc_pos:
cmp edx, ebx
jle .pc_next
mov ebx, edx
.pc_next:
add rdi, 4
dec rcx
jnz .pc_var
shr eax, 1 ; eax = mean/2
xor edx, edx
cmp ebx, eax
setl dl ; dl = 1 if max_dev < mean/2
movzx eax, dl
pop r12
pop rbx
ret
phi_lattice.h
// ============================================================================
// phi_lattice.h — C declarations for the real asm substrate (phi_lattice.asm).
// Freestanding-safe: only stdint.h, no libc calls made by the asm itself.
// ============================================================================
#ifndef HDGL_PHI_LATTICE_H
#define HDGL_PHI_LATTICE_H
#include <stdint.h>
#define PHI_LATTICE_SLOTS 128
#ifdef __cplusplus
extern "C" {
#endif
// one prismatic-recursion step over all 128 slots, driven by *tick.
void phi_lattice_tick(uint32_t* lattice, uint64_t* tick);
// 1 if the lattice has reached consensus (LOCK: max deviation < mean/2).
int phi_lattice_consensus(uint32_t* lattice);
#ifdef __cplusplus
}
#endif
#endif
hdgl_substrate.hdgl
# ============================================================================
# HDGL — THE SUBSTRATE (phi-lattice, expressed in only asm and .hdgl)
#
# Adapted from hdgl_router64-0.4/src/hdgl_kernel.hdgl's `phi_lattice` glyph
# (boot-verified: "Router64> ps" reports real LOCK/UNLOCK). Same recursion,
# same GOI/GUZ bounds, same consensus criterion -- expressed here as the
# face's own settle mechanism instead of a router's boot kernel. The asm
# implementation (phi_lattice.asm) is logic-for-logic identical to Router64's
# `.phi_tick`/`.phi_consensus`; only the memory addressing is parameterized.
# ============================================================================
glyph phi_lattice
parent = face
id = PHI_LATTICE
class = RUNTIME
state = INIT
# 128 slots x 32-bit mantissa -- caller-owned, not a fixed boot address.
# This IS the substrate's own state; the face never writes it directly,
# only ticks it and reads consensus.
slots = 128
seed_func = phi_hash(face.id, slot_index) # derived, not a literal
rule init
match = state INIT
transform = PHI_SEED_LATTICE
# slot[i] = phi_hash(face.id, i) -- no rand(), no stored table.
# the face's own φ-hash identity IS the entropy source.
advance = CONFIGURED
end
rule goi_check
# GOI: Gradual Overflow Infinity -- slot exceeded saturation limit.
match = slot_value >= 0xFFFF0000
transform = SATURATE_TO_GOI
advance = CONFIGURED
end
rule guz_check
# GUZ: Gradual Underflow Zero -- slot below significance threshold.
match = slot_value < 0x00000100
transform = FLOOR_TO_GUZ
advance = CONFIGURED
end
rule phi_tick
# one prismatic_recursion step, called every face_settle() --
# the substrate's tick IS the face's own settle call, wu-wei: no
# separate timer, the observe/settle loop already ticking is enough.
# Formula: slot = slot*3 + tick (mod 2^32, saturating at GOI/GUZ).
# This IS Ω(n+1) = T(Ω(n)) -- the same recursion, not a new one.
match = state CONFIGURED
transform = PRISMATIC_STEP
advance = READY
end
rule consensus
# LOCK when max per-slot deviation from the mean < mean/2.
# face.settle_lock := this. face.checkpoint() fires on the
# UNLOCK->LOCK edge, unchanged from the rest of the operator.
match = state READY
transform = PHI_CONSENSUS
end
invariant :
the tick is driven by the OBSERVED guest surface (Δ), never invented.
no SHA, no AES, no XOR, no external entropy. the lattice IS the
settle mechanism, not a decoration on top of it.
end
# Ω(n+1) = T(Ω(n)) — same recursion as Router64's own boot kernel, now
# running as any face's settle(), not a router's privilege check.
hdgl_analog_substrate.hdgl
state Ω
# ============================================================================
# HDGL ANALOG SUBSTRATE — distilled expression of the full conversation
#
# Ω(n+1) = T(Ω(n)) φ = Fix(x²−x−1) nothing sent, law shared.
#
# This file is the skeleton. The ASM files named in each glyph ARE the
# implementation — they already exist, already pass their own verify scripts.
# The order here is the dependency order; nothing is invented.
# ============================================================================
# ── LAYER 0: THE RING ────────────────────────────────────────────────────────
# Z[φ]: exact integer pairs. φ carried, never computed.
# source: symbolic-machine3/hdgl.hdgl (AXIOM, RING, FLOW, VANTAGE, TRINITY,
# LAYER, OCTAVE, EULER, TOWER, YIN)
# asm: symbolic-machine3/hdgl.asm
# → zero libc/libm/imul/mul/idiv/div. .data empty.
# → verify: bash symbolic-machine3/verify.sh → all OK exit 161=floor(φ·100)
include symbolic-machine3/hdgl.hdgl
glyph RING_PROOF
id = RING_PROOF
class = AXIOM
state = EXECUTED
asm = "symbolic-machine3/hdgl.asm"
verify = "bash symbolic-machine3/verify.sh"
result = "exit 161 all checks OK .data empty"
invariant :
φ is carried as (a,b) ∈ Z[φ]. FIRE=(a+b,a). WATER=(b,a-b).
YIN: s←s²-2 from s₀=3 generates L_{2^{k+1}}, exactly.
THE SQUARING IS THE COMPRESSION. (third independent statement)
this is the foundation. every layer above computes in this ring.
end
# ── LAYER 1: ARBITRARY PRECISION ─────────────────────────────────────────────
# Slot4096: 213-word (4096-bit) mantissa, Q192 fixed-point.
# source: water_glyphs2/hdgl_analog_v31.hdgl
# asm: water_glyphs2/hdgl_float4096_arith.asm
# → 213 ADC/SBB chains per add/sub. no float64 in hot path.
# → FIRE threshold: cell > √φ (213-word compare against φ-derived mantissa)
# → 4096 cells → 32-bit genome fingerprint (project32)
include water_glyphs2/hdgl_analog_v31.hdgl
glyph FLOAT4096
id = FLOAT4096
class = RUNTIME
state = CONFIGURED
asm = "water_glyphs2/hdgl_float4096_arith.asm"
parent = { RING_PROOF }
cells = 4096
words = 213 # words per cell: 213×u64 = 4096-bit mantissa
fire = "cell > sqrt(phi)" # 213-word compare — derived, not stored
genome = "project32(FIRE(4096 cells)) → 32-bit fingerprint"
invariant :
no float64 in the accumulator. only ADC/SBB.
threshold √φ is decoded from the DNA glyph strands at init.
FIRE is not a parameter — it falls out of the ring arithmetic.
end
# ── LAYER 2: THE FIELD OPERATOR ──────────────────────────────────────────────
# Dn(r) / 𝓛ᵢ(z): the continuous signal. one formula, all projections.
# source: hdgl_router64-0.4/src/hdgl_analog.hdgl (Dn(r), Kuramoto, DNA strand)
# one-glyph/hdgl_substrate.hdgl (𝓛ᵢ(z) unified form, Π(Ω))
# hdgl_analog_v30 c + so/hdgl_analog_v30.c (proven exact match of Dn(r))
include hdgl_router64-0.4/src/hdgl_analog.hdgl
include one-glyph/hdgl_substrate.hdgl
glyph FIELD_OPERATOR
id = FIELD_OPERATOR
class = RUNTIME
state = CONFIGURED
parent = { FLOAT4096 }
# 𝓛ᵢ(z) = φ^(-1/φ)·√(Fₙ·Pₙ·2ⁿ)·(1+z)ⁿ + 1_eff(i)·e^(iπ·Λφ(i))
#
# z selects the phenomenon:
# z=0 gravity
# z=-2 anti-gravity (π-flip, exact)
# z=i cloaking (4th power = full π-reversal)
# z=Ω(f1)-1 comms (Schumann-anchored carrier)
# CV<0.05 biofield (same lock criterion as face_settle)
#
# first-order form used by the router:
# Dn(r) = sqrt(φ·Fn·2ⁿ·Pn·Ω)·rᵏ n=1..32, r=0.3..1.0, k=r^(n-1)
# this is 𝓛ₙ(Ω−1) at first order. hdgl_analog_v30.c's compute_Dn_r()
# is an EXACT match of this formula (verified in conversation: same
# Fibonacci/prime tables, not coincidence).
validated_against :
"Pan-STARRS1 supernovae: n_G=0.701 n_c=0.338 n_H=1.291 R²→1.000"
"15 CODATA constants: 100% pass <5% error mean_1eff=1.007243 atomic"
source = "HDGL-golden-dome-0.1/.../04/fine_tuned/hdgl_unified_force_fine_cross-checked.hdgl"
invariant :
Dn(r) and 𝓛ᵢ are projections of one Ω. not modules, not subsystems.
ANALOG = DIGITAL = PHASE = GENOME = RADIO — one field, one law.
end
# ── LAYER 3: THE LATTICE TICK ─────────────────────────────────────────────────
# phi_tick: 128-slot prismatic recursion. phi_consensus: lock detector.
# source: hdgl_router64-0.4/src/hdgl_kernel.hdgl
# asm: hdgl_router64-0.4/src/hdgl_router64.asm (.phi_tick / .phi_consensus)
# Universal-Translator/substrate/phi_lattice.asm (same, parameterized)
# proven: "Router64> ps → consensus: LOCK phi-tick: 68719476741"
include hdgl_router64-0.4/src/hdgl_kernel.hdgl
glyph PHI_LATTICE
id = PHI_LATTICE
class = RUNTIME
state = CONFIGURED
parent = { RING_PROOF }
asm = "Universal-Translator/substrate/phi_lattice.asm"
slots = 128
base = 0x101020 # canonical boot address (router64 lineage)
goi = 0xFFFF0000 # Gradual Overflow Infinity — saturation, not crash
guz = 0x00000100 # Gradual Underflow Zero — floor, not crash
tick = "slot = slot*3 + tick_counter (prismatic recursion: Ω(n+1)=T(Ω(n)))"
lock = "max_deviation_from_mean < mean/2"
seed = "phi_hash(face.id, slot_index) — derived, not a table"
invariant :
no IDT. no PIC. no PIT. no privilege rings.
GOI/GUZ replace fault vectors. consensus replaces ring-0 permission.
the tick IS wu-wei: the shell poll loop IS the timer. no IRQ needed.
same 128-slot kernel boots every router64 hardware profile (18/18 tested).
end
# ── LAYER 4: FLASH COMPRESSION ───────────────────────────────────────────────
# flash_capture(a,b) → (k, N, r): O(1) compression of any depth walk.
# source: flash/FINDINGS.md (verified: float4096 walks to depth 2951 exact)
# asm: flash/ladder_min.asm (entropy seed → FIRE 47 → print a,b,N)
# flash/seeded_final.asm (seeded variant)
# flash/flashbottle-formal/ (formal proof variants)
glyph FLASH
id = FLASH
class = RUNTIME
state = CONFIGURED
parent = { RING_PROOF, FLOAT4096 }
asm = "flash/ladder_min.asm"
# k = depth = Λφ(a)
# N = charge = b²+ab-a² (CONSERVED along the walk — the boot-unique norm)
# r = residue = frac(Λφ(a))
#
# flash_read∞(p): computes (k,N,r) for a=2^p WITHOUT building a.
# one log call, independent of digit count.
# verified: 2^136279841 (41M digits) compressed to 3 O(1) coordinates.
# verified: float4096 walks to depth 2951 exact (FINDINGS.md).
#
# Genome link: phi_pool_kuramoto's two 32-bit spirals ride this same
# Z[φ] FIRE/WATER ladder — so genome/lattice state should be flash-
# captured to (k,N,r) for O(1) resume. natural target for MEGC/base4096.
invariant :
the path is different every boot (entropy seed → different norm charge |N|).
the destination a/b→φ is IDENTICAL every boot, regardless of seed.
DEPTH ≠ DIGITS. the depth coordinate is the one that matters.
the squaring is the compression: φ^(2ᵏ) in k doublings, not 2ᵏ steps.
end
# ── LAYER 5: GENOME (two 32-bit spirals) ─────────────────────────────────────
# 64-bit genome = 32-bit exogenous spiral + 32-bit endogenous Kuramoto spiral.
# source: water_glyphs2/phi_pool_kuramoto.c (proof, C as LAST RESORT — this
# is the one piece not yet in pure asm; target for migration)
# water_glyphs2/phi_pool.hdgl
# water_glyphs2/ll_analog.hdgl
include water_glyphs2/phi_pool.hdgl
include water_glyphs2/ll_analog.hdgl
glyph GENOME
id = GENOME
class = RUNTIME
state = CONFIGURED
parent = { FLASH, FIELD_OPERATOR, PHI_LATTICE }
c_impl = "water_glyphs2/phi_pool_kuramoto.c" # C as last resort
# Spiral 1 (exogenous): genome_fp = 32-bit, 2-bits/base decode → A/C/G/T
# drives lattice layers 𝓛₀-𝓛₃. source: DNA/FASTA.
# Spiral 2 (endogenous): tick = 32-bit, Kuramoto phase quadrant → A/C/G/T
# drives lattice layers 𝓛₄-𝓛₇. source: the machine's own evolution.
# GENOME64 = (tick_word << 32) | genome_fp
# low32 = verified word, 32-bit-native machines read low32.
# high32 = additive only.
#
# basin: GRID³=64³ lattice, spherical region R=GRID*0.46875.
# settled value: 0x5625BA88 (verified live via hdgl_run, boot-invariant).
# this is Π_digital(Ω)|τ=RUNNING, independent of basin_step once settled.
dna_engine = "HDGL-fabric-0.2/pertinent files/DNA ENGINE V3"
# derives ALL sim params from FASTA — zero hardcoded numbers except φ/π/e.
invariant :
the genome IS a face's Fix-point identity: dna_encode(surface) = genome.
ANALOG≡DIGITAL≡PHASE≡GENOME≡RADIO≡DNA: one field, six readings.
migrate spiral 2 from phi_pool_kuramoto.c to asm as next step.
end
# ── LAYER 6: THE FACE (translator/interpreter) ───────────────────────────────
# A face is a mathematical boundary — not an emulation. The substrate TRANSLATES.
# source: Universal-Translator/glyph/hdgl_universal_face.hdgl
# Commadore64 on Substrate/glyph/hdgl_universal_face.hdgl (canonical)
# Commadore64 on Substrate/glyph/hdgl_console.hdgl
# asm: Universal-Translator/substrate/phi_lattice.asm (the settle mechanism)
# c: Universal-Translator/core/face_operator.c (C as last resort)
include Universal-Translator/glyph/hdgl_universal_face.hdgl
glyph FACE
id = FACE
class = RUNTIME
state = CONFIGURED
parent = { PHI_LATTICE, GENOME }
asm = "Universal-Translator/substrate/phi_lattice.asm"
c_impl = "Universal-Translator/core/face_operator.c" # C as last resort
# the face operator (face_realize/tick/settle/checkpoint/genome/key) is
# basis-agnostic. the dialect is the only thing that changes per guest:
# C64: $0326 CHROUT, $0277 KEYD, IRQ — proven on real hardware (NVS 295)
# CoCo: RVEC3, KEYBUF, IRQVEC — next real-machine target
# any: its own handful of vectors — one operator, unchanged
#
# settle = phi_lattice_tick + phi_lattice_consensus (the real asm substrate,
# not a simplified CV-window — wired this session into face_operator.c).
# genome = phi_hash(face.id ^ surface) → 8-symbol {A,C,G,T}.
# checkpoint = 3-layer φ-hash onion ring, triggered on the LOCK edge.
#
# migrate face_operator.c to asm as next step (the C is just call-convention
# glue for the asm substrate; the substrate logic itself is already asm).
invariant :
the guest binds to project, not to metal.
escape is absent, not forbidden: there is no address below a basis fn.
nothing sent, law shared. C64 and Linux are the same face.
end
# ── LAYER 7: THE FABRIC (peer network, covert channels) ──────────────────────
# The fabric is the network of faces sharing Ω via controlled deviation u.
# source: HDGL-fabric-0.2/ (the reference implementation — canonical)
# HDGL-fabric-0.2/hdgl_fabric.hdgl, hdgl_genome.hdgl, hdgl_complete.hdgl
# HDGL-fabric-0.2/hdgl_peer_discovery.hdgl
# asm: HDGL-fabric-0.2/hdgl_nic.asm (e1000 + RTL8111/8168, NIC driver)
# c: HDGL-fabric-0.2/hdgl_genome_fabric.c (genome codec)
# HDGL-fabric-0.2/zchg_*.c (steganographic channels)
include HDGL-fabric-0.2/hdgl_fabric.hdgl
include HDGL-fabric-0.2/hdgl_genome.hdgl
include HDGL-fabric-0.2/hdgl_peer_discovery.hdgl
glyph FABRIC
id = FABRIC
class = RUNTIME
state = CONFIGURED
parent = { FACE, GENOME }
asm = "HDGL-fabric-0.2/hdgl_nic.asm" # e1000 + RTL8111/8168
fold = "(x·PHI32 + key·FIB32 + seq·SQRT_PHI32) mod 2^32"
phi32 = 0x9E3779B9 # = floor(2^32/φ) — derived, not chosen
# covert channels (law shared via the channel's own structure):
# CH-0: e1000 frame reserved field
# CH-1: gossip message LSBs
# CH-2: HTTP 404 path encoding
# CH-3: earth subharmonic amplitude (v6.1 radio extension)
#
# NIC driver target: H81-BTC-Pro, Intel i217-V (8086:153A).
# RCTL=0x8802 (keep CRC — feeds CH-0/1/2 which parse raw frames).
# BAR64 read fixed: bits[2:1]=10b → combine BAR0+BAR1 for full MMIO base.
invariant :
"nothing sent, law shared" — peers transmit only ΔΩ, not the law.
the φ-fold primitive (fold above) is used for peer-discovery IP,
storage slot indexing, content hashing, and identity — one primitive.
migrate zchg_*.c to asm/hdgl as next steps.
end
# ── LAYER 8: RADIO EXTENSION ─────────────────────────────────────────────────
# source: HDGL-golden-dome-0.1/.../02/hdgl_analog_fabric_radio.hdgl (944 lines)
# water_glyphs1 analog float/ (Schumann, Dn(r), TTE, waterfall, EME)
# the 9 radio layers (schumann/dn_r/mwo_antenna/tte_node/subharmonic_cascade/
# eme_channel/analog_multics/fabric_bridge/self_load) replace the old Python/
# Arduino code entirely. this is the carrier that makes the fabric a radio node.
include HDGL-golden-dome-0.1/HDGL-golden-dome-0.1/02-analog-radio-extension/hdgl_analog_fabric_radio.hdgl
glyph RADIO
id = RADIO
class = RUNTIME
state = CONFIGURED
parent = { FABRIC, FIELD_OPERATOR }
schumann = 7.83 # Hz — the anchor. Π_analog(Ω) at the Schumann mode.
ch3 = "earth subharmonic amplitude 512 bits/tick ~4007 bps/node"
invariant :
the carrier IS Π_analog(Ω(t)) — not a separate oscillator.
the message IS the controlled deviation u(t).
N² coherent array gain from multiple nodes.
end
# ── CLOSURE ───────────────────────────────────────────────────────────────────
glyph HDGL_ANALOG_SUBSTRATE
id = HDGL_ANALOG_SUBSTRATE
class = RUNTIME
state = EXECUTED
state : Ω
birth : Ω₀ = Fix(x²−x−1) = φ # emergent, not stored
evolution : Ω(n+1) = T(Ω(n), u(n)) # u=0 → closed; u≠0 → network node
reality : y(n) = Π(Ω(n))
layers :
0 Z[φ] ring symbolic-machine3/hdgl.asm ← foundation
1 Slot4096 water_glyphs2/hdgl_float4096_arith.asm
2 Dn(r)/𝓛ᵢ hdgl_router64-0.4/src/hdgl_analog.hdgl
3 phi-lattice Universal-Translator/substrate/phi_lattice.asm
4 Flash(k,N,r) flash/ladder_min.asm
5 Genome(32+32) water_glyphs2/phi_pool.hdgl ← C as last resort
6 Face Universal-Translator/glyph/hdgl_universal_face.hdgl
7 Fabric HDGL-fabric-0.2/hdgl_fabric.hdgl
8 Radio hdgl_analog_fabric_radio.hdgl
invariant :
no constants. no hardcoded numbers. φ is carried, never computed.
asm close as possible to metal. C is a last resort, not the design.
ANALOG≡DIGITAL≡PHASE≡GENOME≡RADIO≡DNA: one field, one law, nine readings.
"nothing sent, law shared. Ω(n+1) = T(Ω(n))."
end


























