Skip to content

WASM Spore: add WebGPU acceleration for HDC operations #5

@Tristan-Stoltz-ERC

Description

@Tristan-Stoltz-ERC

Summary

The Spore WASM kernel (crates/symthaea-spore/) currently runs all HDC operations on CPU. WebGPU could accelerate bulk XOR/bind/bundle operations on 16,384-dimensional binary hypervectors.

Hot path to accelerate

  1. Encode — text/numeric to 16,384D binary hypervector
  2. Bind — XOR-based binding (associative memory)
  3. Bundle — majority-vote bundling (set union)
  4. Similarity — Hamming distance computation

These operations are embarrassingly parallel across the 16,384 dimensions and across batch inputs.

Constraints

  • Current WASM binary size: 324KB (budget: 500KB)
  • WebGPU adds ~50-100KB of binding overhead
  • Must fall back gracefully to CPU when WebGPU is unavailable
  • The wgpu crate supports WebGPU targets via wasm-bindgen

Architecture considerations

  • Compute shaders for bulk XOR (bind) and popcount (similarity)
  • Buffer management for hypervector pools
  • Async GPU readback vs synchronous CPU fallback
  • Integration with the existing Spore module system (10 modules)

References

  • wgpu — Rust WebGPU implementation
  • WebGPU spec — W3C standard
  • Spore browser demo uses tabbed UI with cognitive subsystem visualization

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestresearchResearch exploration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions