Skip to content

feat: Add WebGL 4GB fix test and backport emscripten GL_UNPACK_ROW_LENGTH patch - #1062

Merged
jeromelaban merged 5 commits into
mainfrom
dev/jela/4gb-fix
Jun 5, 2026
Merged

jeromelaban merged 5 commits into
mainfrom
dev/jela/4gb-fix

Conversation

@jeromelaban

@jeromelaban jeromelaban commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 5, 2026 12:49
@jeromelaban
jeromelaban marked this pull request as draft June 5, 2026 12:49
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

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 adds a dedicated regression test project to validate the WebGL 4GB heap backport for emscripten’s GL_UNPACK_ROW_LENGTH handling, and introduces MSBuild targets that patch dotnet.native.*.js when -s MAXIMUM_MEMORY=4GB is used (plus CI wiring to run the test on Linux).

Changes:

  • Add Uno.Wasm.Tests.WebGL4Gb test project (C# + a tiny native C shim) to force-link WebGL glue and validate patch behavior for both build and publish outputs.
  • Backport the emscripten #21980 fix by in-place patching of _framework/dotnet.native.*.js for 4GB builds (build + publish variants).
  • Run the new WebGL 4GB validation script in the Linux CI test stage.

Issue link: Not provided in the metadata. Please add a Fixes/Closes/Related to https://github.com/unoplatform/Uno.Wasm.Bootstrap/issues/#<issue_number> line to the PR description (or the “no issue by design” note per repo guidelines).

Reviewed changes

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

Show a summary per file
File Description
src/Uno.Wasm.Tests.WebGL4Gb/webgl-force-link.c Forces WebGL symbol usage so emscripten links library_webgl.js into dotnet.native.js for a meaningful patch validation.
src/Uno.Wasm.Tests.WebGL4Gb/Uno.Wasm.Tests.WebGL4Gb.csproj Adds a WebAssembly test app with an opt-in 4GB build flag and native file reference.
src/Uno.Wasm.Tests.WebGL4Gb/test-webgl-4gb.sh Script that asserts the patch is applied for 4GB builds/publish and not applied when the flag is disabled.
src/Uno.Wasm.Tests.WebGL4Gb/Program.cs Minimal test entrypoint for the dedicated WebGL 4GB test app.
src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets Adds MSBuild targets that patch dotnet.native.*.js for 4GB builds and remove stale compressed siblings in publish output.
src/Uno.Wasm.Bootstrap.sln Registers the new Uno.Wasm.Tests.WebGL4Gb project in the solution.
build/ci/stage-build-linux-tests.yml Runs the new WebGL 4GB test script as part of Linux tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings June 5, 2026 17:17
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

@jeromelaban
jeromelaban marked this pull request as ready for review June 5, 2026 18:03
Copilot AI review requested due to automatic review settings June 5, 2026 18:03
@jeromelaban
jeromelaban enabled auto-merge June 5, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +659 to +670
Condition="'@(WasmShellExtraEmccFlags)' != '' AND '$(WasmBuildingForNestedPublish)' != 'true'">

<!--
Item references (@(...)) are NOT expanded inside a property-function
string argument, so the 4GB flag cannot be detected with
[System.String]::Copy('@(WasmShellExtraEmccFlags)').Contains(...).
Flatten the flags into a property first, then test that property.
-->
<PropertyGroup>
<_UnoExtraEmccFlagsFlat>@(WasmShellExtraEmccFlags)</_UnoExtraEmccFlagsFlat>
<_UnoPatchWebGLFor4Gb>$(_UnoExtraEmccFlagsFlat.Contains('MAXIMUM_MEMORY=4GB'))</_UnoPatchWebGLFor4Gb>
</PropertyGroup>
Comment on lines +733 to +739
Condition="'@(WasmShellExtraEmccFlags)' != '' AND '$(WasmBuildingForNestedPublish)' != 'true'">

<!-- See the build-output target above for why the 4GB flag is detected via a flattened property. -->
<PropertyGroup>
<_UnoExtraEmccFlagsFlat>@(WasmShellExtraEmccFlags)</_UnoExtraEmccFlagsFlat>
<_UnoPatchWebGLFor4Gb>$(_UnoExtraEmccFlagsFlat.Contains('MAXIMUM_MEMORY=4GB'))</_UnoPatchWebGLFor4Gb>
</PropertyGroup>

@ajpinedam ajpinedam left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀

@jeromelaban
jeromelaban merged commit a0a7588 into main Jun 5, 2026
14 checks passed
@jeromelaban
jeromelaban deleted the dev/jela/4gb-fix branch June 5, 2026 19:01
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