Skip to content

Add WebGPU compute crate scaffold and wasm-pack integration#81

Merged
seanwevans merged 1 commit intomainfrom
codex/create-wgpu-scaffolding-for-gpubackend
Apr 1, 2026
Merged

Add WebGPU compute crate scaffold and wasm-pack integration#81
seanwevans merged 1 commit intomainfrom
codex/create-wgpu-scaffolding-for-gpubackend

Conversation

@seanwevans
Copy link
Copy Markdown
Owner

Motivation

  • Prepare the codebase to host a browser-native WebGPU compute backend by adding a dedicated workspace crate and a shared GPU backend contract so CUDA and WebGPU implementations can interoperate.
  • Provide a minimal, runnable WebGPU initialization + dispatch path so the React frontend can load a wasm artifact and exercise compute dispatch while the FP32 CUDA SGP4 kernel is ported to WGSL.
  • Surface an explicit build flow for producing a WebAssembly package consumable by the web client via wasm-pack.

Description

  • Add a new workspace member openastroviz-webgpu-compute with wgpu + wasm-bindgen scaffolding, including webgpu-compute/src/lib.rs, webgpu-compute/Cargo.toml, webgpu-compute/README.md, and webgpu-compute/shaders/sgp4_fp32.wgsl as the WGSL kernel placeholder.
  • Introduce GpuBackend trait and GpuBackendError enum into core (core/src/lib.rs) to formalize the CUDA/WebGPU parity points and provide dispatch_sgp4_fp32_step semantics.
  • Implement WebGpuBackend that requests an adapter/device/queue, compiles the WGSL shader into a compute pipeline, and exposes wasm-bindgen exports initWebGpuBackend and dispatchSgp4Fp32Step for browser-side invocation.
  • Wire a wasm build step into the web package by adding the build:wasm script to web/package.json and documenting yarn build:wasm/wasm-pack usage in web/README.md and the crate README.

Testing

  • Ran cargo fmt and formatting completed after installing rustfmt (succeeded).
  • Ran cargo check which built the workspace including the new openastroviz-webgpu-compute crate (succeeded).
  • Ran cargo test -p openastroviz-core and all core unit/regression tests passed (2 Vallado vector tests passed).

Codex Task

@seanwevans seanwevans merged commit 1caa892 into main Apr 1, 2026
@seanwevans seanwevans deleted the codex/create-wgpu-scaffolding-for-gpubackend branch April 1, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant