Skip to content

Fix stale vector tile data for tiles that missed dirty regions while not rendered#13624

Open
danielzhong wants to merge 2 commits into
mainfrom
DanielZ/fix/vector-tiles-stable-rebake
Open

Fix stale vector tile data for tiles that missed dirty regions while not rendered#13624
danielzhong wants to merge 2 commits into
mainfrom
DanielZ/fix/vector-tiles-stable-rebake

Conversation

@danielzhong

@danielzhong danielzhong commented Jul 14, 2026

Copy link
Copy Markdown
Member

Description

Follow up to #13577.

I noticed that when I zoom the camera in and out, some tiles occasionally disappear and become invisible. However, it doesn't seem to be reproducible for everyone—for example, @donmccurdy couldn't reproduce it on macOS.

Below is a quick suggestion from GitHub Copilot that appears to fix the issue.

Dirty rectangles in VectorProvider are transient, they are recorded during the provider's update() pre-pass, tested against rendered tiles, and cleared by makeClean() at the end of the same frame. A tile that is outside the rendered set never gets a chance to test against them. When that tile later re-enters the rendered set, updateTileData finds no intersecting dirty rectangles and keeps its cached VectorTileData, even though the underlying collections have changed.

Added:

  • VectorProvider._changeCount: incremented each time a dirty rectangle is recorded.
  • VectorProvider._changeCountAtClean: snapshot taken in makeClean().
  • Every VectorTileData is stamped with the current _changeCount when baked, and re-stamped when it passes validation in updateTileData.
  • In updateTileData, data stamped before the last clean may have missed dirty regions that were already consumed, so it is released and re-baked. Otherwise the existing dirty-rectangle intersection test applies as before.

Issue number and link

Testing plan

Author checklist

  • I have submitted a Contributor License Agreement
    - [ ] I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s):
GitHub Copilot

If yes, I used the following Model(s):
Fable 5.0

@danielzhong
danielzhong requested a review from donmccurdy July 14, 2026 19:55
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for the pull request, @danielzhong!

✅ We can confirm we have a CLA on file for you.

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.

1 participant