Repository navigation
Address structural rendering, loading, and ephemeris weaknesses - #135
Protonmatter merged 19 commits into
Conversation
Protonmatter
left a comment
There was a problem hiding this comment.
Review of f66dc19
Summary: this is a substantial improvement, and the ephemeris math checks out. CI is red for one fixable reason, and a local build shows one user-visible regression (JPEG reference images rejected; inline comment on referenceImageLoader.js). I'd keep it as a draft until both are fixed.
How this was reviewed: I built the PR head locally (build_wasm.py + build_web.py) and loaded it in headless Chromium with software WebGL at 1440×900. I compared it against the same build of 02aaec8 and read the diff by area. Frame-time numbers come from software GL and are not reported.
Blocking (not on changed lines, so here)
1. CI: tools/browser_smoke.py was not updated for moon demand loading.
- Cause:
enterOrreryInnernow callssyncCatalogueDemand(true), and on the default Sun overview no moon parent reaches 32 px, somoonelements.jsnever loads.MOON_READINESS_JS(lines 32-36, 95-120) still requires all 21 moons to have elements. - Effect: readiness times out at 45 s with
data-smoke-moon-knots="0". JavaScript coverage fails inbrowser_smoke.py, and Release gate then fails withmissing/ambiguous/oversized coverage report: combined/coverage-summary.json. - Minimal fix: after the lifecycle loop, select a satellite system through the real control. Loaded elements persist in the shared
MOONS, so later phases still work:
const a=document.getElementById("orreryAnchor"); a.value="Saturn"; a.dispatchEvent(new Event("change",{bubbles:true})); - Optional: fail fast on
state.catalogueStatus?.moons==="failed"rather than waiting out 45 s.
2. CI, hidden behind item 1: smoke phases assume a synchronous paint().
- Cause: the alias and reset phases (
browser_smoke.py:223-246) reado.moonsAliasedCountand the accuracy text immediately after dispatchinginput.paint()now only queues a frame (orrery.js:1979). - Effect: once item 1 is fixed, these phases will see stale values.
- Fix: await one animation frame (or poll), or expose a test-only draw-now hook.
3. JPEG reference images are rejected. See the inline comment on referenceImageLoader.js.
Should fix before merge
Inline comments on:
renderQuality.js: the tier controller oscillates, and can stay degraded forever.orrery.js:3664: hover invalidates frames.labelLayout.js: the selected body can lose its label.
Needs a decision
Inline comment on ephemeris-snapshot-v3.schema.json: additive fields under the same v3 identifier.
Minor
Inline comments on:
labelPresenter.js: per-frame layout reads remain.orrery.js:3745: smaller touch targets.sky.js: twilight hit targets and daytime star trajectories.bundle_web.mjs: source-map URLs.wasm_provenance.py: receipt profile.
PR description: it calls the rotation coefficients "spectroscopic/Doppler-like". The code and structural-science-dispositions.md correctly say Doppler-feature tracking, explicitly not the spectroscopic fit.
Verified correct
-
Phase reuse: bit-identical. A per-call
Vecis built from that call's ownt, nothing is reused across epochs or bodies, and the only shared state is a read-onlyOnceLock.cargo test -p solar-ephemeris --release --lockedpasses (89 lib + 4). -
Speed constant: now
AU_KM/(365.25*86400)= 4.7404705; 4.74057 is gone from Rust, JS and Python. -
Future dates: UT1 is now modeled past the EOP end with null uncertainty, so this is a real fix for Earth rotation. TT still holds UTC+69.184 s, which is now a declared assumption.
-
Rotation attribution: comment-only change; the numbers are unchanged and consistent across Rust, JS, Python and
MATH.md. -
Independent evidence: against Horizons DE441 with manifest and response hashes. Validation fails closed; 141/160 pass, and
--require-all-passexits 1. -
wasm-releaseprofile: inheritsreleasewithpanic=abort, andbuild_wasm.pyuses it consistently. -
Server dates: unsupported dates fail before coordinator, cache or upstream work.
-
Frame scheduler: one pending frame, re-arm on invalidate-during-draw, generation guards, and no draw after leave, hide or context loss.
-
Texture lifetime: bitmaps are closed on every abort, fail and cancel path, with at most one upload per frame.
-
WASM broker: a compiled module is shared while each worker has its own instance and memory; rejected compiles are evicted, so Retry works.
-
Bundling:
- Deterministic: two runs were byte-identical with no absolute paths.
- Pinned: esbuild 0.28.2 with sha512 integrity.
- No duplicated modules: the four previously double-loaded ones (
orreryMath,orreryShaders,orreryTime,visualAssets) each now compile into exactly one chunk.
-
Sky: constellations are precessed with the engine's J2000-to-true-equator matrix, applied once. Daytime stars now fade out while the accessible list keeps them.
-
Measured against 02aaec8:
02aaec8 f66dc19 Solar System open: requests 108 44 Solar System open: transfer 8.4 MB 4.0 MB Stray top-left labels yes gone Saturn focus now frames the planet.
Not addressed (noting only)
- East-on-right compass convention (kept by design).
- Geometric dome versus refracted rise/set (now disclosed).
- The 96 MB
sol-source.tar.gzinside the site. - The 200 ms visible-response target (the PR states this).
Generated by Claude Code
Moon orbital elements now load only when a satellite system is viewed, so the smoke's readiness wait never saw loaded knots on the Sun overview and timed out after 45 s. Request them through the real Focus control (Saturn) before waiting, and fail at once if the moon catalogue reports failure. paint() now queues a frame instead of drawing synchronously. The alias and reset phases read renderer state in the same task as their input, so they saw the previous frame. Each phase now checks only after the first rendered frame that follows its input, using the exported frame timings.
The new reference loader read only a PNG IHDR, so the three JPEG reference assets (Earth land, Earth night lights, Moon) always failed with a source grid mismatch and fell back to the simplified surface. Read the grid from a PNG IHDR or a JPEG frame header, require the container to match the pinned file extension, and decode with the matching media type. Tests check every pinned reference asset against its declared grid, a JPEG decode path, and container/extension/truncation drift.
This change moved the Earth reference-layer note from the stage caption (#destinationCaveat) into the About this view disclosure (#destinationReferenceNote). The caption layout regression still required 'Reference layers:' in the caveat text and failed browser validation. Require the caveat warnings in the caption and the reference note in its new element, and report both texts on failure.
The accuracy line's epoch prefix changes every animated frame. With proportional digits and the slightly larger font in this change, some timestamps fit one fewer wrapped line, so the line's height toggled between frames and browser validation's 1 d/s reflow check failed. Use tabular digits, as the selected-epoch label already does.
Focus selection now inspects a planet at physical relative radii and moon offsets (systemDisplayPolicy.js), but the moon-shadow plan still modeled the enlarged overview: a 0.170 AU Jupiter display radius and systemScale() moon spacing. Its camera was hundreds of times too far out, and it read label anchors in the same task as its repaint, which now only queues a frame, so it saw the previous frame's labels. Use the physical equatorial radius, true moon offsets and physical moon radii, require body inspection explicitly, and read anchors after the queued frame renders. The jupiter-io-transit and control frames pass locally with their existing pixel gates and the half-pixel label residual. The Io eclipse pair still assumes the enlarged moon orbit and is reframed separately.
At physical scale Io orbits 5.9 Jupiter radii out, so the old polar view of Jupiter could keep Io on the canvas only about a pixel wide, below the eclipse gate's 3 px marker floor. Focus Io itself through the real Focus control and view it from the Sun's side: Io's fully lit disc spans half the canvas half-height, stays centred in both frames, and Jupiter lies behind the camera, leaving a black sky. The frame planner rejects any frame in which Jupiter reaches the canvas. With only Io's label on screen, the eclipse assertion now also measures the sunlit disc from pixels and requires its centre within 1 px and its radius within max(1 px, 1%) of the exact perspective silhouette tan(asin(R/d)), which independently checks the camera distance and field of view. The brightness-ratio gate is unchanged. Local Chromium run: eclipse ratio 0.2790 against the shipped 0.2784; lit disc 155.98 px against 155.90 px predicted, centre error 0.21 px; transit umbra 0.0504 against 0.0505 predicted.
The probe focused Earth and then fixed the camera at 0.5 AU, which suited the enlarged Earth. Focus inspection now draws Earth at physical scale, so from 0.5 AU it is about 0.07 px wide, below the 8 px at which the Earth look is demanded; the probe's 30 s readiness wait timed out. Place the whole disc at 30% of the canvas half-height instead, inside assertBlueEarth's central sample. Locally the probe then passes with 2,793 blue pixels against a minimum of 141, and the full browser validation completes.
Auto quality retried the higher tier every 6 s on a device that could not sustain it: a simulated 34 ms-at-High GPU changed tier 35 times in two minutes, and each change resizes the drawing buffer. An upgrade reversed within 15 s now doubles the wait before the next attempt (capped at five minutes); returning to Auto resets it. The same simulation changes tier 9 times, at growing intervals. Upgrades also required continuous animation, so a paused scene lowered during slow dragging never recovered. Fast input-driven frames now count as headroom; idle observations still cannot certify recovery.
Every pointermove over the canvas scheduled a full scene frame before checking for a tracked drag, so hovering kept a paused scene rendering at display rate. Invalidate only for a tracked drag or pinch. Body and moon hit radii dropped to 12 px in this change, which makes small inner planets hard to tap. Touch now keeps a 22 px radius (a ~44 px target); mouse and pen stay at 12 px.
The selected body is laid out first, so crowding cannot remove its label, but near a canvas corner all four adjacent positions cross an edge and its name disappeared. For the selection only, nudge an adjacent box back inside the canvas while it stays within 16 px of its target. Unselected names keep the existing rule and are suppressed rather than detached.
Every frame rewrote each label's display, size and projection data and then read the jump bar's and host's bounds, so a steady frame dirtied layout and forced it again. Write styles and data only when they change, show a label for measurement only when its metrics are missing, and measure the jump-bar overlap once per viewport and visibility state. A repeated frame with unchanged labels now performs no style writes and no layout reads.
Stars fade out between Sun altitudes of -18 and 0 degrees but stayed hover and click targets until fully transparent, and a selected star's path was drawn at full strength in daylight with no visible star. Stars below 25% opacity are no longer hit targets, and a star's path shares its daylight fade. The accessible list still offers every star.
Historical release-profile receipts must stay readable for archived evidence, but validate_receipt also accepted one for the current source tree, which tools/build_wasm.py only ever builds with wasm-release. Reject a non-browser profile there with a rebuild message; read_receipt is unchanged.
After focusing Earth and zooming in, physical-scale inspection fills the whole canvas with Earth. On CI's software GPU the surface and atmosphere passes then cost about 1.1 s per frame (frames every ~2.3 s), so the spin probe saw 2 Earth draws in its unchanged 5 s window and failed on two runs. The spin gates read submitted model and normal uniforms, not pixels, so put the Earth disc at 30% of the canvas half-height first. That shades about 17x fewer pixels and keeps the disc above the 64 px scattering threshold. The 5 s window and the spin contract are unchanged. Locally the probe records 4 draws in 1.5 s and the full browser validation completes.
Every public QA facade re-exported from the single _diagnostics.js aggregate, so importing one (for example js/orreryShaders.js) loaded every diagnostic module's chunk, including dom.js, which reads the page at import. The Node-side validation steps import such facades from the release and failed with 'document is not defined'. Keep the aggregate and its request-count benefit for the application, but resolve each facade alias to the chunk that owns its binding and re-export from there, falling back to the aggregate only for bindings defined in it. Live bindings still come from the single compiled owner. In the current build the shader, mapping, atmosphere, solar and terrain facades now load a seven-chunk closure that does not reach the DOM chunk. This depends on esbuild placing page modules in separate chunks, which holds for the current module graph rather than as a general guarantee.
This change added fields to ephemeris-snapshot.v3 without a version change: the root star_frame, catalogue RA/Dec on stars, the future_nominal_utc and modeled_future states, and a nullable DUT1 uncertainty. The v3 schema forbids additional properties, so strict readers of the published v3 contract rejected every new snapshot. Repository requirement SOL-CONTRACT-001 requires a contract change to be versioned in the same pull request. - docs/ephemeris-snapshot-v4.schema.json carries the widened contract; the v3 schema is restored to its published content for archived copies. - The Rust engine, CLI, JPL server and web readers emit and accept v4. The server answers /v4/sky; /v3/sky, /v2/sky and /v1/sky return 409 with an upgrade explanation. Invalid cached entries are already rebuilt. - validate_ephemeris_snapshot.py validates live v4 and adds --historical-v3. - The service worker and release transition sets admit v4. - Tests use a new v4 corpus. The provenance-hashed clock-boundary fixture and the inventoried v3 corpus stay byte-identical as v3 evidence; tests that need a live document upgrade a copy in memory. - Independent evidence is regenerated offline: all 160 records are identical, and only the lib.rs and sky.rs source hashes changed. - The crate version stays 0.2.0 until the release that publishes it.
planet_appearance_validation.mjs evaluates the renderer's makeTexture source in isolation with only gl in scope. makeTexture now reads the per-context texture limit that initGL records from MAX_TEXTURE_SIZE, so the isolated function threw 'textureLimits is not defined' before any check. Supply the same per-context limit. Locally: 110/110 checks pass. planet_phenomena_validation.mjs served only planetPhenomena.js and its manifest module. In the bundled release that module re-exports from shared chunks, which returned 404, so the gallery import failed. Serve each gallery module's static import closure, every file still bound to the release manifest hash. Locally: 8/8 checks pass on the release and the source tree.
The surviving-finger touchmove in the touch probe is non-blocking and is dispatched with the next main frame. On slow software-GL runners the frames queued by the preceding pinch took more than 5 s to draw, so the 5 s wait timed SwiftShader backlog rather than input delivery (the move did arrive and rotated the camera by the expected 20 px). Draining two frames before sending the move keeps the 5 s bound on delivery itself. The Python coverage job ran 9:04 in CI and exceeded its 10 minute limit in the Coverage workflow just after reporting 90.7%. Raise the job timeout to 20 minutes; the 90% threshold is unchanged.
2d26c8e
into
precision/verified-readiness-20261109
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Close leftover #135 review findings, three baseline review findings, and record the precision work
Outcome
Remediates the structural review findings across rendering, scientific semantics, resource loading and release integrity. Labels stay attached to visible targets, body and satellite-system framing share one policy, and deferred frames/recovery have an explicit lifecycle owner. Catalogue loading, WASM compilation and texture resources are bounded. Exact per-evaluation phase reuse reduces the measured raw-position p95 from 45.3 ms to 8.8 ms under the unchanged 16 ms gate.
This PR targets
precision/verified-readiness-20261109at02aaec8to isolate this remediation from the three preceding baseline commits. It remains a draft because interaction, numerical and coverage qualification described below are still open.Specification and traceability
docs/rfcs/0002-correctness-delivery-and-experience.md.docs/superpowers/plans/2026-11-10-structural-completion.md.docs/structural-remediation.md; scientific dispositions:docs/structural-science-dispositions.md.Correctness and risk
wasm-releaseprofile preserves browser abort behavior while native builds unwind.UI and UX
Validation evidence
Local validation:
build/site-structural-final10, manifest SHA-256183befe0b2fbaa0f6ed87f73d385f43a8abeaa6d66578f0931a3ff360b7451b1. This is local validation over the baseline with working changes, not an artifact built by CI from this new commit.Remaining qualification:
Documentation
Committed-diff review
Fresh independent code review of
02aaec8…f66dc19found no actionable critical/important defects or merge-blocking code regressions in the reviewed scope. It covered scheduling/recovery, camera/picking, catalogue/texture ownership, WASM preparation/cancellation, Sky contracts, Rust phase reuse and bundling/provenance. An independent focused rerun passed 89/89 tests. The remote head and all 182 changed paths match the local commit.At the latest check, Docs, governance, Rust lint, moon-image evidence, cross-OS determinism and the immutable web artifact build passed. Main CI and Coverage workflows are still running; no failed job was reported at that check. See the live PR checks for subsequent results. This review does not close the qualification limits above.