Skip to content

Fix pffft benchmark bug and add config validation tests#58

Merged
EmNudge merged 1 commit intomainfrom
fix-pffft-benchmark-validation
Jan 28, 2026
Merged

Fix pffft benchmark bug and add config validation tests#58
EmNudge merged 1 commit intomainfrom
fix-pffft-benchmark-validation

Conversation

@EmNudge
Copy link
Owner

@EmNudge EmNudge commented Jan 28, 2026

Summary

  • Fix PFFFT_REAL enum bug: was incorrectly 1, should be 0 (caused pffft to run complex FFT instead of real FFT)
  • Add shared competitor config (benchmarks/lib/competitors.js) as single source of truth
  • Add benchmark-correctness.test.js to catch config drift between benchmarks and tests
  • Update CI to run test:all instead of just npm test
  • Refresh README benchmark numbers with corrected pffft results

Details

The pffft real FFT benchmark was using PFFFT_REAL = 1 but the correct value is 0 (from pffft.h: enum { PFFFT_REAL=0, PFFFT_COMPLEX=1 }). This caused pffft to run complex FFT on real data, making it appear slower than it actually is.

With the fix, pffft now correctly beats wat-fft at N=64 for real FFT.

- Fix PFFFT_REAL enum: was incorrectly 1, should be 0 (rfft.bench.js)
- Add shared competitor config (benchmarks/lib/competitors.js)
- Add benchmark-correctness test to catch config drift
- Update third-party tests to use shared config
- Update CI to run test:all instead of just npm test
- Refresh README benchmark numbers with corrected pffft results
@EmNudge EmNudge force-pushed the fix-pffft-benchmark-validation branch from 24f9efb to aeab9f8 Compare January 28, 2026 20:48
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Playground Preview

Deployed to Cloudflare Pages:
https://76072155.wat-fft.pages.dev (aeab9f8)

@EmNudge EmNudge merged commit c5dc2dc into main Jan 28, 2026
5 checks passed
@EmNudge EmNudge deleted the fix-pffft-benchmark-validation branch January 28, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant