Simplify browser builds and SPIR-V testing - #85
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing
gpucpplink interface also forces--closure=1. Closure is not required by Emdawn or for correctness; it is only a size optimization. Emscripten’s bundled native Closure binary is x86-64, so Apple Silicon builds fall back to Closure’s Java implementation and gpu.cpp has to detect and configure OpenJDK. This makes every browser consumer pay for another toolchain component and slows the normal edit-link-test loop.For gpu-browser-app, Closure reduced the combined compressed JS and Wasm artifacts from approximately 123 KB to 107 KB. That saving does not justify a second build path or a Java dependency. This PR therefore removes Closure entirely, together with the macOS Java detection and documentation. External browser consumers now inherit only the settings required for gpu.cpp to work, and development, testing, and release use the same linker path.
The integration also exposed a useful native testing boundary: downstream SPIR-V producers need to verify their generated module against gpu.cpp’s WebGPU-profile Dawn setup. The test runner now accepts
./test --spirv FILE, executes the supplied module, and checks the same known output as gpu.cpp’s assembled fixture.CI now installs NumPy into an Actions-managed Python rather than the runner’s Homebrew Python, which rejects system-level package installation under PEP 668.
The essential design is that
gpucppsupplies the WebGPU runtime requirements, applications own their Embind surface, and neither side needs Closure or Java.