From ea2beab936a4e9960ef0e4f8a1542b4055c7c2a8 Mon Sep 17 00:00:00 2001 From: Andy Aragon Date: Fri, 12 Jun 2026 23:26:06 -0700 Subject: [PATCH] fix(core): allow suboptimal_flops on mouth-audio smoothing lerp Rust 1.96.0's clippy promotes clippy::suboptimal_flops to fire on the single-pole IIR smoothing step in mouth_from_audio, breaking the Host CI gate on main. The suggested f32::mul_add pulls libm::fmaf onto no_std Xtensa, the dependency this module is built to avoid. Allow the lint with the same rationale already used in head_from_attention and lost_target_search. --- crates/stackchan-core/src/modifiers/mouth_from_audio.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/stackchan-core/src/modifiers/mouth_from_audio.rs b/crates/stackchan-core/src/modifiers/mouth_from_audio.rs index 8d85424..907fffe 100644 --- a/crates/stackchan-core/src/modifiers/mouth_from_audio.rs +++ b/crates/stackchan-core/src/modifiers/mouth_from_audio.rs @@ -198,7 +198,12 @@ impl Modifier for MouthFromAudio { )] let dt_ms_f32 = dt_ms as f32; let alpha = one_minus_exp_approx(dt_ms_f32 / tau_ms); - self.current += (target - self.current) * alpha; + #[allow( + clippy::suboptimal_flops, + reason = "no_std Xtensa lacks f32::mul_add; libm::fmaf is heavier than the savings" + )] + let next = self.current + (target - self.current) * alpha; + self.current = next; entity.face.mouth.mouth_open = clamp_unit(self.current); } }