I have made Margo Engine public. It is a small WebGPU engine for the web, with a Rust kernel compiled to Wasm.

Repo: GitHub - scottcampbelldata/margoengine: A small WebGPU engine for the web, with a Rust/Wasm core. · GitHub

The core and the stage together are 24,848 bytes gzip (61,345 raw), with the Wasm kernel and the WebGPU backend included. The build fails if that entry reaches 25,000 bytes gzip. Other features (glTF, shadows, physics, post effects, and so on) are separate packages. You import only what you use.

The Rust kernel lives in packages/kernel and does transforms, bounds and culling in one flat buffer. The compiled Wasm is checked in, so a JavaScript build does not need Rust. You need the toolchain pinned in rust-toolchain.toml only if you change the kernel (npm run test:kernel).

The packages are not on npm yet. npm install margoengine currently gets a 0.0.1 name placeholder, not the engine. To try it:

GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 https://github.com/scottcampbelldata/margoengine.git cd margoengine npm ci npm run build:packages npm run dev:examples 

Node 22.12 or newer builds the packages and runs the examples (npm prints one engine warning on 22). The tests need Node 24.18. The quickstart is a textured floor, a crate and a ball, with soft shadows and click-to-pick. If the browser has no WebGPU, an optional WebGL2 layer can run that same scene; a browser with WebGPU never downloads the layer.

AI agents write the code. I set the rules in AGENTS.md, and a core change, or a change that removes or renames an export of a locked package, waits for my yes. GPU checks run on our own machines (NVIDIA RTX A6000, Intel Arc 140V, AMD Radeon 680M, and Apple silicon) because hosted runners have no GPU.

Honest limits: Chrome and Edge on desktop are tested. Firefox is partly tested. Safari on macOS and iPhone I have checked by hand only. Android is not tested. Known bugs are in docs/known-bugs.md. Issues and pull requests are welcome; see CONTRIBUTING.md.

If you look at the kernel or the Wasm boundary, I would like to hear what does not make sense.

1 post - 1 participant

Read full topic