Skip to content

feat(geo-layers): coverage LOD tile prefetching#10306

Open
charlieforward9 wants to merge 1 commit into
masterfrom
codex/tile-priority-on-master-demo
Open

feat(geo-layers): coverage LOD tile prefetching#10306
charlieforward9 wants to merge 1 commit into
masterfrom
codex/tile-priority-on-master-demo

Conversation

@charlieforward9

@charlieforward9 charlieforward9 commented May 15, 2026

Copy link
Copy Markdown
Collaborator
lod_strategy_comparison.mov

Summary

Adds opt-in coverage LOD prefetching for TileLayer/TerrainLayer so animated transitions can keep coarse coverage available while high-resolution target tiles load.

Why

During fast camera transitions, high-resolution requests can saturate the queue and leave temporary blank coverage. Prefetching ancestor tiles gives the viewport useful lower-resolution coverage, then lets sharper selected tiles replace it as they arrive.

Change

  • Adds lodStrategy: 'coverage' with existing behavior preserved by default as lodStrategy: 'none'.
  • Marks lower-resolution ancestor tiles as prefetch tiles and protects useful prefetch requests from premature abort/eviction.
  • Keeps internal request tiers simple for this PR: selected tiles, visible placeholders, then prefetch tiles.
  • Stabilizes coverage + best-available refinement so pending tiles use immediate child placeholders over coarse ancestors, while stale deeper placeholders are capped during zoom-out.
  • Forwards the strategy through TileLayer and TerrainLayer.
  • Adds API docs, focused unit coverage, and a before/after LOD comparison app at test/apps/lod-strategy-demo.

Validation

  • yarn: passed; no yarn.lock change
  • yarn test-headless test/modules/geo-layers/tileset-2d/tile-2d-header.spec.ts test/modules/geo-layers/tileset-2d/tileset-2d.spec.ts: passed (27 tests)
  • yarn lint: passed with existing repo-wide warnings
  • yarn build: failed in modules/react with existing/base @deck.gl/widgets module resolution errors
  • Demo smoke: test/apps/lod-strategy-demo served successfully at http://127.0.0.1:5174/ and returned HTTP 200 when run with the repo root node_modules/.bin on PATH

Split Notes

The center-priority/default request ordering and public getPriority accessor were moved to the independent PR #10364. This PR is now scoped to lodStrategy coverage prefetching only.

@charlieforward9 charlieforward9 self-assigned this May 15, 2026
@charlieforward9 charlieforward9 marked this pull request as ready for review May 15, 2026 18:08
@charlieforward9 charlieforward9 requested a review from ibgreen May 15, 2026 18:09
@coveralls

coveralls commented May 15, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.437% (+0.05%) from 83.386% — codex/tile-priority-on-master-demo into master

@charlieforward9 charlieforward9 requested a review from akre54 May 15, 2026 23:47
@charlieforward9 charlieforward9 changed the title Prioritize tile requests near viewport center Add coverage LOD tile prefetching May 16, 2026

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are a couple of interesting things in the demo that I'm not really sure how to improve:

  1. As the low-resolution tiles are loading in and the high-resolution tiles are loading on top, I can see almost like a parallax or perspective shift between the low-res and high-res tiles. I'm curious what the root cause of that is.
  2. I see a lot of z-fighting as we zoom into the final destination in New York between the low-res and high-res tiles. There's a lot of z-fighting in the before as well, so this isn't a regression and more a limitation with our renderer

I wrote a draft of docs for this that I'll push up for you to review.

Comment thread test/apps/lod-strategy-demo/app.tsx

@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 and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4be9e53. Configure here.

// Some viewport/tile combinations are not projectable. Keep them valid but lowest priority.
}
return Number.MAX_SAFE_INTEGER;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unprojectable tiles break priority tier boundaries

Medium Severity

_getTileDistanceSquared returns Number.MAX_SAFE_INTEGER (~9e15) when a tile's bounding box can't be fully projected (fewer than 4 finite screen corners or a caught exception). This value, when added to SELECTED_TILE_PRIORITY (0), produces a priority of ~9e15, far exceeding PREFETCH_TILE_PRIORITY (~4.2e9 max). Since lower priority values load first, an unprojectable selected tile loads after all prefetch and visible tiles, violating the intended tier system. This is particularly likely in pitched globe views—exactly the target use case—where horizon tiles may not project cleanly.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4be9e53. Configure here.

@charlieforward9

Copy link
Copy Markdown
Collaborator Author

@chrisgervang

I can see almost like a parallax or perspective shift ... what the root cause of that is.

Almost certain this is a GlobeView or globe-projection issue - due to the way the TileLayer are projected at different resolutions. This is something that I want to address asap. But feels like this could land before polishing the projection?

I see a lot of z-fighting as we zoom into the final destination

Yeah it resolves ever-so-slightly faster in the new strategy due to the center priority, but its nowhere near as bad when testing with the TerrainLayer.

@charlieforward9 charlieforward9 force-pushed the codex/tile-priority-on-master-demo branch from a32e93b to 2b5d3cc Compare June 10, 2026 20:12
@charlieforward9 charlieforward9 changed the title Add coverage LOD tile prefetching feat(geo-layers): coverage LOD tile prefetching Jun 10, 2026
@chrisgervang chrisgervang mentioned this pull request Jun 11, 2026
53 tasks
@chrisgervang chrisgervang added this to the v9.4 milestone Jun 11, 2026
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