Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] Prevent symbols at the same zoom from sharing a crossTileID. - #10936

Merged
ChrisLoer merged 1 commit into
masterfrom
cloer-10844
Jan 17, 2018
Merged

ChrisLoer merged 1 commit into
masterfrom
cloer-10844

Conversation

@ChrisLoer

Copy link
Copy Markdown
Contributor

Port of GL JS PR mapbox/mapbox-gl-js#5994.

Fixes issue #10844, which would allow multiple symbols in a tile to share the same crossTileID as one of their duplicate parent-tile symbols. Once the symbols shared a crossTileID, they would permanently remain "duplicates" of each other, even after increasing zoom level allowed the CrossTileSymbolIndex to distinguish between them.

I've manually tested this with the reuse queue heads-up display. The behavior with "Add 100 views" is that when you first add them, the "queue" count goes to 100, and then next time the map renders the "visible" count updates to 100. Is that the expected behavior? With "Add 10000 views", it shows 9089, visible -- so definitely progress from the earlier behavior, but I take it we're expecting that to be exactly 10,000?

Also an issue has already been filed against the GL JS version of this PR mapbox/mapbox-gl-js#6002.

/cc @ansis @friedbunny

@ChrisLoer

Copy link
Copy Markdown
Contributor Author

I've updated the PR to include the fix for mapbox/mapbox-gl-js#6002.

@ChrisLoer

Copy link
Copy Markdown
Contributor Author

I'm not sure what's going on with the 9089 vs 10000 discrepancy, but I saw the same 9089 number testing an old version of the iosapp from before this was introduced. @friedbunny do you think that needs further investigation?

I haven't reproduced the crash @friedbunny saw, but I think that's #10778, which we'll address in a separate PR.

@friedbunny friedbunny added Core The cross-platform C++ core, aka mbgl annotations Annotations on iOS and macOS or markers on Android labels Jan 17, 2018

@ansis ansis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it might make sense to move this indexes[tileID.overscaledZ].erase(tileID); up next to where removeBucketCrossTileIDs(tileID.overscaledZ, previousIndex->second); is called?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't we have to leave the tile in the indexes until after we've called findMatches in order to copy the values over? The comment "The old index entries themselves stick around until 'removeStaleBuckets' is called." is misleading though, because in this case they only stick around until the end of addBucket.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, you're right

Port of GL JS PR #5994.
Fixes issue #10844, which would allow multiple symbols in a tile to share the same crossTileID as one of their duplicate parent-tile symbols. Once the symbols shared a crossTileID, they would permanently remain "duplicates" of each other, even after increasing zoom level allowed the CrossTileSymbolIndex to distinguish between them.
@friedbunny

Copy link
Copy Markdown
Contributor

I'm not sure what's going on with the 9089 vs 10000 discrepancy, but I saw the same 9089 number testing an old version of the iosapp from before this was introduced. @friedbunny do you think that needs further investigation?

It’s something to keep an eye on, but yeah, no reason to hold up the rest of these improvements. 🙇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

annotations Annotations on iOS and macOS or markers on Android Core The cross-platform C++ core, aka mbgl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants