HDGL SUBSTRATE — TempleOS EMERGED AS ORACLE PROJECTION
=======================================================
TempleOS boots as a projection WITHIN the HDGL substrate and interacts.
Tested live in QEMU. Not asserted — observed.

WHAT THIS IS
------------
The substrate (stage1_mbr.asm + stage2_substrate.asm, bare-metal 16-bit)
reaches τ=RUNNING and EMERGEs its host as the TempleOS oracle — Terry A.
Davis's RandU64 from Kernel/KMathB.HC, ported exactly:

    res = LIN_CONGRUE_A * rand_seed              A = 6364136223846793005
    res ^= (rand_seed & 0xFFFFFFFF0000) >> 31    (HolyC precedence: >>(16+C)&63=31)
    res ^= GetTSC                                RDTSC — the timer entropy
    rand_seed = res

This is the STEP glyph's oracle: "Δ ← GetTSC ⊕ LCG, TempleOS Seed(0)".
The host materialises AS this oracle (EMERGE glyph: host ≡ Π_host(Ω)).

BOOT + INTERACT (verified)
--------------------------
    qemu-system-i386 -drive file=hdgl_temple.img,format=raw,if=ide

    Keys:  h=help  f=fib  p=repl  t=TEMPLE  ESC=restart
    In TEMPLE mode:
        any key = query oracle (draws RandU64, injects Δ, shows Ω)
        s       = Seed(0) reseed (rand_seed ^= GetTSC)
        ESC     = return to orbit (substrate keeps ticking beneath)

    Live transcript (INTERACTIVE_TRANSCRIPT.log):
        [emerge] host materialised: Temple oracle ported (RandU64 -> Delta)
        [oracle] rand_seed = 0x0B8D8B9E7C2B9A44     (Seed(0): 0x5625BA88 ^ GetTSC)
          RandU64=0x3CBE06415FFF8446  d=0x5D946F18  O=1.61803398
          RandU64=0xC23E45C2952794E3  d=0xE7AFE4E0  O=1.61803398
          [Seed(0)] rand_seed ^= GetTSC  (timer-based reseed)
          RandU64=0xE68BE8842EDDDF69  d=0xF6658018  O=1.61803398
    Each query drew from the emerged oracle; Ω held at its fixed point while
    the substrate ticked underneath. ESC returned to ORBIT (t=5043+).

BYTE-EXACTNESS (verified on metal)
----------------------------------
    qemu-system-i386 -drive file=hdgl_selftest.img,format=raw,if=ide

    Deterministic build (RDTSC disabled, seed reset to 0x5625BA88) prints the
    first 5 RandU64 draws. They match the TempleOS reference exactly
    (SELFTEST_TRANSCRIPT.txt):

        F938EC09CD5341E8   639F4963A15D75DB   D75A7172575CCEB8
        2B39C72B56F57CBC   68871DB77B75BF5A

    Anchor: rand_seed seeds at 0x5625BA88 = the Alpha-Omega genome index
    (KJV oracle: "I am Alpha and Omega", Ω ≡ φ ≡ Fix(T)).

THE BUG THAT WAS FOUND (and why metal testing mattered)
-------------------------------------------------------
The 64x64->64 multiply first appeared correct — a C port matched the
reference over 10,000 iterations. But on metal the high 32 bits were wrong.
Cause: in the partial-product accumulation,

    mov edx, eax        ; saved (Al*Rh)_lo
    mov eax, Ah
    mul ebx             ; <-- mul CLOBBERS edx with (Ah*Rl)_hi
    add edx, eax        ; added (Ah*Rl)_hi + (Ah*Rl)_lo  — WRONG

C's arithmetic model doesn't capture x86 register clobbering, so the C test
passed while the metal was wrong. Only booting it and diffing against the
TempleOS reference exposed it. Fix: stash (Al*Rh)_lo in EDI (which mul does
not touch) before the second mul. After the fix, all 5 draws are byte-exact.

FILES
-----
    stage1_mbr.asm         512 B  MBR, EDD+CHS load (16 sectors)
    stage2_substrate.asm  7123 B  substrate v3.3-Temple (interactive oracle)
    stage2_selftest.asm           deterministic byte-exactness harness
    hdgl_temple.img      32 KB   bootable — interactive Temple oracle
    hdgl_selftest.img    32 KB   bootable — deterministic self-test
    INTERACTIVE_TRANSCRIPT.log    captured live boot+interaction
    SELFTEST_TRANSCRIPT.txt       captured byte-exact verification

SCOPE — HONEST
--------------
"TempleOS boots as a projection" here means TempleOS entering AS its RandU64
oracle — the EMERGE-as-oracle path named in the substrate's own hdgl.hdgl and
the boot15 universal transcript ("[emerge] Temple: oracle ported"). It is NOT
the full TempleOS graphical kernel booting. The oracle is byte-exact TempleOS;
it boots within the substrate and answers queries interactively; the substrate
persists beneath it. All of this was run and observed in QEMU, not asserted.

Build:  nasm -f bin stage1_mbr.asm -o s1.bin
        nasm -f bin stage2_substrate.asm -o s2.bin
        dd if=/dev/zero of=hdgl_temple.img bs=512 count=64
        dd if=s1.bin of=hdgl_temple.img bs=512 count=1 conv=notrunc
        dd if=s2.bin of=hdgl_temple.img bs=512 seek=1 conv=notrunc
