PulseCore

Chapter 4 · Section 16

The Matter Step: Timing and Its Own Thread

The BPT law

BPT does not state this; it is a game method. What it serves is the theory's clock. In BPT a Pulse is two flips, one Tempo, the universe's own unit of time (Part 1.10, Pulse Phase Temporal Genesis), and a universe lives exactly 2^L of its Tempos, by the Rupture Rule (Chapter 1, Part D). Every law of this chapter is written on that clock: the expansion's life T, the Gravity of a Universe's age, the free-fall and cooling times read as shares of a life. So the game keeps the clock exact and fits the matter's motion inside it. The flip's own step (the cell rule, the novas, the Rupture count) still runs whole; matter only fills in the motion between, in fixed shares of a flip (comments app.js:4301–4318), so that a flip of matter is the same piece of the universe's life on every device and at every pace.

The established physics

Leapfrog (kick–drift–kick) with a fixed step is symplectic: orbits keep their energy over many steps (Hockney & Eastwood 1988; matter.js:11). A step that changed with the wall clock would make the physics depend on the device.

The game's math

MATTER_SUB = 4 (app.js:4319). stepMatterTo(share) app.js:4320:

want = min(4, ⌊share · 4 + 10⁻⁹⌋)
while matterSubDone < want:  stepMatter(1/4);  matterSubDone += 1

share is the part of the current flip done (subDone). So every device does four sub-steps of a quarter flip each per flip; between them the scene glides each body on its velocity (app.js:4450–4452). The flip's own step at app.js:4550 finishes any sub-steps not yet run (stepMatterTo(1)) and resets the count. Ruling 2026-10-27, after 610 ms of physics a flip on a phone: the old slices ran the whole step at whatever share the wall clock gave, about 16 a flip on a phone and 4 on a computer.

One sub-step's leapfrog, Matter.step(wells, dt) matter.js:379, with h = dt/2:

  1. mesh forces; for each body: v += h·gk·a, held to c, x += v·dt; for each well likewise (with friction, gk on gravity only);
  2. mesh forces again; for each body: v += h·gk·a, held to c; cooling; for each well: v += h·a, held to c.

The thread. matter-worker.js (11 lines) holds one Matter and runs one sub-step per message: matterRun() matter.js:543 copies the fields named in MATTER_IN (matter.js:535) onto it, runs step(), and sends back the fields in MATTER_OUT (matter.js:536). matterPack() matter.js:538 strips each well's link back into the game (src); matterTake() matter.js:550 copies the answer back and clears the bins. On the page, launchMatter() app.js:4355 keeps at most one sub-step in flight, matterLanded() app.js:4367 finishes it with stepMatterPost(), and the flip waits for its four. A failed worker hands its sub-step back and the page steps itself (matterThreadFailed() app.js:4347).

In 8.3 the thread is switched off (MATTER_THREAD = false, app.js:4335), so every sub-step runs on the page through stepMatterTo(), and matter-worker.js is never loaded.

In the game

The player controls the pace and never the physics. The Speed control offers "slider pace", "paced · the filling in ~20 s, the life in ~100 s" and "max · the rule flat out", and its tooltip promises "The physics is the same at every speed" (index.php:132–133); the Pace slider sets the slider pace. Whatever the pace, every flip gets its four matter sub-steps, and between them the scene glides each body along its velocity, so the stars move smoothly however slowly the physics runs (app.js:4450–4452).

How hard the device is working is on the HUD. Every two seconds perfTick() app.js:4419 averages the physics' milliseconds per flip, the drawing's milliseconds per frame, the frames a second and the percent of the time the page is busy, and the Speed line shows them as "physics … ms/Pulse · drawing … ms · … fps · busy …% · … MB" (app.js:4426), the physics doubled to a Pulse of two flips. Its tooltip says "above about 80% it starts to stutter" (index.php:82). perf.lastBusy is also what applyFeedback() reads (Chapter 5). The run's saved record keeps these numbers by phase of the run (perfRecord() app.js:4435).

The scale model

Exact: no scale model. The same four sub-steps on every device and at every pace.

Where the game and the theory differ

  • The thread is described but not used. The comment at matter.js:527–534 says one matter sub-step runs on another thread "with this same code; the page keeps drawing". In 8.3 MATTER_THREAD = false (app.js:4335): it was switched off on 2026-10-29 (Josh: "I just ran it an no stars at all"), since with it on the stars starved, "on again only once the cause is found". The code does not record the cause, and this book does not guess at it.

Fixed numbers

Number Where What it is Kind
4 MATTER_SUB app.js:4319 Sub-steps a flip METHOD (fixed leapfrog step)
10⁻⁹ app.js:4322, 4356 Rounding guard METHOD
0.5 Matter.step() matter.js:399 Half-kick h = dt/2 METHOD (leapfrog)
false MATTER_THREAD app.js:4335 Matter thread switch METHOD (off pending a fix)
600 matter-worker.js:10 Characters of a worker error kept RECORD
2000 perfTick() app.js:4422 Readout window, ms RECORD

Measured

These are the measurements the code comments record, with their dates:

  • 2026-10-26 (app.js:1158–1159): on the old 8 × 8 mesh, 18,600 bodies at level 5 barely merged in a life.
  • 2026-10-26 (zeldovich.js:112–115): an even grid of cells, not weighted by real area, packed 20,000 bodies' worth of the brightest stars into the throat at level 5.
  • 2026-10-26 (app.js:1231): the data's differential spin added to every body ran 9 cells a flip at level 5 and smeared the ripples flat: no web.
  • 2026-10-27 (zeldovich.js:19–22): ripples longer than a quarter of the field carried the matter one way: 46 % → 8 % of the matter left the outside of the tube in the first third of the life.
  • 2026-10-27 (matter.js:124–126): cooling toward block centers left motion round them equal to motion toward them.
  • 2026-10-27 (app.js:1178): 1.3 s of physics a flip at 8 frames a second with 30,000 bodies on Josh's desktop.
  • 2026-10-27 (app.js:4312–4314): 610 ms of physics a flip on Josh's phone with wall-clock slices.
  • 2026-10-28 (zeldovich.js:69–73): the row-wide contrast streamed matter 3–6 cells a flip, 5 % of light, away from the outer equator; by half its life 53 % of it lay in the band of 60–90° that holds 21 % of the surface.
  • 2026-10-28 (matter.js:278–280): 14 % of a physical step went to rebuilding each block's 7 × 7 list of near wells.
  • 2026-10-28 (app.js:2989–2991): 59 of 60 phone galaxies read as hot halos before the 2^(Lm − 6) correction.
  • 2026-10-29 (matter.js:332–335): at level 202 with 15,000 sites, 2 × 10⁸ well pairs a sub-step; a step took 53 s.
  • 2026-10-29 (app.js:1162–1163): a level-182 phone run formed 302 stars where the weighting drew 40,000.