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
chore: perf: benchmark the SIMD candidates in record.py (format conversion, volume meter, audio mix) #3003
Add benchmark categories for the SIMD candidates to rust/tools/benchmarks/record.py (CATEGORIES, line 20) and paired Rust-vs-C Criterion benches under rust/obs-c-oracle/benches/port_comparison/, then record a baseline:
format: rust/obs-media-io/src/format_conversion.rs vs libobs/media-io/format-conversion.c.h (SSE2), e.g. UYVX→I420, NV12/I420 1080p frame.
volmeter: rust/obs-audio-controls/src/peak.rs:16 (sample_peak), :28 (true_peak), volmeter.rs:252 (RMS) vs libobs/obs-audio-controls.c.h:303,349,445.
audiomix: rust/obs-core/src/audio_mix.rs:178 (mix_into) vs libobs/obs-audio-mix.c.h:47-55; output clamp rust/obs-media-io/src/ffi/audio_output.rs:283 vs libobs/media-io/audio-io.c.h:115.
(The existing conversions category is UTF-8/wide-string conversion, not pixel formats.)
Why
Every other SIMD sub-issue must show a before/after number. No timing exists today (#756: "unmeasured").
Acceptance criteria
The three categories are in CATEGORIES, and record.py's entry-count check is updated.
A recorded baseline JSON next to docs/rust-port/benchmarks/baseline-2026-10-14.json, with the CPU named and medians and ranges for each case.
Failing-test sketch
record.py's own check ({key.split("/")[0] for key in entries} != CATEGORIES) fails RED once the categories are added without benches; GREEN when the benches exist.
Rules for this work (#756): portable stable Rust only (no std::simd/nightly), a scalar fallback with runtime CPU detection, ISA-specific code only in the crate's src/platform/ (Dylint ban_platform_cfg_outside_boundary). Tier 3 parity is bit-exact unless the C reference itself uses SIMD (docs/rust-port/testing-policy.md:296). RED then GREEN. Every kernel needs a benchmark in rust/tools/benchmarks/record.py first (sub-issue 1 of the meta issue).
Triage: acceptance criteria and a failing-test sketch are in the body, there are no open dependencies, and the #756 decisions settle the scope. P1: every other sub-issue of #3009 waits on these numbers.
Claiming: #3003, the benchmark baseline for the SIMD candidates of #3009.
Plan (one PR, RED then GREEN):
RED: add format, volmeter and audiomix to CATEGORIES in rust/tools/benchmarks/record.py (and the entry-count check). record.py's inventory check fails, because the benches do not exist yet.
GREEN: paired Rust-vs-C Criterion benches in rust/obs-c-oracle/benches/port_comparison/, with the same inputs on both sides:
format: UYVX→I420 and the NV12/I420 conversions at 1080p (rust/obs-media-io/src/format_conversion.rs vs libobs/media-io/format-conversion.c.h, SSE2).
volmeter: sample_peak, true_peak and the RMS (rust/obs-audio-controls/src/peak.rs, volmeter.rs vs libobs/obs-audio-controls.c.h) at 1024 frames.
audiomix: mix_into (rust/obs-core/src/audio_mix.rs vs libobs/obs-audio-mix.c.h) and the output clamp (rust/obs-media-io/src/ffi/audio_output.rs vs libobs/media-io/audio-io.c.h) at 1024 frames.
Recorded baseline JSON files next to docs/rust-port/benchmarks/baseline-2026-10-14.json, one for each machine, with the CPU named and the medians and ranges of each case:
x86_64 Linux: AMD Ryzen on our Proxmox host, in an LXC container with a pinned core (--cpu).
aarch64 macOS: Apple Silicon (MacBook Pro).
x86_64 Windows (MSVC): a Windows VM on the same Proxmox host.
Activity
zackees commentedon Oct 30, 2026
/ready
Triage: acceptance criteria and a failing-test sketch are in the body, there are no open dependencies, and the #756 decisions settle the scope. P1: every other sub-issue of #3009 waits on these numbers.
vpacher commentedon Oct 30, 2026
Claiming: #3003, the benchmark baseline for the SIMD candidates of #3009.
Plan (one PR, RED then GREEN):
RED: add
format,volmeterandaudiomixtoCATEGORIESinrust/tools/benchmarks/record.py(and the entry-count check).record.py's inventory check fails, because the benches do not exist yet.GREEN: paired Rust-vs-C Criterion benches in
rust/obs-c-oracle/benches/port_comparison/, with the same inputs on both sides:format: UYVX→I420 and the NV12/I420 conversions at 1080p (rust/obs-media-io/src/format_conversion.rsvslibobs/media-io/format-conversion.c.h, SSE2).volmeter:sample_peak,true_peakand the RMS (rust/obs-audio-controls/src/peak.rs,volmeter.rsvslibobs/obs-audio-controls.c.h) at 1024 frames.audiomix:mix_into(rust/obs-core/src/audio_mix.rsvslibobs/obs-audio-mix.c.h) and the output clamp (rust/obs-media-io/src/ffi/audio_output.rsvslibobs/media-io/audio-io.c.h) at 1024 frames.Recorded baseline JSON files next to
docs/rust-port/benchmarks/baseline-2026-10-14.json, one for each machine, with the CPU named and the medians and ranges of each case:--cpu).perf: obs-media-io: SIMD format conversion (Rust is scalar where the C is SSE2) #3004 asks for one x86_64 and one aarch64 machine. The Windows run shows whether MSVC vectorizes the C differently.
Draft PR within 48 h.
perf(bench): Record the SIMD candidates and repair the benchmark reco…
obs-audio-controls: Take the peak as _mm_max_ps does and read whole g…