Skip to content

Upload Babylon Native visualization-test images as pipeline artifacts#18456

Open
bghgary wants to merge 3 commits into
BabylonJS:masterfrom
bghgary:bghgary/native-test-artifact-upload
Open

Upload Babylon Native visualization-test images as pipeline artifacts#18456
bghgary wants to merge 3 commits into
BabylonJS:masterfrom
bghgary:bghgary/native-test-artifact-upload

Conversation

@bghgary
Copy link
Copy Markdown
Contributor

@bghgary bghgary commented May 13, 2026

[Created by Copilot on behalf of @bghgary]

Context

The NativeTests job in ci-monorepo.yml downloads BabylonNative nightly test artifacts (pipeline 36), replaces their bundled babylon*.js with the freshly built snapshot, and runs Playground.exe app:///Scripts/validation_native.js plus UnitTests.exe.

When pixel-diff regressions occur (e.g. the recent OpenPBR/glTF surface-tinting regression in #18430), validation_native.js writes the rendered PNG to Results/<reference>.png and a red-overlay diff to Errors/<reference>.png next to Playground.exe -- but nothing in the pipeline uploaded those directories. The failure log was the only visible signal, making it impossible to tell whether a regression is a real visual change vs. a threshold blip without re-running the test locally against a matching native binary.

Change

Mirror the upload pattern from BabylonNative's own win32 workflow (.github/workflows/build-win32.yml, actions/upload-artifact@v6 twice) using the ADO equivalent PublishPipelineArtifact@1:

  • native-rendered-pictures -- Results/, uploaded on not(canceled()). Matches saveResult = true in validation_native.js: every test always writes its render, so green runs upload too and give a baseline.
  • native-error-pictures -- Errors/, uploaded only on failed(). Matches when validation_native.js actually writes diff overlays.

PublishPipelineArtifact@1 has no if-no-files-found: ignore flag, so a one-off New-Item -Force step ensures both directories exist before publish (Errors/ legitimately won't exist on a fully-green run).

Verification

Can be verified end-to-end only after merge: the next native-test failure runs through this job and surfaces the diff PNGs as a downloadable artifact on the build. Until then, the green-run path is exercised by every passing build of this PR itself -- native-rendered-pictures should appear on the ADO run for this PR's CI.

The NativeTests job runs BabylonNative's validation_native.js against
the latest Babylon.js JS, but never uploaded the rendered PNGs (Results/)
or red-overlay diffs (Errors/) that validation_native.js writes next to
Playground.exe. Failure log was the only visible signal -- impossible to
tell whether the regression is a real visual change vs a one-pixel
threshold blip without re-running locally against a matching native
binary.

Mirror BabylonNative's own win32 workflow (actions/upload-artifact@v6
twice in .github/workflows/build-win32.yml) using two
PublishPipelineArtifact@1 steps:

  - native-rendered-pictures -- Results/, uploaded on not(canceled()),
    matches saveResult = true behavior in validation_native.js (every
    test always writes its render so we get a green-run baseline too).
  - native-error-pictures -- Errors/, uploaded only on failed(), matches
    when validation_native.js actually writes diff overlays.

PublishPipelineArtifact@1 has no "ignore if missing" flag, so a one-off
New-Item -Force step ensures both dirs exist before publish (Errors/
won't exist on a fully-green run).
Copilot AI review requested due to automatic review settings May 13, 2026 20:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the NativeTests CI job to preserve BabylonNative visual test output as Azure DevOps pipeline artifacts, making native rendering regressions easier to inspect after CI failures.

Changes:

  • Ensures the native Results/ and Errors/ output directories exist before artifact publishing.
  • Publishes rendered native visualization outputs on non-canceled runs.
  • Publishes native error/diff images only when the job has failed.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

Snapshot stored with reference name:
refs/pull/18456/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18456/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18456/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/18456/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18456/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18456/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18456/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/18456/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bghgary bghgary changed the title ci: upload native test pictures as pipeline artifacts Upload Babylon Native visualization-test images as pipeline artifacts May 13, 2026
…yground.exe

The PublishPipelineArtifact@1 tasks were pointing at
..\BabylonNativeNightlyPlayground\RelWithDebInfo\Results and ...\Errors,
but TestUtils.getOutputDirectory() on Win32 returns the parent of the
module directory, so validation_native.js actually writes to
..\BabylonNativeNightlyPlayground\Results\ (not under RelWithDebInfo).

First PR-build (53411) confirmed: the visualization-tests step failed
(EXT_mesh_gpu_instancing, 205370 pixels diff), Upload Rendered Pictures
ran and reported 'Processed 0 files from ...\\RelWithDebInfo\\Results',
producing an empty artifact. Move the targetPath one level up to match
the actual output location and we'll get the PNGs.
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 13, 2026

🟢 Memory Leak Test Results

13 passed, 0 leaked out of 13 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (13)
Scenario Package
Core Feature Stack @babylonjs/core
Core Rendering Materials Shadows Stack @babylonjs/core
Core Textures Render Targets PostProcess Stack @babylonjs/core
GUI Fullscreen UI Controls @babylonjs/gui
GUI Mesh ADT Controls @babylonjs/gui
Loaders Boombox Import @babylonjs/loaders
Loaders OBJ Direct Load @babylonjs/loaders
Loaders STL Direct Load @babylonjs/loaders
Materials Library Stack @babylonjs/materials
Serializers glTF Export @babylonjs/serializers
Serializers GLB Export @babylonjs/serializers
PostProcesses Digital Rain Stack @babylonjs/post-processes
Procedural Textures Stack @babylonjs/procedural-textures

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