Race condition in `Cesium3DTileset.memoryAdjustedScreenSpaceError`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 15.8k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
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 https://github.com/CesiumGS/cesium/pull/11310):
- When
Cesium3DTileset.totalMemoryUsageInBytesincreases abovecacheBytes + maximumCacheOverflowBytes, thememoryAdjustedScreenSpaceErrrorwill be increased until the requested tiles use less thancacheBytes + maximumCacheOverflowBytes - When memory usage drops below
cacheBytes, thenmemoryAdjustedScreenSpaceErrorwill be adjusted lower, until either (a) the requested tiles use more thancacheBytes, or (b)memoryAdjustedScreenSpaceErroris equal to the user-definedmaximumScreenSpaceError
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
maximumCacheOverflowBytesshould include some guidance on good minimum values - The read-only
memoryAdjustedScreenSpaceErroris important information for the user, and should be exposed and documented (it is currently set to private)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Cesium3DTileset implementation and the screen-space-error adjustments described in pull request 11310. Reproduce the issue with maximumCacheOverflowBytes set to 0 and verify that the adjustment terminates; done should also include guidance for maximumCacheOverflowBytes and public documentation for memoryAdjustedScreenSpaceError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100