Repository navigation
perf(webrtc): scope denormal handling to Opus codec calls - #1651
Draft
theomonnom wants to merge 1 commit into
Draft
theomonnom wants to merge 1 commit into
theomonnom wants to merge 1 commit into
Conversation
Contributor
Changeset format errorKnope requires unquoted package names in changeset front matter and silently ignores entries in any other format, so the following lines would never be released:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Scope subnormal handling to Opus calls: 3.72% less whole-agent CPU in the original-audio-settings experiment, projecting 3.86% more CPU-limited sessions.
WEBRTC_TAG.Subnormal floating-point values can make Opus processing unnecessarily expensive during audio decay and silence. Wrap the internal encode/decode entry points so x86-64 floating-point builds enable FTZ/DAZ for the codec call and restore the caller's MXCSR afterward. Other architectures and fixed-point builds follow the original implementation. The guard is local to the codec; it does not set a process-wide Python floating-point mode.
The Linux build applies the source patch to the pinned Opus checkout. There is no Python API, sample-rate, bitrate, packetization, or SFU change in this patch. The two audio-setting configurations above are benchmark conditions, not changes made by this PR.
Validation:
55513e81d8f606bd75d0ff773d2144e5f2a732f5and reproduces the tested source byte-for-byte. Both modified sources pass Clang syntax checks; the Linux script passes shell syntax validation. No Rust source changed;cargo fmtwas unavailable in this toolchain.tests/opus_denormals_benchmark.json. The CPU counter covers all agent-process threads; profiling and codec-only results are excluded from the gain calculation.The measured effect is incremental on the existing native patch set (#1645, #1646, #1647), using matched GCC rebuilds of the pinned Opus objects. It is not a standalone vanilla-SDK measurement. The comparisons isolate this guard; they must not be added to percentages from other workloads. Capacity uses
1 / (1 - CPU_reduction) - 1, assuming CPU is limiting and per-session cost stays constant at higher load.Keep draft pending the full Chromium/GN production build, packaging checks and deployment latency/capacity validation. The experiment rebuilt the actual RTC FFI with matching replacement Opus objects in the pinned WebRTC archive; it did not run the complete Chromium/GN build. In the density series, both default-audio variants failed receive-gap and loop-max gates in 5/15 sessions and playout in 9/15. The control also failed one local interruption-completion gate. These failures were retained, not filtered out.