1
0

Real weather, real aircraft, a heightfield off the main thread, and instruments

Three things that were built and never connected, connected.

**The weather was already there.** `observe()` has always taken a
`WeatherObservation` and `main.ts` has always passed null, so the cloud,
precipitation, visibility and marine-layer paths in atmosphere.ts had never run
outside a test. The server already shipped NWS, met.no and Open-Meteo, all
configured off. What was actually missing was that a single TERA_ORIGIN_LAT/LNG
served one metro and lied to the other — so weather and traffic are per-region
now, derived from the city's own bounds, and the Bay Area gets its fog while
Long Beach gets its own sky. The route takes ?city= or a validated ?lat=&lng=
and refuses to become an open geocoding proxy for the planet.

**The heightfield moved to a Worker.** 2.3 s of blocked main thread at boot, and
another ~950 ms of point-in-polygon on top of it: the park mask is filled in the
worker now, and block placement samples four corners and only runs the exact
test on a cell that straddles an edge — 8 buildings differ out of 185,036.
createScene is async and takes a Stage as a consequence, and there is a
main-thread fallback because "clone it and it works" has no exception clause.

**Spaces is a chunk you fetch when you reach for the door**, not one everybody
downloads. Same for the godmode tools. The entry chunk is 722 kB rather than
772; three.js is most of what is left and splitting it is a different job.

**Godmode is an instrument panel now** rather than one slider: the date and the
season, not just the hour, so the Meeus moon and the sun's seasonal arc become
visible instead of merely correct; a weather override that says on screen when
it is lying; a frame-time and draw-call readout; and a pose editor that emits a
paste-ready Chapter block, which is the thing that makes adding New York cheap.

Two blockers the review caught:

  - Every city switch leaked 8 GPU textures — one of them a 2048x2048 shadow map
    — and ~10.5 shader programs, and deleteTexture had never been called once in
    the app's lifetime. The renderer was being built per scene; it belongs to the
    canvas, for the life of the page.
  - An upstream fetch that threw rather than returning null skipped the cache
    stamp, so the TTL — the only rate limit on outbound calls — collapsed to one
    upstream request per inbound request, and the caller got a 500.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-06 03:25:31 -07:00
parent a6f6a91813
commit e41c90fe8d
39 changed files with 8482 additions and 503 deletions
+31
View File
@@ -96,3 +96,34 @@ The flight sources shipped in this repository are a simulator (original work)
and clients for open community ADS-B feeds. No commercial aviation data
provider's data is included or redistributed, and no client for a provider
whose terms prohibit such use is present.
No aircraft position is committed to this repository; the community feeds are
fetched at runtime by a deployment that has been configured to use one. Where
adsb.lol answers, the API attaches the credit line that feed asks for and the
browser displays it in the shortcuts card alongside the weather credits below.
WEATHER DATA
------------
No weather observation is committed to this repository either. The default
build observes nothing at all and models the sky locally, and the shipped
sources are all opt-in.
Two of them carry an attribution obligation, and it is met at runtime rather
than here, because which one applies is a property of the deployment and not of
the source:
- MET Norway (met.no) — CC BY 4.0
- Open-Meteo.com — CC BY 4.0
The API emits the credit line each of them asks for in the `attribution` array
on the weather body, and the browser displays whatever it is sent, for as long
as that source is what is on screen. See `server/src/weather/` for the strings
and `renderCredits` in `src/main.ts` for where they land. A deployment that
turns one of these on and strips the credit is the party in breach, not this
repository — but the plumbing to comply ships working, on purpose.
The US National Weather Service (api.weather.gov) is a United States government
work in the public domain and carries no such obligation, which is why it sends
no attribution array; claiming one would be inventing a licence term.