Hyperbolic PolyStep · Explainer 4

Build and Verification

Three implementations of one step: a Python reference that uses polystep itself, a browser core, and the live page. This explainer covers how each is built, how each is checked against the others, and what every phase must pass before the next one starts.

The pipeline chart Test plan Roadmap
Contents
  1. Where this sits
  2. The pipeline
  3. Four arithmetic tracks
  4. Trace parity
  5. The Python reference
  6. The browser core
  7. The simulation page
  8. The site build
  9. Test plan
01

Where this sits

The three implementations, each with what it draws on and what it feeds.

02

The pipeline

The reference is the authority: it runs the benchmarks and decides the claims. The browser core is a port, trusted because its traces match the reference’s line for line. The page runs the core live and re-checks a sample of traces every time it loads.

PHASE 1 · PYTHON PHASE 2 · BROWSER CORE PHASES 3–4 · PAGES polystep 1.1.1 (pip)rotations · solvers · baseline reference/ step + checksH1–H7 in exact Fractions benchmark runnersB1–B4 · settings.json traces/*.jsonseeded steps, tracks A B C R hyperbolic_core.jsport on the exact core simulation pageself-test: N/N lines match proofs and resultsdecisions on C1–C3 writeschecked againstre-checked on loadresultscredited on every page
Solid boxes exist; dashed boxes are built in the phase named above them.
03

Four arithmetic tracks

The paper’s §8.10 runs the spinor clock on four parallel tracks. The same split is used here, so each number has exactly one job.

TrackArithmeticJob hereChecked by
AFloat64The search: corners, costs, weights, centroids, at speedAgreement with B within a stated tolerance
BExact rationals (BigInt fractions, Python Fraction)Certificates: every stored state on the sheet, Helix B’s counts, the register’s holonomyExact identities (H1, H7, pump)
CRational approximants on a declared gridThe snap that returns each centroid to an exact point; its residual logged every stepResidual within the grid bound
RResidues modulo 881Fingerprints of states, for the visited-state hash and the memory’s Merkle chainAgreement with B reduced mod 881
04

Trace parity

The Galactic Lensing Part 1 page reproduces its Python verifier’s output line by line (66/66). The same discipline applies here, with one honest caveat about floating point.

  • One random generator, in both languages. A small seeded generator (xoshiro128**, specified bit for bit) is written in Python and JavaScript. Neither torch’s nor the browser’s generator is used for anything that is traced.
  • Exact where it can be. The traced path takes rational step lengths (t = tanh(r/2)) and Cayley rotations, so corners, probes, snapped states and Helix B’s counts are exact rationals. They must match exactly.
  • A tolerance where it cannot. Softmax uses exp, and the transcendental functions of Python’s and the browser’s maths libraries may differ in the last bit. Weights and float centroids therefore match within a relative tolerance of \(10^{-12}\), and the tolerance is printed with every comparison.
Why it matters

A port that matches on the exact track and agrees within a stated tolerance on the float track is trustworthy. One that is only “close” everywhere cannot be told apart from a subtly wrong one.

05

The Python reference (Phase 1)

It lives in reference/, and polystep is a dependency, not a copy. Planned layout:

FileHolds
requirements.txtpolystep 1.1.1 and its CPU torch (already written)
hyperbolic.pyLorentz form, boosts \(L_x\), ghost map and its inverse, Klein and Poincaré charts; float and Fraction versions
step.pyThe hyperbolic step, using polystep’s orthoplex, rotations and SoftmaxSolver / SinkhornSolver; the curvature-0 switch (H5)
exact.pyCayley rotations, rational corners, the snap; H1–H7 as exact checks
channels.pyThe 24-frame schedule, pairing, clutch, membrane and pump (ported from the Zero-Point page’s constants)
problems.pyInstance generators and decoders for B1–B4; Helix B’s exact counts
prng.pyThe shared xoshiro128** generator
run_traces.py, run_bench.pyWrite traces/*.json; run the preregistered benchmarks and write the results
tests/pytest: H1–H7, decoder round trips, schedule constants, generator determinism
06

The browser core (Phase 2)

One file, hyperbolic_core.js, beside the pages. It builds on the existing exact core (BigInt fractions and rational quaternions, already used by every tri-engine page) and exposes the same functions as the reference: charts and boosts, the step, the snap, the decoders, Helix B and the generator. Float functions do the search and exact functions the certificates, and each function is marked with its track.

07

The simulation page (Phase 3)

Built in Phase 3 as simulation.html. The plan was to generate it from the Zero-Point Tri-Engine’s template. It was written by hand on hyperbolic_core.js instead, because the core already holds the clock, schedule, clutch, membrane, memory and pump, checked line for line against the reference. A second copy from the template would have been code with no parity check.

Poincaré view

Each channel’s particles and incumbents in one factor, with the last step’s polytope drawn as geodesics and weighted corners; the tree in an anchor’s chart for B3; prototypes and encoded inputs for B4.

The answer

B1–B4 at their sizes, with the decoded answer (a coloured graph, a truth grid, address digits, a confusion matrix) and Helix B’s exact count.

Clock and channels

The eight-stage dial and the 24-frame strip with each packet’s stage, the register meter, the pump result, per-channel steps and costs, and the memory chain, re-verified on every redraw.

Self-test

105 trace lines replayed through the page’s own core on load, and all 169 on request.

It opens paused, takes its settings from the address, and is documented control by control in the simulation manual. Making the exact track usable live meant speeding up the core’s pump about eightyfold, with results unchanged (details).

08

The site build

The calculator’s generated pages are built from templates kept in scripts/geometric-build/, moved into the repository in Phase 0 so any session can rebuild them.

templatespage*.html, core.js build.pygen4.py (gen5 later) built pagesGalactic, Zero Point install-page-chromesite bar, menus GitHub Pagesdeploy on push to main This folder’s pages are written by hand on hyperbolic_core.js; only the site bar is installed by script.
09

Test plan

PhaseMust pass
0Every page renders with no script error at desktop and phone width; every link resolves; the charts draw every node and edge; the build reproduces every existing page byte for byte
1 passedH1–H7 on random instances (1,000 each for H1, H3, H4 and H6; 1,600 for H2; H5 as a limit; H7 on 50 random and two live registers); the curvature-0 step equals polystep’s on the same rotation; decoders agree exactly; the generator matches its published vector. 80 tests; see the reference guide
2 passedEvery trace line matches: exactly on tracks B, C and R, within \(10^{-12}\) on track A. Result: 169/169, in Node and live in the browser; see the core reference
3 passedThe page opens paused; self-test and trace sample pass on load; the pump closes every register with H = P⁻¹; no horizontal scroll on a phone; the bar test passes. Result: frame 0 and paused on load, 105/105 on load and 169/169 in full, all four problems in both geometries under all three clutches with no script error, the exact register on B1 closed with H = P⁻¹, 390 px wide with no horizontal scroll
4 passedBenchmarks run exactly as preregistered; every cell reported with its decision; the B3 control behaves as Prop 5.13 requires. Result: 7,740 runs under Amendments 2 and 3, every cell on the results page, and the control passing for every method at every depth. One defect, found after the runs (the float membrane leaving the sheet), was fixed, its runs redone, and both sets reported