Conversation
…ming - Browser tests: Playwright + SwiftShader harness, exact pixel snapshots for basic, transforms, instances, LoD and paged LoD - SplatPager/SparkRenderer: fire onDirty when a chunk lands, add pending(); portable setTimeout types - CI: ci-browser.yml with HTML report artifact, CPU-only build-lod - Docs/examples: on-demand rendering guide, example, onDirty option docs
- playwright.config: keep threshold 0, allow maxDiffPixelRatio 0.001 (65 px); CI showed 6-16 scattered pixel diffs vs macOS snapshots - ci-browser.yml: bump actions to current majors (checkout/setup-node/upload-artifact v7, cache v6) to clear Node 20 deprecation warnings
…once merged into main.
- SplatPager: rename onDirty to onUpdate, clear it in dispose() - Docs: onDirty may fire several times per frame; schedule a single render - Tests: move unit test to test/unit (vitest --dir), rename browser specs to *.test.ts - CI: upload report with !cancelled() instead of always()
- SparkRenderer: on root-chunk eviction, clear rootPage and indices so a re-shown mesh draws nothing until refetched - SparkRenderer: lodCleanupTimeoutMs option (default 3000); cleanupLodTrees releases all expired trees - SplatPager: add PagedSplats.clear() - paged-lod test: root-eviction scenario with blank/left-alone snapshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds on top of #449 and fixes the issue labeled P2 from #428 . Only the last commit in this PR is stacked on top of #449. Once that's merged I will rebase this on main. The delta can be seen here: asundqui/spark@fix-paged-lod-browser-test...asundqui:spark:fix-paged-root-eviction
When the splat page table is full, if a paged splat is hidden or removed and its root (page 0) is evicted, we fail to clear its internal
rootPage. As a result, if another splat object loads new data into that same page and the old splat becomes visible again within the 3 sec LoD disposal timeout, it will traverse from that same page and show incorrect data. The fix is simply to clear the rootPage and the displayed splats for that object if it's evicted:This PR also adds a new test case to
paged-lod.test.tsthat fails before this fix but now succeeds. It creates a page table with a capacity of 1, adds two SplatMeshes where only one is visible. Then it switches visibility to the other splat, and setsenableLodFetching = falsewhich evicts the previous splat page but prevents the new one from loading. This creates a scenario where nothing should be rendered, but without this fix we see the root splat from the pre-existing data rendered.In order for this test to run deterministically we also add an option
SparkRenderer.lodCleanupTimeoutMswhich previously was hardcoded to 3s. Setting it to Infinity allows the above test to detect the failure even if it takes longer than 3s for the scenario to settle.Finally, in addition to providing an adjustable
lodCleanupTimeoutMsthis PR will dispose all LoD objects that exceed the timeout, rather than only one per LoD work cycle.