Skip to content

fix(core): allow suboptimal_flops on mouth-audio smoothing lerp#587

Merged
andymai merged 1 commit into
mainfrom
fix/core-suboptimal-flops-mouth-audio
Jun 13, 2026
Merged

fix(core): allow suboptimal_flops on mouth-audio smoothing lerp#587
andymai merged 1 commit into
mainfrom
fix/core-suboptimal-flops-mouth-audio

Conversation

@andymai

@andymai andymai commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Rust 1.96.0's clippy promoted clippy::suboptimal_flops to fire on the single-pole IIR smoothing step in mouth_from_audio.rs, which broke the Host (core + sim + drivers) CI gate on main. Because that gate is red on main, every open PR inherits the failure — all four open dependabot PRs (#586, #585, #584, #551) are blocked solely by this.

Clippy suggests f32::mul_add, but that lowers to libm::fmaf on the no_std Xtensa target — exactly the dependency this module is engineered to avoid (it sits beside the libm-free one_minus_exp_approx approximation). This matches the standing decision already documented in head_from_attention and lost_target_search, so the fix #[allow]s the lint with the same rationale rather than taking clippy's suggestion.

Test plan

  • just check — fmt + workspace clippy (-D warnings) + host tests all green locally
  • cargo clippy -p stackchan-core --all-targets --all-features -- -D warnings passes

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.
@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR suppresses the clippy::suboptimal_flops lint that Rust 1.96.0 promoted, which fired on the single-pole IIR smoothing step in mouth_from_audio.rs and broke CI for the entire codebase. The fix #[allow]s the lint with an inline reason, consistent with the identical suppress-and-explain pattern already used in lost_target_search.rs, head_from_attention.rs, and three other modules.

  • Adds #[allow(clippy::suboptimal_flops, reason = "...")] to the lerp expression; the reason field is stable as of Rust 1.81 and this project's MSRV is 1.88.
  • The original compound-assignment form is split into let next = …; self.current = next; to give the attribute a clean statement-level anchor — the math and semantics are unchanged.

Confidence Score: 5/5

Safe to merge — a one-line lint suppress with no semantic change to any computation.

The change is a targeted clippy allow attribute on an expression whose math is identical before and after. It replicates a pattern already established in six other sites in the same crate, the reason string matches lost_target_search.rs verbatim, and the reason field syntax is valid at the project's MSRV.

No files require special attention.

Important Files Changed

Filename Overview
crates/stackchan-core/src/modifiers/mouth_from_audio.rs Adds #[allow(clippy::suboptimal_flops)] with a reason string around the single-pole IIR lerp step, matching the identical pattern already in lost_target_search.rs, head_from_attention.rs, and several other modules; no functional change

Reviews (1): Last reviewed commit: "fix(core): allow suboptimal_flops on mou..." | Re-trigger Greptile

@andymai andymai merged commit 7dcb661 into main Jun 13, 2026
15 checks passed
@andymai andymai deleted the fix/core-suboptimal-flops-mouth-audio branch June 13, 2026 06:40
@release-kun release-kun Bot mentioned this pull request Jun 13, 2026
release-kun Bot added a commit that referenced this pull request Jun 13, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>stackchan-core: 0.37.1</summary>

##
[0.37.1](stackchan-core-v0.37.0...stackchan-core-v0.37.1)
(2026-06-13)


### Bug Fixes

* **core:** allow suboptimal_flops on mouth-audio smoothing lerp
([#587](#587))
([7dcb661](7dcb661))
</details>

<details><summary>stackchan-firmware: 0.113.6</summary>

##
[0.113.6](stackchan-firmware-v0.113.5...stackchan-firmware-v0.113.6)
(2026-06-13)
</details>

<details><summary>stackchan-net: 0.16.1</summary>

##
[0.16.1](stackchan-net-v0.16.0...stackchan-net-v0.16.1)
(2026-06-13)
</details>

<details><summary>stackchan-sim: 0.23.1</summary>

##
[0.23.1](stackchan-sim-v0.23.0...stackchan-sim-v0.23.1)
(2026-06-13)
</details>

<details><summary>stackchan-tts: 0.4.1</summary>

##
[0.4.1](stackchan-tts-v0.4.0...stackchan-tts-v0.4.1)
(2026-06-13)
</details>

<details><summary>tracker: 0.12.22</summary>

##
[0.12.22](tracker-v0.12.21...tracker-v0.12.22)
(2026-06-13)
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-kun[bot] <276042328+release-kun[bot]@users.noreply.github.com>
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