Skip to content

[Test] Add glass/transmission golden-image regression test - #1381

Merged
untoldengine merged 1 commit into
developfrom
issue/1372
Oct 21, 2026
Merged

untoldengine merged 1 commit into
developfrom
issue/1372

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

  • Adds testGlassTarget() to RendererTests, wired into the existing PSNR pipeline the same way testTransparencyTarget() is, with glass/transmission panes added to the shared UnitTestRender.untoldscene fixture.
  • 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 now visible in frame) for RendererTests and PostFXTests.

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)
  • Spot-checked several of the other ~35 test classes relying on BaseRenderSetup's default initializeAssets() (CullingTest, MaterialAlphaDecodingTests) to confirm the central fix covers them without per-file changes

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.
@untoldengine
untoldengine merged commit 9e1211e into develop Oct 21, 2026
4 checks passed
@untoldengine
untoldengine deleted the issue/1372 branch October 21, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a golden-image (PSNR) regression test for Glass/transmission

1 participant