Commit 92c74bd
Implement complete WebGPU FFT with Cooley-Tukey algorithm (#247)
* Initial plan
* Implement complete WebGPU FFT with Cooley-Tukey algorithm
- Implement bit-reversal permutation shader
- Add butterfly operation shaders for all log2(N) stages
- Implement twiddle factor precomputation
- Add magnitude computation with FFT shift
- Create multi-pass pipeline with ping-pong buffers
- Tests passing with mocked WebGPU environment
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
* Add comprehensive tests and benchmarks for WebGPU FFT
- Add comparison tests validating correctness vs WASM FFT
- Test single tones, multi-tones, DC component, noise, and edge cases
- Add performance benchmark suite for different FFT sizes
- Validate error metrics (MAE < 1dB, RMSE < 2dB)
- Add throughput analysis for 60 FPS target
- Test concurrent FFT operations and memory management
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
* Add comprehensive WebGPU FFT documentation
- Complete implementation guide with algorithm details
- Performance characteristics and benchmarking results
- Usage examples and error handling patterns
- Browser compatibility matrix
- Debugging guide and common issues
- Update FFT implementation docs with WebGPU section
- Update performance benchmarks with complete status
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
* Fix critical bugs in WebGPU FFT implementation
- Fix FFT shift bug: WGSL select() args were swapped (idx+half, idx-half) -> (idx-half, idx+half)
- Add validation for edge cases: reject fftSize < 2, negative, and non-power-of-2
- Remove unused import isWasmAvailable from comparison tests
- Add comprehensive unit tests for input validation
- Fix async/await and non-null assertion linting issues
- Update documentation to match corrected implementation
Addresses review comments from @alexthemitchell and copilot-pull-request-reviewer
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
* Fix TypeScript type errors in test files
- Fix Sample import to use ../dsp instead of ../../types/rendering
- Add null coalescing for Float32Array indexing in test helpers
- Re-add isWasmAvailable import for benchmark tests
- All type checks passing, build successful, tests passing
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
* Address PR review comments - code quality improvements
- Remove unused numGroups variable from butterfly shader
- Replace non-null assertions with safe optional chaining in tests
- Update Firefox support documentation with version and flag details
- All type checks passing, linter clean, tests passing
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexthemitchell <5687158+alexthemitchell@users.noreply.github.com>1 parent 98f4811 commit 92c74bd
File tree
7 files changed
+1706
-74
lines changed- docs/reference
- src/utils
- __tests__
7 files changed
+1706
-74
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
634 | 658 | | |
635 | 659 | | |
636 | 660 | | |
637 | 661 | | |
638 | 662 | | |
639 | 663 | | |
| 664 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
321 | | - | |
322 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
326 | 333 | | |
327 | | - | |
328 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
329 | 338 | | |
330 | | - | |
| 339 | + | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
| |||
0 commit comments