a37b784452
Profiling KNNTS041 (700 planets, 1283 primitives, 29 LOCAL fog circles) flushed three independent costs out of the toggle path: * `setVisibilityFog` rebuilt the inverse mask + 29 × 9 paint ops on every effect run, even when the input was identical. Caches a fingerprint of the circles + wrap mode and bails on a no-op call — knocks ~1 ms off every flip, more on heavier maps. * `paintLabelEntry` was split into `paintLabelLayout` (hit-area / line positions / frame geometry — runs on every content change) and `paintLabelSelection` (text fills + frame visibility — runs only when the selection identity actually flips). The incremental path now skips the 6300 redundant `Text.style.fill = ...` writes it used to perform on every `planetNames` flip, which is what forced Pixi to invalidate the underlying text textures. * `applyLabelContent` no longer blanks `nameText.text` when the toggle hides the name — it just flips `visible`. The cached text texture survives, so the next paint frame skips ~700 texture rebuilds. Also enables Pixi-side culling on every per-copy primitive / outline / label container. With 9 torus copies × ~700 planets the scene graph holds thousands of nodes, most of which sit outside the visible viewport at any moment — the cullable flag lets Pixi skip them in the per-frame traversal. The legacy `KNNTS041` probe (chromium-desktop, headless) shows `applyVisibilityState` collapsing from ~24 ms to ~5 ms after a cache-warm flip; `app.render` drops from ~46 ms to ~22 ms. Reading the toggle delay end-to-end inside the browser still measures ~460 ms in headless, which is consistent with the runner's RAF cadence — owner can confirm on the real machine where the previous ~1 s delay was reported. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>