Skip to content

Call for testing: Electrobun WGPU paths on macOS / Linux (v0.7.0) #173

@devallibus

Description

@devallibus

What is this?

v0.7.0 shipped first-class Electrobun runtime support for gametau. Two example apps now have Electrobun BrowserWindow and GPUWindow (native WGPU) paths:

  • electrobun-counter — minimal counter with hybrid DOM + native WGPU surface, and a pure GPUWindow mode
  • battlestation — heavier showcase where Three.js WebGPURenderer renders onto Electrobun's native WGPU surface (via webgpu.install() + createCanvasShim()) inside a GPUWindow. Electrobun provides the native GPU surface; Three.js still does all scene/geometry/draw calls.

How to test (5 minutes)

Prerequisites

  • Bun >= 1.1
  • Rust toolchain with wasm32-unknown-unknown target (rustup target add wasm32-unknown-unknown)
  • wasm-pack (cargo install wasm-pack)
  • macOS or Linux

Steps

# 1. Clone and install
git clone https://github.com/devallibus/gametau.git
cd gametau
git checkout v0.7.0
bun install

# 2. Pick an example (start with the counter — it's simpler)
cd examples/electrobun-counter

# 3. Run the hybrid BrowserWindow path (DOM HUD + native WGPU surface)
bun run dev:electrobun:hybrid

# 4. Run the pure GPUWindow path (native only, no DOM)
bun run dev:electrobun:gpu

# 5. (Optional) Try the heavier battlestation example
cd ../battlestation
bun run dev:electrobun:browser
bun run dev:electrobun:gpu

What to look for

Path Expected behavior
electrobun-counter hybrid Browser window opens with HTML buttons (inc/dec/reset). A native WGPU surface should appear embedded below the buttons. Counter value updates in both the DOM and the native surface.
electrobun-counter gpu A native 960x640 window opens. Counter value is shown in the window title, updating every 500ms. No DOM/HTML — pure native.
battlestation browser Same as the web version but running inside an Electrobun BrowserWindow. Full DOM HUD, audio, radar.
battlestation gpu Native 960x960 window. Three.js WebGPURenderer draws onto Electrobun's native WGPU surface (via webgpu.install() + createCanvasShim()). Mission state and score in the title bar. Mouse/keyboard input via Electrobun APIs. No audio, no HTML HUD (intentional — see limitations below).

Known GPUWindow limitations (by design)

  • No HTML HUD overlay in native GPUWindow mode
  • No Web Audio playback in native mode yet
  • Mission status surfaces through window title + console
  • Native title-bar chrome may slightly skew top-edge mouse targeting

How the GPU rendering works

Electrobun does not replace Three.js. Instead:

  1. webgpu.install() injects Electrobun's native WebGPU adapter into the Bun runtime globals
  2. webgpu.utils.createCanvasShim(window) creates a fake canvas backed by the native GpuWindow surface
  3. Three.js WebGPURenderer renders onto that shim canvas as if it were a browser <canvas>
  4. All scene graph, geometry, and draw calls are still Three.js — Electrobun only provides the native GPU surface

How to report

Please comment on this issue with:

  1. OS (e.g., macOS 14.3 arm64, Ubuntu 24.04 x86_64)
  2. Which example you tried (counter / battlestation)
  3. Which path (hybrid / gpu / browser)
  4. Result: worked / partially worked / failed
  5. Screenshot or terminal output if something went wrong
  6. Electrobun version (bun node_modules/electrobun/package.json | grep version)

Even a "counter hybrid worked fine on macOS Sonoma" is valuable — it confirms the path for that platform.


Context

  • Release: v0.7.0
  • Adapter code: packages/webtau/src/adapters/electrobun.ts (64 unit tests pass via mocks)
  • GPU rendering bridge: examples/battlestation/src/game/scene-gpu.ts
  • All Rust crates and WASM builds verified on Windows — only the actual Electrobun runtime paths need real-device confirmation

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions