MAX_CRATER_LEVELS

const MAX_CRATER_LEVELS: 14

How deep the crater ladder is allowed to go.

Fourteen halvings is a factor of 8,192 from the largest crater to the finest: on Mercury that is a 1,100 km basin down to 134 m, on Iapetus a 331 km one down to 40 m, and on Callisto 104 km down to 13 m. Four decades of diameter, which carries a body's craters from orbit to the last thing the mesh resolves before the presentational tail takes over at eight meters.

It is a cost ceiling and it sets the streaming depth, and both are worth stating. Each level is a hundred-odd cell tests and up to two hashes per surviving cell, so the band is linear in this. And surfaceDetailFloor lands two to three levels below whatever the finest crater is — a rim is about a seventh of its crater wide, so resolving one to half a meter takes samples seven times finer again — which sets how deep the quadtree refines and therefore how many patches a landing generates. A level is a quadrupling of the patches a landing fills, so this is the expensive half of the number.

The floor does not track the cap, and it does not move in one direction. Measured over 192 bodies against a cap of eleven, eight move and one of them falls: Earth 15 → 17, Proxima Centauri II 14 → 16, Mars 15 → 16, Sirius I 17 → 18, Barnard's Star b and c 16 → 17 — and Mercury 16 → 15, whose finest crater goes from a kilometer to 134 m in the same step. surfaceDetailFloor is a probe search for where the field stops paying for refinement, not a function of the ladder's depth, so a deeper ladder redistributes amplitude and can move it either way. Quote it per body or not at all.

The zoo is the exception rather than the rule: Gliese 1061 d, Gliese 1061 IV, Iapetus and Miranda all hold — Iapetus at 14 and Miranda at 12 — because the presentational tail already sets their floor below the finest rung. A cratered patch there costs 12 to 18% more — 54.2 → 62.3, 53.1 → 59.6 and 59.1 → 69.6 ms on the first three, with Miranda, which young left without a canonical population, at 24 either way. That is what the three extra rungs cost on a body whose depth they do not change, and what they buy is the ground between a kilometer and the tail's eight meters.

The ladder is canonical, so this number is in TERRAIN_ALGORITHM: it went from eleven to fourteen with version 4, and every save's landed hull sat on ground that moved with it. Deeper still is measured in the same coin — the canonical floor would admit sixteen to nineteen on the largest bodies — and spends another version.

On a body whose largest crater is small, the canonical floor ends the ladder before this does.

universe/src/sketch.ts:655