PulseCore

Chapter 4 · Section 12

Falls, Mergers, New Wells and Planets

The BPT law

Three laws of the book meet in this code.

  • The horizon. BPT Part 2.4 (Event Horizons and Null Wells) reads the horizon at "event horizon scale r_s = 2GM/c²" as a computational boundary, where a well's Pulse activity falls to null; what crosses it is in.
  • The birth of a well. BPT Part 6.3 (Null Wells and the Birth of New Universes) states the Formation Condition (G), ℜ⌂(x, τ) ≥ ℜρ⨶ = k × ρ_P × 𝒞→²: where the local recursive tension density reaches its critical threshold, a region makes the transition to the null state and a Null Well forms. The code reads it as the hoop test, 2Gm/c² ≥ size (matter.js:30–33). BPT Part 3.14 (Proto Wells: Where Wells Will Form) adds which collapses actually happen: "No Null Well has ever been seen to form except by collapse: a star's core falling in, with a supernova or without one, … or, in the first few hundred million years, a whole cloud of gas falling in at once", so that "a well is born at a site in one of two ways", by direct collapse early or from a dying star.
  • Spin from orbit. BPT Part 3.12 (Where Spin Comes From) gives "the book's own rule that spin is born of orbit": "a single pulse cannot carry spin, a merger of two wells gives a universe its spin, and the uneven pull of neighbours gives every clump of matter its own". So a merger's orbital angular momentum becomes the merged body's spin.

The planet test is the game's own: BPT does not define when a body counts as a planet. The book counts planets among what a universe runs, "stars, gas and planets" (BPT Part 3.15).

The established physics

  • Orbital pericenter from energy and angular momentum, r_p = L²/(GM(1 + e)), e = √(1 + 2EL²/(GM)²) (Kepler problem).
  • Capture when the relative speed is below the pair's escape speed.
  • Hill radius r_H = a(m/3M)^(1/3).
  • The largest spin an accreting hole reaches, a ≤ 0.998 (Thorne 1974).

The game's math

All in Matter.step(), after the kicks and frame dragging.

Falls (matter.js:428–443). For each well, the bodies near enough to reach its horizon this step (R blocks from the fastest closing speed) are tested. A body falls in if d < r_s, or if its pericenter is inside r_s, it is moving inward, and it reaches r_s within this step (d − r_s ≤ |v|·dt). The horizon is smaller than a cell, so a body would jump past it between steps; the orbit decides (ruling 2026-10-26: "wells should eat the stars, just not all of them"). Absorbed mass is added to the well in stepMatterPost() app.js:688.

Mergers (matter.js:454–474). Bodies are hashed by whole cell (⌊r⌋·65536 + ⌊c⌋). A second body in an occupied cell merges with the first if their relative speed squared is at most 2G(m₁ + m₂)/0.5, the escape speed at half a cell; otherwise it passes through. A merger keeps mass, momentum and center of mass; adds the pair's orbital angular momentum μ(dc·vr − dr·vc) to spin s; joins gas, metals, stars and pending star mass (Chapter 5). The first 64 mergers of a step are passed to the scene for its flashes. Merging within one cell only, because merging on touch at size √(m/π) chained the whole universe into one body in one flip (matter.js:449–452).

New wells (matter.js:478–482). A body becomes a well if 2Gm/c² ≥ √(m/π), its size packed one quantum to a cell. At the code's light speed no body passes it (below).

