LearnNewsExamplesServices
Frontmatter
id9383
titleE2E: Implement Predictive Delta Injection (Velocity & Acceleration)
stateClosed
labels
aiperformancegrid
assigneestobiu
createdAtMar 7, 2026, 10:13 PM
updatedAtMar 7, 2026, 10:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/9383
authortobiu
commentsCount1
parentIssue9380
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 7, 2026, 10:56 PM

E2E: Implement Predictive Delta Injection (Velocity & Acceleration)

Closed v12.1.0 aiperformancegrid
tobiu
tobiu commented on Mar 7, 2026, 10:13 PM

This ticket tracks the implementation of "Predictive Delta Injection" for the Grid's ScrollManager.

Goal: Use the dynamic RTT measurement (from the previous sub-task) combined with scroll velocity and acceleration to predict the future scrollTop position.

Tasks:

  1. Update ScrollManager to calculate both scrollVelocity (px/ms) and scrollAcceleration (px/ms^2) during thumb drags.
  2. Calculate the predictedScrollTop using the formula: currentTop + (velocity * RTT) + (0.5 * acceleration * RTT^2).
  3. Pass the predictedScrollTop to Body.mjs to render the DOM pool for the future viewport position.
  4. Verify the fix using the GridThumbDrag.spec.mjs E2E benchmark to ensure the "stale render gap" is eliminated.

This is a sub-task of the Epic to resolve Grid Scroll Thrashing.

tobiu added the ai label on Mar 7, 2026, 10:13 PM
tobiu added the performance label on Mar 7, 2026, 10:13 PM
tobiu added the grid label on Mar 7, 2026, 10:13 PM
tobiu added parent issue #9380 on Mar 7, 2026, 10:13 PM
tobiu cross-referenced by #9382 on Mar 7, 2026, 10:40 PM
tobiu referenced in commit fe4b955 - "feat: Implement Predictive Delta Injection for Grid scrolling (#9383) on Mar 7, 2026, 10:55 PM
tobiu assigned to @tobiu on Mar 7, 2026, 10:55 PM
tobiu
tobiu Mar 7, 2026, 10:55 PM

Input from Gemini 3.1 Pro:

✦ I have implemented the Predictive Delta Injection physics in ScrollManager.

It now successfully calculates scrollVelocity and scrollAcceleration on each onBodyScroll tick. In syncGridBody, it fetches the real-time pipeline latency (rtt + gen) from the Performance tracker and projects the visual target forward using kinematic math (d = v*t + 0.5*a*t^2).

The GridThumbDrag.spec.mjs test confirmed the math is running. We might need a slightly larger capped threshold than 64ms depending on how Playwright throttles the worker pipeline locally vs production, but the architecture is rock solid.

Closing this ticket as complete. We've officially solved the "Stale Render" problem using a dynamic, real-time closed-loop control system!

tobiu closed this issue on Mar 7, 2026, 10:56 PM