Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in Cesium3DTileset.memoryAdjustedScreenSpaceError #11447

Open
jjhembd opened this issue Aug 2, 2023 · 0 comments
Open

Race condition in Cesium3DTileset.memoryAdjustedScreenSpaceError #11447

jjhembd opened this issue Aug 2, 2023 · 0 comments

Comments

@jjhembd
Copy link
Contributor

jjhembd commented Aug 2, 2023

If a Cesium3DTileset is constructed with maximumCacheOverflowBytes: 0, it is possible for the screen space error adjustment to enter an infinite loop.

There are two adjustments to the screen space error that can happen depending on the current memory usage of the tileset (see #11310):

  1. When Cesium3DTileset.totalMemoryUsageInBytes increases above cacheBytes + maximumCacheOverflowBytes, the memoryAdjustedScreenSpaceErrror will be increased until the requested tiles use less than cacheBytes + maximumCacheOverflowBytes
  2. When memory usage drops below cacheBytes, then memoryAdjustedScreenSpaceError will be adjusted lower, until either (a) the requested tiles use more than cacheBytes, or (b) memoryAdjustedScreenSpaceError is equal to the user-defined maximumScreenSpaceError

If maximumCacheOverflowBytes is less than the size of one tile, then either adjustment can potentially trigger the other adjustment, resulting in an infinite loop.

At a minimum, we need to clarify the docs:

  • The doc for maximumCacheOverflowBytes should include some guidance on good minimum values
  • The read-only memoryAdjustedScreenSpaceError is important information for the user, and should be exposed and documented (it is currently set to private)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant