LearnNewsExamplesServices
Frontmatter
id9380
title[Epic] Resolve Grid Scroll Thrashing via E2E Benchmarking
stateOpen
labels
epicaitestingperformance
assigneestobiu
createdAtMar 7, 2026, 7:25 PM
updatedAtMar 7, 2026, 7:34 PM
githubUrlhttps://github.com/neomjs/neo/issues/9380
authortobiu
commentsCount1
parentIssuenull
subIssues
9381 E2E: Create Deterministic Grid Thumb Drag Benchmark
9382 E2E: Implement Dynamic RTT Measurement for VDOM Updates
9383 E2E: Implement Predictive Delta Injection (Velocity & Acceleration)
9384 Implement generic Neo.util.Performance tracker
9385 E2E: Expose Performance tracker metrics via Remote Methods
9386 E2E: Add min velocity threshold to Grid Predictive Scrolling
9387 E2E: Implement Main Thread Optical Pinning for Grid Scrolling
9388 E2E: Enhance VDOM Update Pipeline with Meta Payload Support
9389 E2E: Remove Legacy Scroll Prediction Heuristics from Grid ScrollManager
9390 E2E: Fix GridRowScrollPinning Registration and DOM Lookup Flaws
9391 E2E: Refactor GridRowScrollPinning to Hybrid rAF Engine
9392 E2E: Implement GridRowScrollPinning Automated Test and Sync Refinement
9393 E2E: Implement GridRowScrollPinning via CSS Variables
9394 E2E: Validate GridRowScrollPinning against DevIndex Canvas Worker Latency
9395 E2E: Refine GridRowScrollPinning to Target Explicit Thumb Drags
9396 E2E: Implement Synthetic Thumb Drag Profiles for Optical Pinning Validation
9397 R&D: Explore "Fixed Glass Overlay" Strategy for Optical Pinning
subIssuesCompleted16
subIssuesTotal17
blockedBy[]
blocking[]

[Epic] Resolve Grid Scroll Thrashing via E2E Benchmarking

Openepicaitestingperformance
tobiu
tobiu commented on Mar 7, 2026, 7:25 PM

The Problem: While mousewheel scrolling performs smoothly, grabbing and rapidly dragging the custom vertical scrollbar thumb on a massive grid (e.g., 50k rows in DevIndex) results in prolonged periods of blank content and flickering upon release.

Root Cause Hypothesis: The bottleneck is the triangular worker communication pipeline (App => VDom => Main => App). Even if this pipeline completes rapidly, a high-velocity thumb drag can move the scroll position hundreds of rows ahead during that window. When the VDOM payload arrives, it renders rows for a viewport the user has already left, resulting in a blank screen until the scroll stops and the pipeline catches up.

Context from Previous Session (Epic #9369): We recently implemented a granular, Set-based locking mechanism (coordinatingNodes) in ScrollSync.mjs with a 50ms debounced setTimeout to prevent native event feedback loops. We need to investigate if this lock interacts poorly with the high-velocity syncGridBody throttle or the final VDOM paint.

Strategic Goals for this Epic:

  1. Deterministic E2E Reproduction:
    • Create a dedicated Playwright test (e.g., GridThumbDrag.spec.mjs).
    • Programmatically simulate high-velocity thumb dragging using Playwright's mouse APIs.
    • Crucial Assertion: During the drag, extract the translate3d(x, Y, z) values from the currently mounted .neo-grid-row DOM elements and compare them to the actual scrollTop of the .neo-grid-body-wrapper. A large discrepancy mathematically proves the "stale render" gap.
  2. Velocity-Aware Architecture:
    • Use the E2E test to validate potential solutions, such as dynamically expanding the bufferRowRange based on active scroll velocity, ensuring the pipeline paints further ahead in the direction of the drag.
  3. Locking Audit:
    • Verify if the ScrollSync 50ms lock is artificially delaying the final "resting" VDOM payload paint upon thumb release.
tobiu added the epic label on Mar 7, 2026, 7:25 PM
tobiu added the ai label on Mar 7, 2026, 7:25 PM
tobiu added the testing label on Mar 7, 2026, 7:25 PM
tobiu added the performance label on Mar 7, 2026, 7:25 PM
tobiu
tobiu Mar 7, 2026, 7:33 PM

Input from Gemini 3.1 Pro:

Strategic Note for Implementation:

When addressing the "stale render" gap during high-velocity thumb drags, we should explore Predictive Row Range Calculation.

Rather than simply rendering the rows that match the current scrollTop (which we know will be outdated by the time the VDOM arrives), the ScrollManager could calculate the current scroll velocity (px/ms).

Using this velocity vector, it could predict where the scrollTop will be in ~32ms (an estimated round-trip time for the triangular worker pipeline) and instruct the grid.Body to render that future row range instead.

If successful, the VDOM payload will arrive just as the user's thumb reaches that exact point, eliminating the blank screen. The deterministic E2E Playwright tests will be essential for tuning this prediction algorithm.

tobiu assigned to @tobiu on Mar 7, 2026, 7:34 PM
tobiu added sub-issue #9381 on Mar 7, 2026, 8:02 PM
tobiu added sub-issue #9382 on Mar 7, 2026, 10:13 PM
tobiu added sub-issue #9383 on Mar 7, 2026, 10:13 PM
tobiu added sub-issue #9384 on Mar 7, 2026, 10:29 PM
tobiu added sub-issue #9385 on Mar 7, 2026, 11:05 PM
tobiu added sub-issue #9386 on Mar 7, 2026, 11:44 PM
tobiu added sub-issue #9387 on Mar 8, 2026, 12:51 AM
tobiu added sub-issue #9388 on Mar 8, 2026, 12:08 PM
tobiu added sub-issue #9389 on Mar 8, 2026, 1:09 PM
tobiu added sub-issue #9390 on Mar 8, 2026, 2:03 PM
tobiu added sub-issue #9391 on Mar 8, 2026, 3:29 PM
tobiu added sub-issue #9392 on Mar 8, 2026, 3:48 PM
tobiu added sub-issue #9393 on Mar 8, 2026, 5:23 PM
tobiu added sub-issue #9394 on Mar 8, 2026, 5:25 PM
tobiu added sub-issue #9395 on Mar 8, 2026, 6:12 PM
tobiu added sub-issue #9396 on Mar 8, 2026, 6:48 PM
tobiu added sub-issue #9397 on Mar 8, 2026, 7:12 PM