Skip to content

Conversation

@sergeyplis
Copy link
Contributor

@sergeyplis sergeyplis commented Dec 17, 2025

Description: This PR introduces a major upgrade to BrainChop, integrating a WebGPU backend for accelerated inference, refreshing the UI/UX, and significantly optimizing performance and memory usage for large models.

Key Changes
🚀 WebGPU & Inference Backend

  • WebGPU Support: Implemented a full WebGPU backend for faster client-side inference. Huge thanks to @spikedoanz and @wpmed92
  • Smart Fallback: Added logic to automatically attempt progressively "safer" execution modes (WebGPU → WebGL) to ensure stability across devices.
  • Universal Runners: Standardized runners to handle both WebGL and WebGPU contexts seamlessly.
  • Backend Indicator: Added a visual indicator in the UI to show which backend is currently active.

⚡ Performance & Optimization

  • Faster Normalization: Optimized Quantile Normalization to use sampling, significantly reducing pre-processing time.
  • WebGL Memory Management: Improved memory estimation and implemented a "chunked argmax" strategy. This allows large models (e.g., 104-class, 50-class) to run on standard WebGL backends without memory crashes.
  • Stability: Fixed memory leaks to improve reliability during repeated drag-and-drop operations.

🎨 UI/UX Improvements

  • Visual Overhaul: Comprehensive CSS updates, harmonizing toolbar styles, fonts, and spacing.
  • About Section: Added a new "About" window detailing privacy (local processing), keyboard shortcuts (C for Clip, V for View), and model icon legends.
  • Streamlined Interface: Removed the "Clip Plane" checkbox in favor of the 'C' keyboard shortcut to declutter the UI.
  • Visualization: Enforced specific colormaps (Copper) for brain extraction/masking models.

🛠️ Infrastructure & Diagnostics

  • Unified Diagnostics: Centralized diagnostic logging for both WebGL and WebGPU to assist in debugging.
  • Deployment Fixes: Resolved pathing issues (favicon, relative paths) for GitHub Pages deployment.
  • Console Logging: Enabled better console output in production builds for easier troubleshooting.

@sergeyplis sergeyplis self-assigned this Dec 17, 2025
@sergeyplis sergeyplis added the enhancement New feature or request label Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants