Engram Mind’s Eye · Explainer 3 · Phase 1

The Shared Cores

Before anything could be built on the orbital calculators, their exact code had to exist somewhere other than inside the pages. Phase 1 moved it into one module that the pages are still built from, byte for byte, and made Hyperbolic PolyStep’s exact modules importable without torch.

Run the module here How we know nothing changed System map
Contents
  1. Where this sits
  2. Why a module
  3. What moved
  4. How the build works now
  5. How we know nothing changed
  6. Using it
  7. The module, live
  8. PolyStep without torch
  9. Smaller changes
01

Where this sits

The shared cores take the tier laws, the triple quad, the gauge and the pump from the orbital calculators and feed the Python reference of Phase 2.

02

Why a module

The four orbital pages, Galactic Lensing Part 1, the Tri-Engine Soliton, Tri-Engine Convergence and the Zero-Point Tri-Engine, are generated from templates in scripts/geometric-build/. Their exact code lived inside those templates: the tiles and the Merkle chain in Part 1’s, the tier frames and the TQF in Part 2’s, the gauge and memory repair in the Convergence template, and the pump inside gen4.py.

That was fine for the pages, which the build stitches together. It left nothing another system could load. In Phase 0, Spike C had to cut functions out of the templates by name, which breaks the moment one is renamed. Decision D2 chose the other way: move the code into one module and have the build write it back.

03

What moved

Fifteen segments, each cut verbatim from where it was. orbital_core.js exports 89 names from them, plus state, SEGMENTS and version.

SegmentFromHolds
corecore.js (removed)Rationals, quaternions, the Cayley map, Python’s Mersenne Twister, Part 1’s physics and the line-by-line port of verify_galactic_hierarchy.py
tierspage.htmlEngine v10’s five tiers: R, r, W and frequency; 30 nodes, 150 pulses
krat, layerb, d2rpage.htmlThe rationalization grid 2⁻²⁴ and Layer B’s helpers
lemmapage.htmlSHA-256, the 64-bit Einstein tile, data and frame-leg packets, Hurwitz Form 1, the Lemma 15 Merkle chain
exactpage2.htmlExact tier frames, the 120° turn, tier nodes, the Triple-Quad Formula
tonum, fracpartpage3.html (fracpart also in gen4.py)A fraction as a double beyond 2¹⁰²⁴; a turn count modulo one turn
gaugepage3.htmlThe Proposition 7.14 gauge
readoutpage3.htmlThe landing nodes and their TQF: the lock
memory, rebuild, locatepage3.htmlA memory word’s tiles, leaves, chain and parity; rebuilding a cell; locating an altered one
pumpgen4.pyThe 720 → 72 → 10 pump of one engine’s register

The same text of fracPart sat in both the Convergence template and gen4.py; both now point at the one segment.

04

How the build works now

A segment runs from // @orbital-begin name to // @orbital-end name in the module. Where it used to be, the template now holds /*__ORB:name__*/.

templatespage*.html, gen4.py orbital_core.js15 segments · UMD expandorbital_segments.py build.py, gen4.pysplice, patch, write four pagesbyte-identical other systemsrequire / script
The templates and the module are expanded first, so build.py and gen4.py see exactly the text they saw before. The module is loaded directly by other systems.
  • Expand first. orbital_segments.py writes every segment back into every template before build.py splices or gen4.py patches, so their string searches find what they always found.
  • One patch remains. gen4.py still edits the readout segment for the Zero-Point page, giving the readout its pairing node k. The module keeps the Convergence version, with node 29.
  • Nothing else outside the segments. The module adds only its wrapper, the export list and a neutral state: in the pages state is each page’s live controls; in the module it is tension 0, torsion 0 and coupling κ = 1, the settings claim E6 specifies.
05

How we know nothing changed

The goal was a refactor the pages cannot notice, and the strongest way to show that is the bytes themselves.