Planets (findPlanets() matter.js:488). A body of at least full cells (one cloud's mass, CL², Part 4.15) whose nearest well within three blocks is at least two cells away and binds it (E = v²/2 − GM/d < 0) counts a step toward being a planet; on its sixth bound step it is reported once with its orbit, mass, spin, Hill radius and speed. A well with two or more such planets is a system, reported once. These go into the collection (app.js:697–705).

Spin and frame dragging are documented in Chapter 3, Part 3.9, and the hoop test from the wells' side in Part 3.8. Their fixed numbers (0.998, 10⁻⁷, ±0.5) are tabled there.

The method, in plain steps:

falls: a body near a well falls in if it is inside r_s, or its orbit dips inside r_s and it gets there this step
mergers: two bodies in one cell merge if they are slower than escape at half a cell
    mass, momentum and centre kept; the pair's orbit added to the spin; gas, metals and stars joined
new wells: a body with 2Gm / c² ≥ √(m / π) collapses into a well
planets: a cloud-sized body bound to a well for six steps is a planet; two around one well, a system

The code:

// public/game-v8.4/matter.js:453
// bodies within a cell merge, keeping mass and momentum (a hash of cells finds neighbours)
const cell = new Map(), merged = [];
for (const b of keep) {
    const key = Math.floor(b.r) * 65536 + Math.floor(b.c);
    const o = cell.get(key);
    // they merge only if captured: their relative speed below the pair's escape speed at half a cell; a fast
    // fly-by passes through (and keeps its own place in the hash's next cell over)
    if (o && ((b.vr - o.vr) ** 2 + (b.vc - o.vc) ** 2) > 2 * this.G * (o.m + b.m) / 0.5) { merged.push(b); continue; }
    if (o) {
        // spin is born of orbit: the pair's orbital angular momentum about their centre of mass becomes the merged body's spin
        const m = o.m + b.m, mu = (o.m * b.m) / m, dr = this.dR(b.r, o.r), dc = this.dC(b.c, o.c), vr = b.vr - o.vr, vc = b.vc - o.vc;
        o.s = (o.s || 0) + (b.s || 0) + mu * (dc * vr - dr * vc);
        if (b.m > o.m) o.seed = b.seed;
        /* the gas and the stars of both go on in the merged body (stars.js) */
        o.gas = (o.gas === undefined ? o.m : o.gas) + (b.gas === undefined ? b.m : b.gas); o.zm = (o.zm || 0) + (b.zm || 0);
        if (b.pop) { o.pop = (o.pop || []).concat(b.pop); o.starsV = (o.starsV || 0) + (b.starsV || 0) + 1; }
        o.pend = (o.pend || 0) + (b.pend || 0);
        o.r = this.wrapR(o.r + dr * b.m / m); o.c = this.wrapC(o.c + dc * b.m / m); o.vr = (o.vr * o.m + b.vr * b.m) / m; o.vc = (o.vc * o.m + b.vc * b.m) / m; o.m = m;
        if (out.merges.length < 64) out.merges.push({ r: o.r, c: o.c, m });   // a star merger, for the flash
    }
    else { cell.set(key, b); merged.push(b); }
}

// public/game-v8.4/matter.js:488 findPlanets()
findPlanets(wells, out) {
    if (!wells.length) return;
    const perWell = new Map();
    for (const b of this.bodies) {
        if (b.m < this.full) continue;
        let best = null, bd = Infinity;
        for (const w of this.wellsNear(b.r, b.c, 3, wells)) { const d = Math.hypot(this.dR(b.r, w.r), this.dC(b.c, w.c)); if (d < bd) { bd = d; best = w; } }
        if (!best || bd < 2) continue;
        const E = 0.5 * (b.vr * b.vr + b.vc * b.vc) - this.G * Math.max(1, best.mass || 1) / bd;
        if (E >= 0) continue;                               // not bound
        if (!b.id) b.id = `p${this.nextId++}`;
        const k = (this.planets.get(b.id) || 0) + 1; this.planets.set(b.id, k);
        perWell.set(best.id, (perWell.get(best.id) || 0) + 1);
        if (k === 6 && !this.planetSeen.has(b.id)) {
            this.planetSeen.add(b.id);
            out.planets.push({ r: b.r, c: b.c, well: best.id, orbit: Math.round(bd), mass: Math.round(b.m), spin: +this.spinParam(b).toFixed(3), hill: +(bd * Math.cbrt(b.m / (3 * Math.max(1, best.mass || 1)))).toFixed(1), speed: +Math.hypot(b.vr, b.vc).toFixed(3) });
        }
    }
    for (const [wid, n] of perWell) if (n >= 2 && !this.systemsSeen.has(wid)) { this.systemsSeen.add(wid); out.systems.push({ well: wid, planets: n }); }
}

In the game

  • Falls. A body that falls into a well vanishes from the sky, and its mass joins the well's; swallowed matter can make the well shine as it feeds (measureFeeding(), Chapter 5). The HUD's Void line adds "· N into wells" once anything has fallen in (app.js:2155, counted at app.js:689).
  • Mergers. Each merger flashes where it happened, a warm white point growing as it fades, larger for heavier pairs, for a short while (stepFlashes() scene3d.js:1049, FLASH_LIFE scene3d.js:18). A merged body's points re-scatter for its new mass, and its stars turn in the sense of the spin the merger gave it (Part 4.11).
  • Planets and systems. A planet is announced by a find card, "A planet" (●): "Matter bound to well W · orbit N cells, M cells of matter, spin s, Hill radius h cells" (finds.js:52–53, app.js:246–247). A system is "A system" (☉): "Well W holds N planets: a system" (finds.js:54–55). The first of each in a universe is announced, later ones go into the collection quietly, and a system of five planets or more is announced again (app.js:697–705). The collection panel counts "planets", "systems" and "wells born of matter" (app.js:273). In 3D a body bound as a planet carries a blue accretion disk instead of an orange one (Part 4.11).
  • New wells. A well born of a clump would be announced as "A well is born" (◉): "A clump fell inside its own Schwarzschild radius and became a well · M cells, spin s from its mergers" (finds.js:56–57). As the section below says, in 8.4 this card does not come.

No control changes any of these.

The scale model

A body is a sample of q cells, not a star; a "planet" is a bound body of one cloud's mass, so on the scale model it stands for a bound clump, not a planet of our sky. The hash assumes fewer than 65,536 columns, true for every field (at most 1,024).

Where the game and the theory differ

  • The hoop test cannot pass at the code's light speed. Solving 2Gm/c² ≥ √(m/π) for m: m ≥ (c²/(2G))²/π. Desktop at level 6 or deeper, G_F ≈ 4.3 × 10⁻⁷, c = 128: m ≥ (16,384/(8.6 × 10⁻⁷))²/π ≈ 1.2 × 10²⁰ cells, against about 77,300 cells of matter in the whole universe. Phone (G_F ≈ 6.8 × 10⁻⁶, c = 32): m ≥ about 1.8 × 10¹⁵ cells against about 4,900. The test was written when light was one cell a flip (matter.js:477), when it could pass. In 8.4 every well born of matter comes from a dying star or a direct collapse at a site (Chapter 5 and the sites in Chapter 3, Part 3.7), never from this test, and the births code in stepMatterPost() (app.js:690–696) is unreachable in practice. The outcome agrees with BPT Part 3.14, which allows only those two ways; the code that would make a third does not run.
  • Mergers only within a cell. Two bodies merge only when they share a cell and are bound, not when they touch at their size √(m/π): merging on touch chained the whole universe into one body in one flip (matter.js:449–452). It is a resolution choice, not the physics of colliding clumps.

Fixed numbers

Number Where What it is Kind
1 matter.js:433 Extra block in the fall search METHOD
65536 matter.js:456 Cell hash stride METHOD (fields are under 65,536 wide)
2, 0.5 matter.js:460 Capture below escape speed at half a cell PHYSICS (escape speed) with METHOD distance
64 matter.js:471 Mergers reported per step for flashes CAP (drawing)
2 matter.js:479 Schwarzschild radius in the hoop test PHYSICS (BPT Part 2.4)
π matter.js:479 Size √(m/π), one quantum a cell METHOD (packing choice)
64 full matter.js:89 Planet's least mass, overwritten by CL² CAP (definition floor on a count)
2 findPlanets() matter.js:495 Nearest well at least two cells away METHOD (inside the softening)
3 findPlanets() matter.js:494 Blocks searched for a planet's well METHOD
6 findPlanets() matter.js:501 Bound steps before a planet is reported METHOD (persistence test)
2 findPlanets() matter.js:506 Planets that make a system METHOD (definition, matter.js:29)
3 findPlanets() matter.js:503 Hill radius a(m/3M)^(1/3) PHYSICS (Hill sphere)
1 circular() matter.js:113 Unused helper (no caller in 8.4) METHOD (dead code)
5 stepMatterPost() app.js:703 A system of five or more planets is announced DISPLAY