Skip to content

Add eased (non-constant) distortions for imperceptible rate changes #9

Description

@boatmeme

Summary

The engine only has ConstantTime{Dilation,Compression} — piecewise-linear slopes. A clock built from these changes rate instantly at every window boundary, which is exactly the tell the bedside-clock use case is trying to hide ("ease into the slowing so it isn't obvious"). This adds distortions whose rate varies smoothly across the window (ease-in/ease-out, Gaussian roll-off, etc.).

Motivation

  • README roadmap Use "Trusted Publishing" for NPM publish #3 ("something smoother than the ConstantTime* distortions… Gaussian roll-offs").
  • The waypoint/product framing makes the snap visible: any piecewise-constant schedule has detectable kinks at the seams.

Proposed direction

  • A new RelativeTimeDistortion subclass family overriding distortTime(numberOfMilliseconds, offset). The extension point already exists.
  • Critical invariant: distortTime must return the definite integral of the rate curve over [offset, offset + length], not a point sample — otherwise polling-frequency independence (test/Clock.invariants.test.ts) breaks, since the integrator sums arbitrary slices.
  • The curve's total over the window must still satisfy the relativeDuration vs referenceDuration contract so windows net out / hit targets as today.

Out of scope / open questions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions