Repository navigation
[Test] Add glass/transmission golden-image regression test - #1381
Merged
Merged
Conversation
Adds testGlassTarget() to RendererTests, wired into the existing PSNR
pipeline the same way testTransparencyTarget() is, with a glass/transmission
scene added to the shared UnitTestRender.untoldscene fixture.
Also fixes a deadlock this surfaced: BaseRenderSetup's default
initializeAssets() blocked on XCTestExpectation.wait(for:timeout:) for
loadUntoldScene()'s completion, but that completion always arrives via a
Task { @mainactor in ... } hop (setEntityMeshAsync / deserializeScene's
AsyncLoadTracker). A thread-blocking wait() never lets that hop run, so it
only "succeeded" before because UnitTestRender had zero `.model`-kind
entities (fully synchronous/procedural, no Task hop to wait on). The glass
panes are real `.model` loads, so every test relying on the default
initializeAssets() (~37 classes) started deadlocking once they were added.
Fixed by making initializeAssets() kick the load off without blocking, and
awaiting completion in setUp() via the existing (already async-safe)
waitForOutstandingAssetLoadsToFinish() drain before setVisibleEntities()
runs.
Regenerates the reference images affected by the scene change (glass panes
visible in frame) for RendererTests and PostFXTests.
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.
Summary
testGlassTarget()toRendererTests, wired into the existing PSNR pipeline the same waytestTransparencyTarget()is, with glass/transmission panes added to the sharedUnitTestRender.untoldscenefixture.BaseRenderSetup's defaultinitializeAssets()blocked onXCTestExpectation.wait(for:timeout:)forloadUntoldScene()'s completion, but that completion always arrives via aTask { @MainActor in ... }hop (setEntityMeshAsync/deserializeScene'sAsyncLoadTracker). A thread-blockingwait()never lets that hop run, so it only "succeeded" before becauseUnitTestRenderhad zero.model-kind entities (fully synchronous/procedural, no Task hop to wait on). The glass panes are real.modelloads, so every test relying on the defaultinitializeAssets()(~37 classes) started deadlocking once they were added. Fixed by makinginitializeAssets()kick the load off without blocking, and awaiting completion insetUp()via the existing (already async-safe)waitForOutstandingAssetLoadsToFinish()drain beforesetVisibleEntities()runs.RendererTestsandPostFXTests.Closes #1372
Test plan
swift test --filter RendererTest— 31 tests, 0 failures (1 opt-in skip)swift test --filter PostFXTests— 16 tests, 0 failures (1 opt-in skip)BaseRenderSetup's defaultinitializeAssets()(CullingTest,MaterialAlphaDecodingTests) to confirm the central fix covers them without per-file changes