Skip to content

Restore the Babylon.js native Meshopt entry point - #1897

Merged
bkaradzic-microsoft merged 3 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/native-meshopt-compatibility
Oct 1, 2026
Merged

bkaradzic-microsoft merged 3 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/native-meshopt-compatibility

Conversation

@bkaradzic-microsoft

@bkaradzic-microsoft bkaradzic-microsoft commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Extracts only the _native.decodeMeshopt compatibility export from the BabylonNative shotgun branch onto official master b8c93d24.

Expose _native.decodeMeshopt as a compatibility export using the existing decoder; retain _native.MeshoptCodec.Decode and the codec version unchanged. Neither the pinned Babylon.js 9.21.2 package nor the current public MeshoptCompression implementation consumes this native export; both use the script-based Meshopt decoder. This change does not add Babylon.js integration.

  • Four-line production change; no new decoder implementation.
  • Document both entry points.
  • Add a native regression that decodes the existing reference bitstream byte-for-byte through both exports and checks invalid-mode rejection.

Validation

Built the isolated branch with official dependency revisions, macOS/JavaScriptCore, RelWithDebInfo, and NativeMeshopt enabled. The regression requires no GPU:

UnitTests --gtest_filter="NativeMeshopt.*": 1 passed.

No Babylon.js, bgfx, or JsRuntimeHost changes; no dependency bumps, visual references, tolerances, or exclusions.

Copilot AI lite review requested due to automatic review settings September 22, 2026 20:58

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: 1 High severity

Open (1)
What changed in this PR

Restores Babylon.js’ expected native Meshopt compatibility entry point (_native.decodeMeshopt) by exporting it alongside the existing grouped codec API, and adds documentation + a regression test to ensure both entry points behave identically.

Changes:

  • Export _native.decodeMeshopt as a legacy alias to the existing DecodeMeshopt implementation.
  • Update NativeMeshopt plugin README to document both _native.decodeMeshopt and _native.MeshoptCodec.Decode.
  • Add a native unit test that validates byte-for-byte decode parity and invalid-mode rejection across both exports.
File Description
Plugins/​NativeMeshopt/​Source/​NativeMeshopt.cpp Adds the legacy _native.decodeMeshopt export wired to the existing decoder.
Plugins/​NativeMeshopt/​README.md Documents the legacy free-function entry point alongside the grouped API.
Apps/​UnitTests/​Source/​Tests.JavaScript.cpp Adds a regression test asserting decode parity and invalid-mode rejection.

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

Comment thread Apps/UnitTests/Source/Tests.JavaScript.cpp Outdated
@bkaradzic-microsoft
bkaradzic-microsoft requested review from bghgary and a balanced review from Copilot September 22, 2026 23:03

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: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread Apps/UnitTests/Source/Tests.JavaScript.cpp Outdated
Comment thread Plugins/NativeMeshopt/README.md Outdated
@bkaradzic-microsoft

bkaradzic-microsoft commented Sep 23, 2026 •

Copy link
Copy Markdown
Member Author

All 35 checks now pass on 425796d2. The targeted Windows JSI retry succeeded on workflow attempt 2. The original JSI failure was visual-validation setup repeatedly receiving HTTP 403 from snippet.babylonjs.com; compilation had succeeded and the failure was not a Meshopt assertion. No source, tolerances, or exclusions were changed for the retry.

bkaradzic-microsoft added a commit to bkaradzic-microsoft/BabylonNative that referenced this pull request Sep 30, 2026
Review-Group: E4
Source: PR BabylonJS#1897
Squashed final review changes, including regressions and review follow-ups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 60c2ec68-6de1-445d-9fc9-b699db737eae
Branimir Karadzic and others added 3 commits October 1, 2026 09:37
Extract the decodeMeshopt compatibility export from shotgun without changing the grouped MeshoptCodec API or dependency pins. Cover decoding the existing reference stream and rejecting invalid modes through both entry points.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 723c9021-b79c-4089-9ff7-0d8ad63f1e98
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d35d0a8b-b073-4f2a-bbd3-a0b1d3584305
Label both tested entry points in failure messages while retaining the Uint8Array return contract. Use one named function type for both documented exports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 723c9021-b79c-4089-9ff7-0d8ad63f1e98
@bkaradzic-microsoft
bkaradzic-microsoft force-pushed the pr/native-meshopt-compatibility branch from 425796d to 8ff76fe Compare October 1, 2026 16:42

@bghgary bghgary 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.

[Reviewed by Copilot on behalf of @bghgary]

LGTM except for one documentation comment.

Comment thread Plugins/NativeMeshopt/README.md
@bkaradzic-microsoft
bkaradzic-microsoft enabled auto-merge (squash) October 1, 2026 22:11
@bkaradzic-microsoft
bkaradzic-microsoft merged commit 7acd497 into BabylonJS:master Oct 1, 2026
35 checks passed
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