Skip to content

QuickJS#1764

Open
CedricGuillemet wants to merge 7 commits into
BabylonJS:masterfrom
CedricGuillemet:quickJSintegration
Open

QuickJS#1764
CedricGuillemet wants to merge 7 commits into
BabylonJS:masterfrom
CedricGuillemet:quickJSintegration

Conversation

@CedricGuillemet

@CedricGuillemet CedricGuillemet commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator
  • Validation native script modified to lower pressure on the stack. Overflow happened with QuickJS because of larger than other engine stack entries.

Copilot AI review requested due to automatic review settings July 3, 2026 12:09

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.

Pull request overview

This PR introduces CI coverage for building BabylonNative with the QuickJS JavaScript engine, primarily by switching the JsRuntimeHost dependency to a QuickJS-capable revision and wiring new QuickJS jobs into the GitHub Actions workflows.

Changes:

  • Point FetchContent for JsRuntimeHost at a QuickJS branch/revision.
  • Add new CI jobs to build with QuickJS on macOS, Win32, Linux, and Android.
  • Extend the reusable Win32 and macOS build workflows to accept/select the QuickJS engine.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
CMakeLists.txt Switches JsRuntimeHost source to a QuickJS-capable fork/revision.
.github/workflows/ci.yml Adds new QuickJS jobs across macOS/Win32/Linux/Android in CI.
.github/workflows/build-win32.yml Adds QuickJS handling for napi-type to set the right CMake define and suffix.
.github/workflows/build-macos.yml Adds a js-engine input and forwards it into the CMake configure step.

Comment thread CMakeLists.txt Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/build-macos.yml
Comment on lines +375 to +380
// Defer scene construction to a fresh macrotask so
// eval()/createScene() run at a shallow native-stack
// depth instead of nested inside the native snippet
// load callback. Deep scenes otherwise pile onto the
// native XHR dispatch frames and can overflow engines
// with a small C stack (e.g. QuickJS).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't Babylon users hit the same problem? This isn't unique to validation tests, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, it's a stack overflow issue. This should happen with other JS engines as well. debug/release build also have influence on the number of stack element count. QuickJS stack elements are bigger so the overflow happens sooner.

Comment thread CMakeLists.txt
FetchContent_Declare(JsRuntimeHost
GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git
GIT_TAG f07d99119887131a89a3580ada9c2a8dbc7782f7)
GIT_REPOSITORY https://github.com/CedricGuillemet/JsRuntimeHost.git

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a reminder to switch this before merge.

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