0. Fable fork: three layers, and which one to trust
- JS (HUD lines 1 and 2): rAF cadence, dispatch lag, commit time. It cannot see anything that happens after the frame is handed over. On the M5 with the Dell attached, 22 frames a second never reached the screen while rAF intervals stayed between 6.4 and 10.3 ms.
- Screen check (HUD line 3,
SCREEN): a recorder outside the browser (node tools/frame-truth/live.mjs, ScreenCaptureKit) reads the code strip above the VSYNC pad from every refresh of the display and tells this page, live, each time the cadence broke. SKIP = refreshes where a frame was held or jumped over, lost = page frames that never appeared, SHOWN STREAK = time since the last one. This is the only layer that sees what the window server showed.
- Why not from inside the page: the first version shared the screen with
getDisplayMedia and read the strip itself. Checked against the recorder it reported 137 skips where 5 happened: Chrome's screen capture delivers only about 95 to 107 of the 120 frames a second, and a frame the capture missed looks exactly like a frame the display skipped.
- Pres probe (optional,
PRES): Chrome's own per-frame estimate of the display slot (presentationTime of a 6 px element repainted each frame). On macOS it is computed from a fixed 1.5 ms latch margin, not from the display: in the recorded runs it missed 450 of 450 real skips in one and reported 104 phantom ones in another. Use it for the latency slot (lat), not as proof.
- For any other page:
node tools/frame-truth/measure.mjs --url … --inject adds the strip, records and prints the counts. Details and numbers in the shown-frames report.
1. What a clean 120 Hz lock looks like
- 120 Scrolling Items (
000–119): All four rows glide smoothly with crisp white leading edges, visibly twice as fluid as the orange-edged 60Hz REF lane underneath.
VSYNC Cyan/Red Color Flip: Alternating #00ffff and #ff0000 blends into calm #bababa neutral gray at locked 120 Hz; any dropped or repeated frame flashes vivid Cyan or Red.
- HUD & Scope: Status reads JS 120 HZ (or JS 60 HZ when
60 Hz: ON), DROP 0, MICRO 0, SEEN 0, JS STREAK climbs without resetting (macOS Chrome CVDisplayLink normally shows benign 0.5–1.0 ms JIT wiggles even at locked 120 Hz scanout), eo 0.00ms, cyan ph dots sit flat on 0 ph, and LAG+JS bars stay under the 5.5ms amber margin and 8.33ms red deadline.
2. Visual Flip vs. JS Sync Lamp
| Visual Flip Pad |
JS Sync Lamp |
Meaning |
| Flat neutral gray |
JS CLEAN |
End-to-end 120 Hz sync. JS, GPU, compositor, and display scanout are locked 1:1. |
| Cyan or Red flash |
JS DROP / JS MICRO |
JS / rAF scheduling jitter or overrun. At default Sens 1.2ms, callback arrived late (> ±1.20 ms), spiked dispatch lag (> 0.60 ms above floor), slipped > 0.98 ms from VSYNC, drifted over 2 frames (> 1.32 ms), or stalled in commit. |
| Cyan or Red flash |
JS CLEAN |
Downstream compositor / GPU / WindowServer drop. JS hit every 8.33 ms tick & commit, but a frame was dropped below JS. Turn on Screen check to count these: the lamp then flashes SCREEN SKIP. |
| 30 Hz Cyan/Red strobe |
60 HZ CAP |
Locked to 60 Hz. On iPadOS Chrome (CriOS), try COOP Flip. |
3. Reading every metric & trace
rDt med/p95 & Sens: Target 8.33 ms. Default Sens 1.2ms sits just above normal macOS CVDisplayLink early/return wiggles (0.5–1.0 ms) while catching single-frame swings (> 1.20 ms), 2-frame drift (> 1.32 ms), OLS phase slips (> 0.98 ms), dispatch-lag spikes (lagDev > 0.60 ms above 30th-pct floor, calibrated to macOS WindowServer’s scanout cutoff), perfNow jumps (> 1.50 ms), and overrun/commit stalls. Switch Sens between 0.5ms (strict sub-ms), 1.0ms (tight), 1.2ms (default), and 1.65ms (lenient); JS STREAK resets to 0.0s on every MICRO (at active Sens), commit stall, GPU overrun, beat, or DROP, while JIT counts raw > 0.5 ms sub-ms rAF/phase (or > 0.75 ms perfNow) wiggles separately without resetting JS STREAK or turning off JS CLEAN.
60 Hz button: Holds each stepped frame across 2× 120 Hz VSYNC scans (≥ 13.0 ms) instead of leaving alternate VSYNC slots unsubmitted (JS 60 HZ), avoiding compositor frame-pacing judder.
Saw Jerk (Space) (SEEN s (mM/uU)): Tap whenever you visually spot a missing car or flash; captures the surrounding 12 frames in seenEvents (Copy JSON). MATCHED means JS registered a drop/micro-jerk/commit-stall within 750 ms; UNCOUNTED (GPU/COMP) proves a downstream compositor/GPU drop occurred below JavaScript.
ph (cyan dots) & cmt: Undifferenced OLS VSYNC phase residual (> ±0.98 ms at 1.2ms flags slip) plus post-rAF MessageChannel commit duration (cmt) after style/layout/paint/commit.
eo (even/odd beat): Even-vs-odd interval skew; > 0.85 ms catches alternating 60 Hz cadence beats (e.g. 7.3 / 9.3 ms) that still average 120.00 Hz.
- Magenta ticks: Fire when
|pDt - rDt| > 1.2 ms (perf.now() vs rafTs dispatch jitter).
LAG+JS bars: Dispatch lag (amber) + JS execution (sky blue) vs 5.5 ms / 8.33 ms rails.
Read the Micro-Jerks Report →
4. A/B isolation recipes for subtle jerks
Fixed px vs. perf.now dt: If Fixed px is glassy while perf.now dt shimmers, the jerk is caused by multiplying speed by jittery performance.now() deltas (as in two-features-two-handles#debug).
GPU Query: OFF vs. ON: Keep OFF by default; toggling ON tests whether Metal/ANGLE EXT_disjoint_timer_query_webgl2 introduces pipeline stalls.
WebGL2 / Canvas 2D / Worker GL: WebGL2 (3-VBO ring) and Canvas 2D both request desynchronized low-latency presentation; compare main thread vs Worker GL, or toggle Scope: OFF and Fullscreen to isolate compositor overhead.