fix: stabilize dense live line history - #272
Conversation
Agent-device validation video (corrected)▶ Watch/download the corrected 16-second iPhone 17 Pro capture Recorded from the fresh Metro bundle after the dense 1-minute window had saturated at 20 trades/sec, with normal volatility, Trade stream off, and Degen off.
The axis scale remains unchanged within each segment. Retained interior peaks and valleys translate without reshaping; only the live edge receives new geometry. This replaces the earlier clip that still exposed the moving simplifier-range bug. |
Performance profileProfiled the saturated 1-minute Line chart at 20 trades/second with denoising disabled and at
Agent-device does not expose Apple frame-health metrics for a simulator, so this does not claim FPS or dropped-frame numbers; that requires a connected physical iOS device. Full profile report · Native samples: raw / denoised · React profiles: raw / denoised |
Summary
Root cause
The dense-path bucket index was derived from
time - winStart. AswinStartadvanced, historical samples repeatedly crossed pixel-column boundaries, changing each bucket's selected min/max representatives. After fixing that, the optional RDP simplifier still partitioned its input by the first visible point's array index, so its range endpoints shifted whenever a point left the window. Both stages could therefore select different historical vertices.Decimation buckets now remain fixed in absolute time, and simplification ranges remain fixed on an absolute screen-pixel grid while the time window and layout are unchanged. Fully visible history translates left intact; only boundary ranges change.
Closes #271.
Validation
npm run verify— 102 suites passed; 1,574 tests passed, 5 skipped