RFC-032 — /explore v2 context/scale-shell engine + scalable universe rendering
Status: Active (S0–S8 shipped, S9+ pending) · 2026-07 · Closes: PRD-030 · target: v2.x
Why this is an RFC. Extending /explore to the known universe binds architectural commitments that ripple through the core 3D route and must be right from slice 0 or every later slice forces a rewrite: (1) a nested-context / scale-shell coordinate model that survives ~20 orders of magnitude without float-precision death, (2) a scalable render vocabulary (instanced points + impostor billboards) governed by a device budget, (3) a warp transition system between contexts, (4) a lens layer extending the Science Lens, and (5) a data pipeline for real public catalogs with provenance. v1 (solar system) is context-0 and must not regress. UX/interaction is specified separately in UXS-014.
1 · Architecture overview
/explore route
└─ ContextGraph — ordered stack of Contexts (SolarSystem ⊂ Neighborhood ⊂ MilkyWay ⊂ LocalGroup …)
• each Context: own units + origin, own scene, own LOD/budget policy
• active context renders; neighbours pre-warm on approach
└─ Navigator — zoom within a context; warp (1–2 s cinematic) between contexts
└─ Renderers (shared vocabulary):
• PointField — THREE.Points / instanced, 1 draw call, shader-colored (spectral B−V→RGB)
• Impostors — camera-facing textured quads (galaxies, nebulae, real photos)
• BodyScenes — reuse existing Keplerian orrery for exoplanet systems
• LensLayer — curvature / time / causality / property-space overlays
└─ Catalog — streamed, tiled real data (HYG, Exoplanet Archive, Messier/OpenNGC, …) + provenance
└─ Budget — detect-gpu tier → point/impostor caps (desktop ~200k, mobile ~20k)2 · Design decisions (to lock)
| id | Decision | Rationale |
|---|---|---|
| C-A | Nested contexts, each its own coord space (not one giant world) | A single float space dies long before galaxy scale. Contexts keep every scene numerically sane; the boundary is a re-basing handoff. |
| C-B | Zoom within, warp between | Continuous zoom is the emotional reveal where reachable (to the Neighborhood); warp hides the unbridgeable gaps + broken precision AND teaches the distance. |
| C-C | One render vocabulary + device budget | Instanced points + impostors + a detect-gpu cap is the only way to scale dots on mobile+desktop and keep scaling as contexts are added. |
| C-D | Lenses extend the Science-Lens pattern | Physics (curvature/time/causality/property-space) as toggles on the same scene, not separate modes — reuse + consistency. |
| C-E | Schematic (non-to-scale) maps past the Milky Way | Galaxy distances are uncertain; a labeled schematic is honest where a fake to-scale render is not (PRD-030 principle 2). |
| C-F | v1 untouched; v2 loads lazily at the boundary | The solar-system experience + perf must not regress; universe code is a dynamic import gated on zoom-out. |
| C-G | Real star color from B−V → blackbody → RGB | Scientifically-correct color, no invented textures. |
3 · Context model
Context = { id, parent, units (m/AU/ly/pc), originTransform, enter()/leave(), renderables[], lodPolicy, budgetShare }. The ContextGraph holds the active context + pre-warms the immediate parent/child on approach so warps are instant. Crossing a boundary re-bases the camera into the neighbour's coordinate space (the Sun→dot handoff is the SolarSystem→Neighborhood boundary). Deep-links (?goto=<objectId>) resolve an object → its context path and warp there.
4 · Render vocabulary (the scalable core)
- PointField — all stars in one
THREE.Pointsdraw call; per-point attributes (position, magnitude, B−V); vertex/fragment shader sizes by magnitude + camera distance and colors by temperature. LOD = "N brightest within radius R," N from the budget. Streamed in distance shells (tiles), not all at once. - Impostors — galaxies/nebulae as camera-facing quads; for gallery objects the quad samples the real curated photo; others procedural. Cheap, scales to thousands.
- BodyScenes — exoplanet systems reuse the existing Keplerian engine verbatim (real period/a/e); bodies are proportional procedural spheres with honest "artist's impression" captions.
- Budget —
detect-gpu(already in the stack) tiers the caps; the same code path renders 200k (desktop) or 20k (mobile). This is the load-bearing scalability contract from PRD-030.
5 · Lenses (physics layer)
Each lens re-renders/overlays the active context's objects: curvature (spacetime embedding grid warped by mass, labeled analogy), time (dilation readout + light-travel-time), causality (light-cone spheres), property-space (re-project the same PointField onto physical axes — the flyable Hertzsprung-Russell diagram; exoplanet mass-vs-period). All reuse the Science-Lens toggle UX.
6 · Data pipeline
Real public catalogs → build-time normalized JSON under static/data/universe/ (mirrors existing data pipeline), validated by schema (fail-closed), provenance-tracked, i18n-overlaid like /science. Catalogs: HYG (nearby stars), NASA Exoplanet Archive (systems), Messier + OpenNGC (deep-sky), IAU constellation lines, spiral-arm model, Local Group. Curated hero sets (exoplanets, culture doors) are hand-authored overlays on the raw catalog. Everything streamed/tiled so v1 bundle weight is untouched.
7 · Slice contracts (what each slice locks)
- S0 —
ContextGraph+Contextinterface +PointFieldrenderer +Budget+ the SolarSystem↔Neighborhood boundary handoff. Ships: continuous zoom-out to the real HYG neighborhood, spectral colors, real starfield replaces the decorative one. - S1 — object selection + Panel reuse + named-star curation + constellation lines + breadcrumb +
?goto=. - S2 —
Navigatorwarp transition + BodyScene sub-context (exoplanet mini-orreries, real orbits). - S3 — /science exoplanet sections + culture-overlay pattern.
- S4 — Impostor pipeline + deep-sky catalog + gallery↔3D bridge.
- S5 — Milky Way context + schematic-map convention + Sag A* pin.
- S6 — LensLayer + gravitational-lensing shader + curvature/time lenses + black-hole objects.
- S7 — property-space projection (HR diagram) + causality lens.
- S8 — Local Group context (schematic, 33 real members, MilkyWay↔LocalGroup crossing). SHIPPED.
- S9+ — message-object trajectories (Voyager, 'Oumuamua, Arecibo signal) + narrated grand-tour. Deferred.
8 · Risks / open
- Precision at the boundary — validate the re-basing handoff feels seamless (S0 proves it).
- Mobile point budget — tune caps on real devices; graceful degradation is a first-class requirement, not an afterthought.
- Warp legibility — the transition must orient, not disorient (UXS-014 owns this; breadcrumb is mandatory).
- Data volume — tiling/streaming must keep the v1 bundle + first paint untouched (C-F).
9 · Non-goals
Per PRD-030: no billion-star Gaia render, no real-time cosmology, no AR/VR (explore-only), no fake to-scale galaxy distances, no invented exoplanet textures.