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
+14 -2
View File
@@ -1,6 +1,6 @@
{
"version": 1,
"note": "Caps are never raised. A red p95FrameIntervalMs on this box is noise before it is a finding \u2014 the GPU here never leaves 500 MHz of a possible 2,725, so a desktop cell on the vsync deadline flips between 16.8 and 33.3 ms with geometry identical to the digit; judge on maxTriangles and maxDrawCalls. The five scene names are bound to board identity in performance-budget.mjs: every scene asserts the data-board of the pressed tab, because ?city= falls back to the first board rather than failing and a bay-area cell that silently measured California would pass its cap by a factor of six. `california-one` is the merged board and its caps are RECORDED, not copied: measured 352,927 triangles / 420 draws desktop and 352,527 / 416 mobile on its first full run, set here with headroom in the same spirit as bay-area and socal. They were briefly copied from `california`, which is wrong for the reason that cell's own numbers are wrong for this board \u2014 `california` describes a state with no cities on it, and this one carries 56,327 buildings, two ports and both metros' bridges and airports. No existing cap was raised to accommodate it. Since the frustum-cull work, geometry submitted is a function of the camera: the terrain is a grid of 17 chunk meshes plus one un-chunked caster and the city is packed by district against the view frustum, so `maxDrawCalls` and `maxTriangles` are maxima over the sample window and the terrain half of the draw count is bounded at +17 by the object count rather than by a measurement. The change is directional \u2014 it can only remove geometry that was drawn before \u2014 so performance-budget.mjs's assumption that geometry is not a function of the camera path still holds in the only form it was ever relied on. No cap moved for it either.",
"note": "Caps are never raised. A red p95FrameIntervalMs on this box is noise before it is a finding \u2014 the GPU here never leaves 500 MHz of a possible 2,725, so a desktop cell on the vsync deadline flips between 16.8 and 33.3 ms with geometry identical to the digit; judge on maxTriangles and maxDrawCalls. The five scene names are bound to board identity in performance-budget.mjs: every scene asserts the data-board of the pressed tab, because ?city= falls back to the first board rather than failing and a bay-area cell that silently measured California would pass its cap by a factor of six. `california-one` is the merged board and its caps are RECORDED, not copied: measured 352,927 triangles / 420 draws desktop and 352,527 / 416 mobile on its first full run, set here with headroom in the same spirit as bay-area and socal. They were briefly copied from `california`, which is wrong for the reason that cell's own numbers are wrong for this board \u2014 `california` describes a state with no cities on it, and this one carries 56,327 buildings, two ports and both metros' bridges and airports. No existing cap was raised to accommodate it. Since the frustum-cull work, geometry submitted is a function of the camera: the terrain is a grid of 17 chunk meshes plus one un-chunked caster and the city is packed by district against the view frustum, so `maxDrawCalls` and `maxTriangles` are maxima over the sample window and the terrain half of the draw count is bounded at +17 by the object count rather than by a measurement. The change is directional \u2014 it can only remove geometry that was drawn before \u2014 so performance-budget.mjs's assumption that geometry is not a function of the camera path still holds in the only form it was ever relied on. No cap moved for it either. `california-one-basin` is the merged board over the Los Angeles basin from eleven kilometres, and it exists because that pose is the board's worst and nothing stood on it: six poses over that basin were measured over the 400,000 cap, one at 761,648, all reachable from the board's own chapters. Its caps are NOT recorded from a first run in the way bay-area and socal were \u2014 they are `california-one`'s own 400,000/460/455, deliberately, because the question this cell asks is not 'has this pose regressed' but 'is this board still inside the budget it claims'. Measured at 390,598 triangles on the run that added it, a 2.3% margin held by one constant (`LOT_BUDGET`), which is the tightest thing in this file and the reason it is now watched.",
"scenes": {
"california": {
"desktop": {
@@ -73,6 +73,18 @@
"maxDrawCalls": 455,
"maxTriangles": 400000
}
},
"california-one-basin": {
"desktop": {
"p95FrameIntervalMs": 16.7,
"maxDrawCalls": 460,
"maxTriangles": 400000
},
"mobile": {
"p95FrameIntervalMs": 33.3,
"maxDrawCalls": 455,
"maxTriangles": 400000
}
}
}
}
}