Skip to content

fix: stabilize dense live line history - #272

Merged
brandtnewlabs merged 2 commits into
mainfrom
codex/stable-line-decimation-271
Aug 14, 2026
Merged

fix: stabilize dense live line history#272
brandtnewlabs merged 2 commits into
mainfrom
codex/stable-line-decimation-271

Conversation

@brandtnewlabs

@brandtnewlabs brandtnewlabs commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • anchor dense line min/max decimation buckets to absolute time instead of the moving viewport origin
  • anchor bounded denoising ranges to the same stable absolute-X grid
  • preserve extrema, fixed path order, and the canvas-width output bound
  • add rolling-window regressions for both raw and simplified dense paths
  • update the drawing-layer and denoising documentation plus changelog

Root cause

The dense-path bucket index was derived from time - winStart. As winStart advanced, 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
  • React Doctor — 100/100, no issues
  • agent-device on iPhone 17 Pro simulator — Line, 1m, 20 trades/sec, normal volatility, Trade stream off, Degen off; reviewed separate denoising-off and denoising-1.5 px captures frame-by-frame

@brandtnewlabs

brandtnewlabs commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

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.

  • First 8 seconds: denoising off
  • Hard cut (no toggle transition shown)
  • Final 8 seconds: denoising on at 1.5 px

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.

@brandtnewlabs brandtnewlabs changed the title fix: stabilize dense live line decimation fix: stabilize dense live line history Aug 14, 2026
@brandtnewlabs
brandtnewlabs marked this pull request as ready for review August 14, 2026 07:40
@brandtnewlabs

Copy link
Copy Markdown
Owner Author

Performance profile

Profiled the saturated 1-minute Line chart at 20 trades/second with denoising disabled and at 1.5 px. No measurable performance regression was found.

  • Process snapshots: 56.0% CPU raw vs 49.2% denoised (directional simulator data).
  • Matched 10-second native samples: 832 vs 829 main-thread samples, 778.0 MiB peak for both, and no new path-building hotspot.
  • React work: 15.3 vs 15.1 commits/second and 5.7 vs 6.1 ms render time/second; chart/path hooks did not appear in the React re-render list.

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

@brandtnewlabs
brandtnewlabs merged commit ccdc69e into main Aug 14, 2026
5 checks passed
@brandtnewlabs
brandtnewlabs deleted the codex/stable-line-decimation-271 branch August 14, 2026 15:18
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.

Dense live line reshapes historical segments during pixel decimation

1 participant