Contents
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.
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.
What moved
Fifteen segments, each cut verbatim from where it was. orbital_core.js exports 89 names from them, plus state, SEGMENTS and version.
| Segment | From | Holds |
|---|---|---|
| core | core.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 |
| tiers | page.html | Engine v10’s five tiers: R, r, W and frequency; 30 nodes, 150 pulses |
| krat, layerb, d2r | page.html | The rationalization grid 2⁻²⁴ and Layer B’s helpers |
| lemma | page.html | SHA-256, the 64-bit Einstein tile, data and frame-leg packets, Hurwitz Form 1, the Lemma 15 Merkle chain |
| exact | page2.html | Exact tier frames, the 120° turn, tier nodes, the Triple-Quad Formula |
| tonum, fracpart | page3.html (fracpart also in gen4.py) | A fraction as a double beyond 2¹⁰²⁴; a turn count modulo one turn |
| gauge | page3.html | The Proposition 7.14 gauge |
| readout | page3.html | The landing nodes and their TQF: the lock |
| memory, rebuild, locate | page3.html | A memory word’s tiles, leaves, chain and parity; rebuilding a cell; locating an altered one |
| pump | gen4.py | The 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.
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__*/.
build.py and gen4.py see exactly the text they saw before. The module is loaded directly by other systems.- Expand first.
orbital_segments.pywrites every segment back into every template beforebuild.pysplices orgen4.pypatches, so their string searches find what they always found. - One patch remains.
gen4.pystill edits thereadoutsegment 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 pagesstateis each page’s live controls; in the module it is tension 0, torsion 0 and coupling κ = 1, the settings claim E6 specifies.
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.
| Check | Result |
|---|---|
| Expanding each new template gives back the old one | Exact, 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 segment | All 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 |
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.
Using it
The module is UMD: a global in a browser, require() in Node. There is no build step and no dependency.
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.
The module, live
This page loads orbital_core.js from the build folder and runs a few of its checks in your browser.
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.
| Check | Result |
|---|---|
| PolyStep’s full test suite with torch and polystep 1.1.1, before the change | 137 passed |
| The same suite after the change | 137 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 change | Nothing imports: from hpstep import fence raises ModuleNotFoundError: torch |
| Without torch, after the change | Every 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 |
Smaller changes
scripts/geometric-build/core.jsis gone; its text is the module’scoresegment. 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.cjsread Three.js r128 from a folder of an earlier session; it now reads it from$SP, like the other tests.- PolyStep’s
run_traces3d.pyopenedtwin3d.jsonfor 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.