You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(wave): SIMD kernels for wave PDE update — host + ESP32-S3 PIE + Teensy 4 DSP (refs #3073 §7) #3097
The 5-point stencil inner loop in WaveSimulation2D_Real::update() is a textbook SIMD candidate. Each lane reads 5 i16s, multiplies by Q15 constants, sums, clamps, stores. Trivially parallel across cells.
Platforms
Platform
ISA
Width
Notes
Host (test runner + WASM)
SSE2 / AVX2 / NEON
8× i16
Easy first target; immediate test infrastructure benefit
ESP32-S3
PIE (Xtensa SIMD)
8× i16 (128-bit)
Codebase already has PIE infra — search EE_VADDS, xt_simd
Teensy 4 (Cortex-M7)
ARMv7-M DSP
2× i16 per op
__SADD16, __SSAT16, __SMLAD intrinsics
ESP32-P4
RVV (RISC-V Vector)
variable
Future target
Implementation strategy
Behind #ifdef per platform; scalar fallback otherwise.
Build on top of the §2 / §3 / §4 (#TBD) scalar improvements — those land first, SIMD layers on the cleaner baseline.
One translation unit per backend (e.g. wave_simulation_real_simd_neon.cpp.hpp).
Selection by platform macro in the dispatcher.
Acceptance
Parity check: SIMD output must equal scalar output bit-for-bit on each platform. Add a parity unit test (run scalar + SIMD on the same input, FL_CHECK_EQ per cell).
Microbench: confirm the speedup. WaveFx is one of the heavier Fx2d effects and is regularly run at 4×/8× super-sample on ESP32-S3, so the wins should be felt at end-user frame rates.
Why this is the last item
Largest diff of the §1–§7 set.
Should land after §2/§3/§4 stabilize the scalar kernel, so the SIMD backends don't have to re-implement perf fixes.
Each platform backend is independent — can ship one at a time.
This split matches the issue body's own "per-platform #ifdef gates" recommendation. The scalar baseline that all three SIMD paths target is now optimal — §2 (#3099), §3 (#3101), §4 (#3103), §6 (#3105) are all merged on master, and §5 (#3104) added the 9-point Laplacian opt-in. Closing this umbrella so progress on the platform-specific work is tracked per-backend.
Parent meta: #3098 (updated to mark §7 as deferred-with-followups).
Activity
zackees commentedon Jun 15, 2026
Parent meta: #3098. Should land after the scalar-kernel improvements in #3092 / #3093 / #3094 stabilize.
zackees commentedon Jun 15, 2026
Closing in favor of three focused per-backend follow-up issues, each independently scoped and mergeable:
This split matches the issue body's own "per-platform #ifdef gates" recommendation. The scalar baseline that all three SIMD paths target is now optimal — §2 (#3099), §3 (#3101), §4 (#3103), §6 (#3105) are all merged on master, and §5 (#3104) added the 9-point Laplacian opt-in. Closing this umbrella so progress on the platform-specific work is tracked per-backend.
Parent meta: #3098 (updated to mark §7 as deferred-with-followups).