Skip to content

fix: prevent periodic stalls in rolling waveform projections - #4

Merged
cuimmm merged 4 commits into
mainfrom
fix/monitor-projection-stall-20261112
Nov 12, 2026
Merged

cuimmm merged 4 commits into
mainfrom
fix/monitor-projection-stall-20261112

Conversation

@KyleHuangFromHZ

Copy link
Copy Markdown
Collaborator

Summary

A 192 kHz waveform retaining 60 seconds eventually projects distinct X samples to the same Float32 coordinate. The rolling display cache then falls back to all 11.52 million samples per channel, causing repeated half-second renderer stalls.

 on projected X order collapse
-  clear summaries and render all raw samples
+  move the projection origin to the visible window center
+  retain min/max summaries and rebuild display selections/coordinates
+  retry once, retaining the strict-order fallback if recovery fails

Add a projection-rebase work counter, regression coverage for repeated rolling-window drift, and consistent package/runtime/gallery version 1.0.1-opentest.30. This branch includes the latest main changes.

Evidence

  • Before: the 192 kHz / 60-second regression failed on its first rolling update with display cache must not fall back to all 11520000 raw samples.
    After: repeated precision crossings keep display reduction and existing summaries; page and certified-arena tests preserve peaks, NaN gaps and subsequent incremental updates. Irrecoverable spacing still falls back after one attempt.

  • Latest merged tree: typecheck and build passed; 1,221 source tests passed, 2 skipped; 31 OpenTest contracts passed.

  • Actual Windows/Electron Monitor, two channels, full 60-second retention, 2560×1392 viewport and DPR 1.5:

    Metric Before, 35 seconds After, 80 seconds
    Full-geometry fallbacks 12 0
    Main-thread tasks ≥100 ms 24 0
    Maximum frame gap 733.3 ms 66.7 ms
    p99 frame gap 283.3 ms 17.3 ms

    Each observed rebase scanned only 9,600 new samples and projected about 22,500 display samples. Both channels continued receiving data. A separate native-window capture contained one 116 ms display reselection without a raw-geometry fallback; this change does not promise every frame fits 16.7 ms.

  • Host integration: 59 targeted waveform tests and 8 artifact checks passed. The existing host browser-smoke fixture references a missing calibration component and could not initialize; actual Windows validation above completed independently.

Merge Danger

Door: two-way

No persisted-data migration. Raw samples and strict projected-order validation are retained; a consumer can revert its pinned artifact.

Blast Radius: rendering

Affects the display-cache recovery path used by paged/arena line rendering. Rebase frames replace display/GPU/ledger caches while preserving source summaries.

@cuimmm
cuimmm merged commit c2ecea0 into main Nov 12, 2026
6 checks passed
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.

2 participants