Skip to content

Wait for packed sprite metadata in visual validation - #1929

Merged
bghgary merged 2 commits into
BabylonJS:masterfrom
bghgary:bghgary-packed-sprite-readiness
Oct 13, 2026
Merged

bghgary merged 2 commits into
BabylonJS:masterfrom
bghgary:bghgary-packed-sprite-readiness

Conversation

@bghgary

@bghgary bghgary commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

[Created by Copilot on behalf of @bghgary]

Sprites Pixel Perfect can capture before packed-atlas metadata loads, omitting the blue triangle. Scene readiness does not wait for that metadata.

This remains an opt-in wait-for-readiness workaround; tests without it retain their existing behavior. The example still needs to register its sprite manager with Scene.addIsReadyCheck.

A controlled two-second metadata delay reproduces the failure before the fix (11.964% differing pixels) and passes with it (0.833%, below the 2.5% limit). All 371 enabled visual tests pass locally on Windows with Direct3D 11; 349 are skipped by the existing configuration.

Scene readiness does not inspect sprite managers, allowing packed-atlas rendering to be skipped while its metadata is still loading. Include SpriteManager.isReady in the existing per-example readiness workaround and enable it for Sprites Pixel Perfect.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open finding
What changed in this PR

Adds an opt-in readiness workaround for visual validation so sprite packed-atlas metadata is loaded before capturing, preventing missing sprite elements in pixel-perfect comparisons.

Changes:

  • Extend the wait-for-readiness workaround to include sprite-manager readiness (packed-atlas metadata).
  • Update the native validation runner to wait for both GUI image readiness and sprite-manager readiness.
  • Enable wait-for-readiness for the “Sprites Pixel Perfect” visual test entry.
File Description
Documentation/​AddingNewValidationTests.md Documents that wait-for-readiness also waits for sprite-manager readiness / packed-atlas metadata.
Apps/​Playground/​Scripts/​validation_native.js Implements sprite-manager readiness checks alongside existing GUI readiness checks.
Apps/​Playground/​Scripts/​config.json Opts the “Sprites Pixel Perfect” test into the wait-for-readiness workaround.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Documentation/AddingNewValidationTests.md Outdated
@bghgary
bghgary enabled auto-merge (squash) October 13, 2026 00:31
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ab498524-a293-43a8-9d24-59fbdfaa3b67
@bghgary
bghgary merged commit 836bcf3 into BabylonJS:master Oct 13, 2026
35 checks passed
@bghgary
bghgary deleted the bghgary-packed-sprite-readiness branch October 13, 2026 03:08
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.

3 participants