feat: v0.3.7 — idle drift cruise (ambient field baseline) - #59
Open
Jess Sullivan (Jesssullivan) wants to merge 1 commit into
Open
feat: v0.3.7 — idle drift cruise (ambient field baseline)#59Jess Sullivan (Jesssullivan) wants to merge 1 commit into
Jess Sullivan (Jesssullivan) wants to merge 1 commit into
Conversation
…matches engine catch-up cap Wire each blob's driftAngle/driftSpeed — initialized since the pre-Phase-A baseline but never read by the loop — into updateScreensaverPhysics as a per-substep steering toward a gentle cruise velocity. With no pointer, scroll, or device-motion input the only idle motion was a zero-mean jitter random walk erased by the *=0.992 damping in ~1.4s; blobs jiggled near their territory instead of drifting. The settled cruise delivers the 'idle blobs drift' baseline of docs/physics-feel-contract.md on every environment with no permission grant or sensor, while pointer/scroll/ gravity fields still bias motion on top exactly as before and prefers-reduced-motion still freezes the frame entirely. Also raise TinyVectors' rAF frame-delta clamp from 0.033s to 8/60s to match BlobPhysics.tick()'s own catch-up ceiling: the old clamp pre-empted the 0.3.6 fixed-timestep accumulator and dilated simulated time ~3x at 11fps (software raster / heavy blur scenes). Seeded sims: idle mean net displacement 4.3-5.0 -> 16.4-25.5 units/12s, speeds bounded near 0.15 units/substep over 300s. Headed-Chrome A/B probe: idle net/path coherence 0.5-0.64 -> 0.72-0.81 at 60fps; reducedMotion 'reduce' context still renders a fully frozen frame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
driftAngle/driftSpeedhave been initialized per blob since the pre-Phase-A baseline but were never read by the physics loop — dead code. With no pointer, scroll, or device-motion input, idle motion was only a zero-mean jitter random walk (territorial jitter, neutral drift, brownian, escape kicks) that the per-substep*= 0.992damping erases with a ~1.4s half-life: blobs jiggled near their territory instead of drifting. The only sustained forcing was gravity fromdevicemotion, which desktops never emit. Separately, the component rAF clamp of0.033s pre-empted the 0.3.6 fixed-timestep accumulator: sustained rendering below 30fps dilated simulated time proportionally (~3x slower at 11fps).Fix
updateScreensaverPhysicsnow steers each blob's velocity toward its owndriftAngleheading atdriftSpeed * DRIFT_CRUISE_SPEED_SCALEevery substep (DRIFT_CRUISE_STEERING = 0.05, scale3). The settled cruise (~1.5-3.9 units/s in the -40..140 physics space) is the "idle blobs drift" / "ambient field: always on" baseline ofdocs/physics-feel-contract.md; the existing ~8s re-heading roll and wall-bounce re-randomization keep paths wandering, and pointer/scroll/gravity fields still bias motion on top exactly as before.0.033->8/60to matchBlobPhysics.tick()'s own catch-up ceiling (8 substeps of 1/60s); sustained rendering down to ~7.5fps now keeps real-time motion speed, tab-resume jumps still bounded by the engine substep cap.How verified
tests/unit/blob-physics-idle-drift.test.ts(seeded xorshift32, same pattern as the timestep test): idle mean net displacement rises from ~4.3-5.0 to ~16.4-25.5 units over 12 simulated seconds vs adriftSpeed-zeroed baseline; speeds and positions stay bounded. Full suite: 214 passed.check:release-metadata,svelte-check(0 errors),build,check:packagelint, bundle size 11.79 KiB gzip (12 KiB gate; +0.06 over 0.3.6).Reduced motion
prefers-reduced-motion: reducebehavior is untouched: the component still renders the static frame and never starts the rAF loop. Headed-Chrome probe with areducedMotion: 'reduce'context confirms 0 of 15 paths move.