Skip to content

perf: shrink Solar System textures 4.5× on the GPU and run on plain React DOM - #48

Merged
voltcrash merged 15 commits into
mainfrom
t3/edbaad42
Oct 27, 2026
Merged

voltcrash merged 15 commits into
mainfrom
t3/edbaad42

Conversation

@voltcrash

Copy link
Copy Markdown
Owner

Solar System maps shipped as JPEGs. The GPU stores a JPEG uncompressed once it's decoded, so a single 4k mosaic took ~20–35 MB of VRAM and decoding it caused hitches on phones. The site also ran React on TanStack Redact 0.2.0. Redact is pre-1.0, needed an exception to the release-age rule, and renders synchronously. It's being dropped ahead of a planned move to SolidJS.

KTX2 mosaics. All 41 colour mosaics, including the mobile variants, are re-encoded to KTX2 with full mip chains. Most use ETC1S at quality 220. Ceres uses UASTC, because ETC1S smeared its small craters. They load through the existing Basis transcoder, with an RGBA fallback for devices without native compressed-texture support. The moon textures used in the system view now also get mobile variants and mipmaps. Jupiter's GPU texture is about 4.5× smaller. Cold transfer rises on some routes, partly from the one-time decoder download; desktop Jupiter goes from 1.53 MB to 2.24 MB. ceres-topography.jpg stays a JPEG because it is height data. Encoding commands are in docs/texture-compression.md, and provenance is in THIRD_PARTY_ASSETS.md.

Plain React DOM. Redact, its catalog entry and its release-age exception are removed. Plain React adds about 171 kB to initial JS. To stay within the unchanged 450 kB budget, Vercel telemetry now loads after first paint and idle. The signal charts, the mass–radius diagram and guided tours load on demand. Initial JS goes from 295 kB to 447.5 kB (143 kB gzip), and the first-scene path is unchanged.

Proof: vp check, vp run -r test (592 tests), quality:assets, vp run -r build (JS budget passes), and the desktop browser suite (56 tests) all pass locally. Production-build Playwright captures of Earth, Jupiter, the Moon, Mercury and Ceres match before and after, with zero console errors, and the RGBA fallback path is checked too.

Not reviewed by Sol: the sol-loop review couldn't run because the Codex account hit its usage limit. I reviewed the diff myself instead.

Created with Claude Opus 5.5 and GPT 6.1 Sol in Claude Code.

🤖 Generated with Claude Code

voltcrash and others added 15 commits October 27, 2026 12:46
Solar mosaics skip mipmaps and subsystem views do not configure the local KTX2 decoder or select mobile variants. Share a loader that prepares the transcoder, keeps full mip chains, and applies the render quality profile in both views.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The colour maps need reproducible compression settings and a clear distinction from Ceres height data. Record the verified encoder release, exact conversion commands, quality comparisons, and the transfer and GPU storage tradeoffs.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The texture migration must preserve offline access to both desktop and mobile mosaics and their decoder. Verify that the existing media cache returns their binary bytes after the network disappears.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Solar colour JPEGs require uncompressed GPU storage and browser image decoding. Add full sRGB mip chains using ETC1S q220, preserve Ceres crater detail with UASTC RDO, and record the exact JPEG input hashes and preparation.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Solar destinations still point at JPEG colour maps despite the compressed assets being available. Switch planet, moon, subsystem, and constrained mobile paths to KTX2 while leaving the Ceres height map unchanged.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Keeping the old colour JPEGs duplicates the shipped asset set after routes switch to KTX2. Remove the 41 replaced files and update the source credits and output checksums while retaining Ceres height data and historical input hashes.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Asset sizes alone hide decoder overhead and the GPU storage tradeoff. Record cold route transfers, existing desktop budget overruns, measured RGB8 and ETC2 allocations, and successful RGBA fallback validation.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Analytics libraries are loaded before the first scene despite rendering no visible content. Import and mount them after paint during idle time, with a timed fallback and cancellation, while optional load failures leave the app usable.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Transit and velocity chart code is loaded for the first scene even though the Signal tab is closed. Load the chart component on demand inside its own Suspense boundary and verify the rendered world remains usable before and after opening it.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The Physics diagram is included in startup JavaScript while only the Record tab is visible. Import it when Physics opens and cover chart loading after the first world is ready.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Tour captions and navigation code are loaded even when the destination is not part of a tour. Load the tour catalog when a tour starts or a tour URL opens, then mount its controls independently of the scene.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The website uses an alternate pre-release React runtime that is no longer part of the intended stack. Remove its Vite plugin so development, production, and browser tests use react-dom, with optional features deferred to retain the existing bundle budget.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The website now uses react-dom, leaving the alternate runtime dependency and its transitive packages unused. Remove it through Vite+ and let the package manager update the dependency graph and lockfile.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The workspace catalog and release-age exception still describe a package that is no longer installed. Remove both entries and refresh installation through Vite+.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
The stack and runtime notes still describe the removed runtime. Document standard React DOM, each optional feature deferral, first-scene isolation, and measured initial sizes under the unchanged budgets.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
@voltcrash
voltcrash merged commit 3eb2204 into main Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant