Skip to content

Reset reverse depth between native validation scenes - #1895

Open
bkaradzic-microsoft wants to merge 3 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/native-validation-reverse-depth
Open

bkaradzic-microsoft wants to merge 3 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/native-validation-reverse-depth

Conversation

@bkaradzic-microsoft

Copy link
Copy Markdown
Member

Summary

Extracts the one-line reverse-depth cleanup fix from the BabylonNative shotgun worktree onto official master. The validation runner reuses its engine, so a scene that enables reverse depth can affect later scenes unless cleanup restores the default.

  • Restore forward depth before releasing cached effects.
  • Add a focused Node regression for repeated cleanup and document its command.
  • No dependency, catalog, tolerance, exclusion, or reference-image changes.

Validation

node --test Apps/Playground/Tests/validation_cleanup.test.cjs passes on this isolated branch. This regression exercises the actual cleanup function without requiring a native host.

Independently based on official b8c93d24; no unrelated shotgun commits.

Extract the focused cleanup fix from the shotgun worktree. Restore forward depth before releasing effects on the reused engine and cover repeated cleanup with a Node regression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 723c9021-b79c-4089-9ff7-0d8ad63f1e98
Copilot AI lite review requested due to automatic review settings September 22, 2026 20:53

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

Review effort: Lite
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Extracts a targeted fix for the native validation runner to prevent a scene that enables reverse depth from affecting subsequent scenes when the engine is reused.

Changes:

  • Reset engine.useReverseDepthBuffer to false during validation cleanup before releasing cached effects.
  • Add a Node-based regression test that directly exercises cleanupAfterTest via vm.
  • Document the engine-reuse cleanup behavior and how to run the regression test.
File Description
Documentation/​ContinuousIntegration.md Documents engine reuse side effects and adds the command to run the new cleanup regression test.
Apps/​Playground/​Tests/​validation_cleanup.test.cjs Adds a focused Node test ensuring cleanup is idempotent and restores forward depth before effect release.
Apps/​Playground/​Scripts/​validation_native.js Restores forward depth (useReverseDepthBuffer = false) as part of cleanup to prevent cross-scene state leakage.

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

Comment on lines +10 to +12
const start = source.indexOf(" function cleanupAfterTest(");
const end = source.indexOf(" function makeTestDone(", start);
assert.ok(start >= 0 && end > start);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in acf43ff9: the test now locates the function with a whitespace-insensitive regex and uses brace-aware extraction that skips strings and comments, so it no longer depends on indentation or the following function name.

Comment thread Apps/Playground/Tests/validation_cleanup.test.cjs
Comment thread Apps/Playground/Tests/validation_cleanup.test.cjs Outdated
Comment thread Documentation/ContinuousIntegration.md Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d35d0a8b-b073-4f2a-bbd3-a0b1d3584305
@bkaradzic-microsoft
bkaradzic-microsoft requested review from bghgary and a balanced review from Copilot September 22, 2026 21:14

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.

Comment thread Apps/Playground/Tests/validation_cleanup.test.cjs Outdated
Comment thread Apps/Playground/Tests/validation_cleanup.test.cjs Outdated
Comment thread Documentation/ContinuousIntegration.md Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d35d0a8b-b073-4f2a-bbd3-a0b1d3584305
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.

2 participants