Skip to content

feat(geo-layers): preload the tiles of the view transition target (experimental) - #11286

Open
athomct wants to merge 5 commits into
visgl:masterfrom
chesapeake-tech:feat/tile-preload-transition-target
Open

athomct wants to merge 5 commits into
visgl:masterfrom
chesapeake-tech:feat/tile-preload-transition-target

Conversation

@athomct

@athomct athomct commented Nov 22, 2026 •

Copy link
Copy Markdown

Motivation

A FlyToInterpolator or LinearInterpolator transition knows its destination from the first frame. The tile layers do not use this. They request only the tiles of each interpolated frame, and most of these frames are gone before their tiles arrive. On a slow network, the destination reaches full detail long after the camera stops. This PR lets the tile layers load the tiles of the destination view at the best request priority while the flight runs. It is experimental and opt-in.

Change

  • Core: Deck#_getTransitionTarget(viewId) (experimental) returns {viewState, viewport, remainingTime} for the active view state transition of a view, or null. Controller#getTransitionTarget() and ViewManager#getTransitionTarget() supply it from the TransitionManager. It works for every interpolator, for MapView and GlobeView, and for each view with a controller.
  • Geo-layers: TileLayer gets the prop _preloadTransitionTarget (default false). While a transition runs, Tileset2D#update receives the end viewport as preloadViewport. Its tiles load before all other tiles and are not selected or rendered. They are not aborted as off-screen tiles, and LRU order evicts them last. The set is capped so that it and the selected tiles fit the tile-count limit of the cache. maxRequests applies to all requests. The set clears when the transition ends or stops.
  • Shared path: Tile2DView#update takes preloadViewport, and Tileset2D#updateConsumer takes preloadIndices. The proposed Tile2DLayer forwards the prop for each enabled view.
  • With the prop off, request priorities, aborts and eviction do not change.

This change does not depend on #10306 (coverage LOD, by charlieforward9). The two combine well: see Testing.

Screenshots

A local demo page with two Deck instances and one fly-to (z5 to z14, 4 s, FlyToInterpolator). The tile server answers after 400 ms, and maxRequests is 2. Tiles are coloured by zoom: z11 teal, z12 yellow, z13 red, z14 (the destination) green. Left: master. Right: _preloadTransitionTarget: true. Headless Chrome, ANGLE Metal.

Late in the flight. The right side already has the destination tiles for the next frames:

11286-a-flight

About 400 ms after the stop. The left side still waits for z14 tiles. The right side was at full detail when the camera stopped:

11286-b-stop

Testing

  • New node specs: the transition target with linear and fly-to interpolators, controlled-mode updates, BREAK and SNAP_TO_END interruption, cancel, and multiple views (MapView, GlobeView, no controller). The preload set: request order, no selection, cap, no abort, no eviction, and clear. All new tests passed a mutation check.
  • Bench: Chromium headless, 1280x720, synthetic tiles coloured by zoom, 3 runs, medians. Slow network: 400 ms latency, 2 requests at a time. Linear fly-in from z5 to z14:
  • Off path: a parity run takes 12 settled steps along the fly-in path. It gave identical frame hashes and identical ordered request logs for master and this branch, both with the prop off and with it on and no transition running.

Note

Medium Risk
Modifies tile request scheduling and cache retention logic within Tileset2D, though risk is mitigated by gating the behavior behind an opt-in experimental prop.

Overview
Adds an experimental capability to preload destination tiles during view transitions, reducing latency and visual pop-in when camera flights finish.

In @deck.gl/core, introduces _getTransitionTarget across TransitionManager, Controller, ViewManager, and Deck to expose the active transition's destination view state, viewport, and remaining time for controlled views.

In @deck.gl/geo-layers and @deck.gl/proposals, adds an opt-in _preloadTransitionTarget prop to TileLayer and Tile2DLayer. When enabled, Tileset2D prioritizes fetching the destination viewport's tiles ahead of intermediate transition frames without selecting or rendering them, protects them from premature eviction and request abortion, and clears them once the transition ends or cancels.

Reviewed by Cursor Bugbot for commit 16941ac. Bugbot is set up for automated code reviews on this repo. Configure here.

Add Deck#_getTransitionTarget(viewId). It returns the end view state, the
end viewport and the remaining time of the active view state transition of
a view, or null. Controller#getTransitionTarget and
ViewManager#getTransitionTarget supply it from the TransitionManager.

Layers can use it to load data for the destination while the transition
runs. It works for every TransitionInterpolator and for each view with a
controller.
Add the experimental TileLayer prop _preloadTransitionTarget (default
false). While a view state transition runs, the layer passes the end
viewport from Deck#_getTransitionTarget to Tileset2D#update as
preloadViewport.

Tileset2D requests the tiles that cover that viewport before all other
tiles, in index order, without selecting or rendering them. Preload tiles
are not aborted as off-screen tiles, and LRU order evicts them after older
tiles. The set is capped so that it and the selected tiles fit the
tile-count limit of the cache. A null viewport clears the set, and the
scheduler then cancels its queued requests. The maxRequests limit applies
to all requests.

The shared path supports the same: Tile2DView#update takes
preloadViewport and Tileset2D#updateConsumer takes preloadIndices. The
proposed Tile2DLayer forwards the prop once for each enabled view.

With the prop off, the request priorities, abort and eviction rules are
unchanged.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@coveralls

coveralls commented Nov 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.803% (+0.05%) from 82.755% — chesapeake-tech:feat/tile-preload-transition-target into visgl:master

The cache eviction treated preload tiles as unused tiles. Visible
placeholder tiles and the preload tiles of other consumers also took
cache space, but the preload cap counted only the selected tiles. Thus
an update could evict and abort the preload tiles that it requested.

Cache eviction now keeps the preload tiles. The preload cap counts all
tiles that eviction keeps: the selected tiles, the visible tiles and the
preload tiles of all consumers. Tileset2D#update makes the preload set
after the visibility update, so that the cap counts the placeholders of
the frame. When the kept tiles need more space, the preload sets shrink
in rank order and keep the best tiles. The selected and visible tiles
do not change.

With the prop off, no preload set exists and nothing changes.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit bbfbd4c. Configure here.

The preload set is not selected, but best-available refinement shows a
loaded descendant of a selected tile that has not loaded. In a zoom-in
transition, preload tiles are such descendants. State this in the docs
and pin it with a test.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

This branch has not been deployed

No deployments
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.

3 participants