Koi Motion Lib Consolidation and Frame-Death Recovery - #146
Merged
Conversation
…n the brain's per-frame terms
… its residue record
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 5b134b4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
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.
Description
Lands the first two phases of the koi pond instance-model plan family (
roadmap/showcase/16-koi-pond).Phase 1 consolidates the roughly 78 percent of each fish app that was duplicated code into
demo-koi-lib: a configurable steering brain, a shared runtime and renderer seam, the wire plumbing, the three.js stage, the identity-card anchor, and one copy of the fish chrome stylesheet. The koi inner contract moves to 0.8.0 to carry the shapes the instance model needs (identity.instance,pause.resting, and a predictedpathon the outline).Phase 2 ships the self-contained robustness fixes behind it. The features SDK gains a synchronous
hostedsignal so a feature opened directly can stop waiting on a host that will never answer, and page visibility is now reconciled rather than trusted: a missedvisibilitychangeedge used to park the watchdog atunobservablefor the rest of the session. The same reconciliation lands in the pond host, alongside a device-pixel-ratio cap on every host-painted canvas, a device-tier shoal ceiling, and a gallery-side resurrection policy that heals a demo embed whose frame the browser killed instead of leaving the crash tile mounted.Fish-app migration onto the consolidated lib, the dynamic shoal, and the overlay grammar are phases 3 to 5 and are not in this PR.
Type of Change
🐛 Bug fix | ✨ Feature | 📝 Docs | ♻️ Refactor | ⚡ Performance
Changes Made
lib/src/motion): a configurable per-frame integrator with turn tiers chosen by obstacle proximity, flank selection read from the obstacle field, slowdown proportional to manoeuvre magnitude, and predicted advancement capped at 20 path points.lib/src/runtime): one runtime every fish app drives, a renderer factory boundary, and a browsing-context reader;contract/wire.tsbinds the contract to a runtime from a single place.koi-stage, thecard-anchorclamp that parks every identity card, andstyles/fish.cssexported as./fish.csswith a build step and a pack-time export-target check intools/refresh-lib.mjs.describePondForFramelets a frame be the whole world,koiVariantSeedseeds duplicates without re-rolling their species, andencounterClearancereports the clearance a pair of koi keeps.identity.instance, arestinghold onpause, and the committed path onoutline; vendored lib tarball repacked.@hyperfrontend/features0.8.0:hostedon the feature handle, and a sharedwatchPageVisibility(announcement as fast path, coarse poll plus a hidden-only probe frame behind it) now backing both the host and hostee visibility paths.visibilitychangelistener,canvasPixelRatiocapping every host-painted canvas at two device pixels, andreadDeviceProfileclassifying capability signals into a shoal ceiling of 4 / 8 / 12.createEmbedResurrectionheals a killed demo embed with graced verdicts, backoff, an attempt cap, a stability window that restores the budget, and no reopen into a hidden page.Testing
Unit and browser suites added alongside every new module: the motion brain (including golden-trace and trajectory harnesses), manoeuvre selection, flight prediction, the koi runtime, browsing context, the three.js stage, wire binding, contract shape, virtual pond, card anchor, and traits in
demo-koi-lib; device tier, pixel ratio, visibility, and the updated resurrection specs in the pond host; embed resurrection in docs-site; and page-visibility, lifecycle, frozen-lifecycle, andhostedbrowser specs in@hyperfrontend/features.Device acceptance on physical hardware (the S24 Ultra frame-death case that motivated the phase 2 fixes) is tracked as a phase 5 work item and is not covered here.
Checklist
npm run commitfor conventional commit messagesAI Assistance
Claude was used to generate code changes under supervision.
Additional Notes
@hyperfrontend/featuresis released at 0.8.0 in this PR;hostedis additive onFeatureHandle, so anything implementing that interface directly (rather than consuming a handle) needs the new member.demo-koi-libtarball is repacked here so the new exports are available to them.📝 CLA Requirement
By submitting this pull request, you acknowledge that:
For more information, see our Contributing Guide.
Thank you for contributing to hyperfrontend! 🚀