Skip to content

perf(drag): model dynamics on 7 recorded human drags - #5

Merged
wmehanna merged 1 commit into
mainfrom
perf/human-drag-dynamics
Aug 7, 2026
Merged

perf(drag): model dynamics on 7 recorded human drags#5
wmehanna merged 1 commit into
mainfrom
perf/human-drag-dynamics

Conversation

@wmehanna

@wmehanna wmehanna commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the icon-drag's guessed velocity model (symmetric smoothstep, derived from one recording) with dynamics measured from 7 real human drags, fixing the last flaky test.

What the recording showed

Captured with helpers/event-logger.swift (now committed as a repo tool):

  • Velocity is not symmetric: gentle start, a ~2.3x burst around 30-40% of the movement, then a long tapering landing where the final 15% of time covers almost no distance.
  • Path is bowed, not straight (~3.3px mean deviation from the straight line).
  • Humans pause still ~135ms at the destination before releasing.

Changes

  • Baked the measured median displacement curve as HUMAN_CURVE / humanDragCurve in both drag paths (jxa_icon_drag_body in common.sh, dragSegment in gestures.swift).
  • Path now arcs with a deterministic sin-bow (side by origin parity) instead of a straight line.
  • Added a still landing settle on the exact drop point before release — gives SpringBoard a stationary target, which is where reorder placement was slipping.
  • Committed the event recorder for future re-measurement.

Testing

  • icon-drag no-op tour: 10/10 (was ~5/6)
  • Live suite --bench 3: 42/42, icon-drag 3/3
  • Per-drag timing variance collapsed from 7.7-15.5s to 7.55-7.59s (independent consistency signal)
  • Curve verified monotonic with exact endpoints
  • bats 179/179, shellcheck clean, phone layout restored

The original icon-drag recipe used a symmetric smoothstep velocity guessed
from a single recording, and icon-drag-lift flaked ~1 in 6. Re-recorded 7
real human drags with helpers/event-logger.swift and replaced the guessed
model with the measured one:

- velocity: the median human displacement curve (gentle start, ~2.3x burst
  near 30-40%, long tapering landing) instead of a symmetric ease
- path: a deterministic sin-bow (humans arc ~3.3px off a straight line)
  instead of a perfectly straight track
- landing: a still ~135ms settle on the exact drop point before release, so
  SpringBoard has a stationary target to commit the drop to - this is where
  placement was slipping

Applied to both drag paths (jxa_icon_drag_body in common.sh, dragSegment in
gestures.swift) with the curve kept in sync. Commits the event recorder as a
repo tool for future re-measurement.

Result: icon-drag-lift 13/13 consecutive (was ~5/6); per-drag timing
variance collapsed from 7.7-15.5s to 7.55-7.59s.
@wmehanna
wmehanna merged commit bd0c65c into main Aug 7, 2026
1 check passed
@wmehanna
wmehanna deleted the perf/human-drag-dynamics branch August 7, 2026 21:04
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