1
0

fix: the five things integration found, and a cell that stands on the worst pose

The integration analysis built the actual combination of both tracks
rather than adding up their reports, and found five defects plus one
structural gap. All six are addressed here.

**The detail normal map now follows its material into disposal.**
`Material.dispose()` frees the material and not its maps — the same
arithmetic `stage.ts` records for the renderer one level up — and
`scene.ts`'s teardown traverses geometry and material only. Every board
build was orphaning two 512-square RGBA textures on the GL context, about
2.8 MB with mips each, on a cache that retains three boards and rebuilds
on every switch. `structures.ts` already had the idiom for its road
canvases; copied rather than reinvented.

**`TerrainOptions.detail` is `surfaceDetail`.** `createTerrain` reads
`district.detail` nineteen lines below it — an unrelated flag meaning
"metro lots, revealed by stand-off" — and the two are the gates for two
different level-of-detail systems in one function, one of which decides
whether the terrain is chunked at all. The test files had both spellings
meaning both things.

**The instrument stopped lying.** `store.tier` is an index and is always
valid, because the coarse fill gives base districts an entry at every
rung; at a pose with metro detail switched off the budget scan finds the
visible base districts fit at the finest rung and sets it to 0. So
`cost-at`'s new lot column printed "40 m" for a board drawing nothing but
806 m base lots — an instrument lying in the direction of "the fine rung
is cheap", which is the direction that gets a budget spent that is not
there. `detailTier` is `null` unless a detail district is actually drawn.

**Two doc comments carried wrong numbers**, which is the defect this
repo's house style exists to prevent. Capacity is exactly 19,000, not
"about 26,000" — measured. And `LOT_BUDGET`'s guarantee is a bound on the
*city*, not on the frame: the non-city cost is not a constant and nothing
enforces it, reaching 288,365 at LA from 110 km.

**And `california-one-basin`.** `california-one` is judged at the whole
state from 1,551 km — the pose where the terrain grid saves nothing and
the city is off. Every expensive pose this product has is somewhere else,
and that was not hypothetical: six poses over the LA basin measured over
the cap, one at 761,648, all reachable from the board's own chapters for
as long as the merged board has existed. A cap nobody measures is not a
cap.

Eleven kilometres because the ladder makes the worst pose an interior
one, not the closest: 12 / 11.5 / 11 / 10.5 / 10 / 7.7 km reads
340,328 / 390,598 / 390,578 / 390,578 / 387,428 / 375,172. A cell at
2.5 km or at 7.7 km would have watched the wrong thing. Its caps are
`california-one`'s own rather than recorded from this run, because the
question is not "has this pose regressed" but "is this board still inside
the budget it claims".
This commit is contained in:
2026-08-24 21:09:14 -07:00
parent 819a2467fa
commit cf8e928599
6 changed files with 147 additions and 18 deletions
+49
View File
@@ -138,6 +138,55 @@ const SCENES = {
document.querySelector("#chapters .chapter[data-view='california-overview']") !== null &&
document.getElementById("sea-section") !== null,
},
/**
* The merged board over the Los Angeles basin, from eleven kilometres.
*
* **This cell exists because that pose is the board's worst and nothing stood
* on it.** `california-one` above is judged at `california-overview`, which is
* the whole state from 1,551 km — the pose where the terrain grid saves
* nothing and the city is switched off. Every expensive pose this product has
* is somewhere else, and the consequence was not hypothetical: six poses over
* the LA basin were measured over the 400,000 cap, one of them at 761,648, and
* every one of them had been reachable from the board's own chapters for as
* long as the merged board has existed. A cap nobody measures is not a cap.
*
* Eleven kilometres and not seven or two, because the ladder in `blocks.ts`
* makes the worst pose an interior one rather than the closest one: swept at
* 12 / 11.5 / 11 / 10.5 / 10 / 7.7 km the board reads 340,328 / 390,598 /
* 390,578 / 390,578 / 387,428 / 375,172. The peak sits where the rung has just
* gone fine enough to cost but the basin is still wholly in frame. Closer is
* cheaper, further is cheaper, and a cell at either would have watched the
* wrong thing.
*
* The pose is planted through `__teraCamera.seek`, which takes true metres, so
* this reads the same whatever a board's scale is. That is a deliberate
* departure from every other cell here — they aim by clicking a chapter, which
* is the control a reader also uses — and the reason is that no chapter points
* here. The alternative was to author one, which would put a rung on the
* ladder for a pose whose only purpose is to be expensive.
*/
"california-one-basin": {
host: "tera.lumbridgecorp.com",
query: "?city=california&one=1&handover=0",
signature: "california-overview",
ready: () =>
document.getElementById("boot")?.hidden === true &&
document.querySelector("#chapters .chapter[data-view='california-overview']") !== null,
activate: () => {
const camera = globalThis.__teraCamera;
if (camera === undefined || typeof camera.seek !== "function") {
throw new Error("no __teraCamera hook on this build — the basin cell cannot aim");
}
if (camera.board !== "california") {
throw new Error(`the basin cell landed on "${camera.board}", not the merged board`);
}
camera.seek({ lat: 34.05, lng: -118.24, standoffM: 11_000 });
},
// The lot ladder settling is what this cell measures, so it must not sample
// until it has: `updateBlocksDetail` runs off the frame loop and a frame
// taken on arrival is a frame of the pose the camera left.
active: () => (globalThis.__teraCamera?.lots?.()?.packed ?? 0) > 0,
},
socal: {
host: "tera.lumbridgecorp.com",
query: "?city=socal&handover=0",