CheckResult
Expanding each new template gives back the old oneExact, for page.html, page2.html, page3.html and gen4.py
Rebuild and reinstall the site bar (tests/rebuild-identical.sh)All four built pages byte-identical to the committed ones
Mutation: one comment changed inside the lemma segmentAll four pages changed by one line; restored, all four identical again. The build really reads the module
The module in Node (tests/orbital-core.cjs)18/18, including Part 1’s verification reproducing ref_output.txt 66/66 lines outside the browser
Part 1 and Part 2 in Chromium (all.cjs, exp.cjs)19/19 PASS, 66/66 lines match; Part 2 LOCKED; no page errors at 1440 and 390 px
Tri-Engine Convergence (conv.cjs, clutch.cjs)Self-test 13/13; presets, memory repair and the three clutch settings as expected; no failed lemma rows
Zero-Point Tri-Engine (zp.cjs, zp2.cjs, zp3.cjs)Self-test 18/18; pairing at n = 0; registers close; opens paused
Site bar and manuals (bar.cjs, man.cjs), engine v10 TQF (tqf.cjs)As expected; no errors
Engine v10 index (idx.cjs)Not run: it also needs Three’s OrbitControls from a CDN this sandbox cannot reach. Engine v10 is not built from these templates and was not touched
How the browser tests ran here

They need local copies of Three.js r158 and r128 and of KaTeX, which the CDNs serve. The CDNs are blocked in this sandbox, so the same releases came from the npm registry (three@0.158.0, three@0.128.0, katex@0.16.9). The build README now lists all of them.

06

Using it

The module is UMD: a global in a browser, require() in Node. There is no build step and no dependency.

<script src="../../../scripts/geometric-build/orbital_core.js"></script>
const { Fraction, packTile, merkleChain, gaugeExact, readout, pumpOf } = window.OrbitalCore;

// Node
const O = require('./scripts/geometric-build/orbital_core.js');
O.state.kappa = 0.5; // read the pages' functions under other settings

Changing shared code now means editing the text between a segment’s two markers and rebuilding: every page that uses it changes, and so does every system that loads the module. tests/rebuild-identical.sh then says which pages moved.

07

The module, live

This page loads orbital_core.js from the build folder and runs a few of its checks in your browser.

Lab · orbital_core.js in this page
Loading…
08

PolyStep without torch

The engram reference will use Hyperbolic PolyStep’s exact modules in place: the generator, the exact rationals, the 3D decoder and its tree, frames, the coupler and the fence. Until now, importing any of them imported torch, because the package’s __init__.py loaded the step.

Decision D7 made the step load lazily (PEP 562): PolyStepH, StepConfig and StepState import torch and polystep the first time they are used, and nothing else does. Every name the package exported before is still there, and hpstep.step still resolves. The suite ran in a fresh environment with torch 2.15 and polystep 1.1.1 from PyPI, and in a second one with numpy and pytest only.

CheckResult
PolyStep’s full test suite with torch and polystep 1.1.1, before the change137 passed
The same suite after the change137 passed. The 3D decoder, twin-system and fence traces regenerate byte-identical to the committed ones, so the browser ports’ parity checks are unaffected
Without torch, before the changeNothing imports: from hpstep import fence raises ModuleNotFoundError: torch
Without torch, after the changeEvery exact module imports, and torch is never loaded; PolyStepH asks for torch only when it is used. test_prng.py, test_problems.py and test_fence.py: 30 passed. The fence trace regenerates byte-identical
09

Smaller changes

  • scripts/geometric-build/core.js is gone; its text is the module’s core segment. The build README and the Hyperbolic Oracles build explainer name the module instead.
  • Spike C now requires the module rather than cutting functions out of the templates. Its nine checks give the same results; only its title line changed.
  • tests/idx.cjs read Three.js r128 from a folder of an earlier session; it now reads it from $SP, like the other tests.
  • PolyStep’s run_traces3d.py opened twin3d.json for writing before computing the trace, so a run that failed (now possible without torch, which the twin half needs) left the file empty. It now computes first, and the trace it writes is unchanged.