Skip to content

Speed up settled stereo reverb and mixer automation tails - #2518

Draft
yeahboi233 wants to merge 1 commit into
storytold:mainfrom
yeahboi233:codex/audio-mixer-speedup
Draft

yeahboi233 wants to merge 1 commit into
storytold:mainfrom
yeahboi233:codex/audio-mixer-speedup

Conversation

@yeahboi233

Copy link
Copy Markdown

The existing 24-track audio workload spends time re-evaluating settled reverb parameters and mixer automation after its last keyframe. This isolates the audio optimizations previously carried by #2122 so they can be reviewed independently.

Changes

  • Specialize fully settled stereo reverb blocks; retain the general path for smoothing and other channel counts. Preserve sample arithmetic and the 32-sample gain-update grid.
  • Reuse a mixer lane's last value for requests entirely after its final keyframe. Live overrides retain per-sample evaluation.
  • Extend the bit-for-bit reverb reference test to damping and wet/dry automation. Mixer coverage checks the final-keyframe boundary, whole/partitioned requests and live holds.

No rotoscope/model dependencies, project-format changes, unrelated lint fixes or desktop MIME edits. The existing benchmark workload, timing method and greater-than-4× release threshold are unchanged.

Related: #1978 independently changes the same reverb/mixer paths with a broader optimization. This draft does not depend on it; maintainers should coordinate the overlap and merge order.

Measurements and validation

The historical October 16 same-VM comparison isolated reverb specialization (both versions already had mixer tail caching): 2.426 s baseline versus 2.224/2.201/2.225 s candidate, 8.6% less mean CPU time, 4.49–4.54× realtime. This is host-specific; it is not the combined speedup of both changes.

October 19 Colab Linux comparison against unmodified main 105c09bd, Rust 1.95.0, 8 logical Xeon 2.20 GHz CPUs:

  • Colab build profile (LTO off, 16 codegen units, native CPU): baseline 3.159/3.152/3.151 CPU seconds; candidate 2.824/2.834/2.856. 10.0% lower mean CPU time, but both miss the unchanged >4× floor on this host (baseline 3.17×, candidate 3.50–3.54×).
  • Default release profile (thin LTO, one codegen unit, portable CPU): baseline 3.052/3.021/3.072 CPU seconds; candidate 2.390/2.357/2.919, 16.2% lower mean CPU time. Candidate passed the floor in two of three runs (4.18×/4.24×/3.43×); baseline failed all three. The third candidate run varied substantially, so this is not a reliably passing gate. The sample-exact reverb reference and all 24 mixer tests passed under this profile too.
  • Correctness: 123 DSP tests and 24 mixer tests passed, including bit-for-bit automation/reference checks. Workspace run: 3,554 passed, 2 failed, 45 existing ignored. Formatting, layering, assets and WASM passed. Asset checking required initializing the temporary checkout's Git index; rerun passed all 69 assets.
  • Full CI is not green: strict Clippy reports the same four pre-existing UI warnings as unmodified main. The workspace failures are dev_icon::tests::desktop_file_matches_the_packaged_fields (source unchanged from main; separately addressed by dev desktop entry: the packaged MIME types too (dev_icon test green again) #1958) and the unchanged audio performance floor (3.594 CPU seconds in the workspace run). Both baseline and candidate also fail that floor in isolated alternating runs. No lint allowances, thresholds or ignores were changed.

All compilation, tests and measurements ran on Colab. No local build or test workload ran on the contributor's Mac.

Reproduction and correctness details: crates/audio-dsp/PERFORMANCE.md.

Specialize settled stereo reverb without changing sample arithmetic,
and reuse the final mixer automation value after its last keyframe.
Extend exact-reference coverage to damping, wet/dry automation and
request/live-override boundaries. Preserve the existing workload and
4x performance threshold; record both Colab build-profile comparisons.

Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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