Skip to content

bench: port_comparison does not link on Windows (18 undefined libobs symbols) #3025

Closed

Description

@vpacher

What

The port_comparison bench of obs-c-oracle does not link on Windows (MSVC target, rust-lld). Found while recording the baselines of #3003. Same result on master (3d4e696) and on the #3003 branch, so it is not caused by #3003:

soldr cargo bench -p obs-c-oracle --bench port_comparison --no-run
error: linking with `rust-lld` failed: exit code: 1
  rust-lld: error: undefined symbol: obs_output_interleave_fields
  ...

The 18 undefined symbols:

obs_encoder_get_name, obs_encoder_group_num_started, obs_encoder_interleave_info, obs_encoder_packet_create_instance, obs_encoder_packet_release, obs_hotkeys_mutex_lock, obs_output_actual_start, obs_output_actual_stop, obs_output_begin_data_capture, obs_output_can_begin_data_capture, obs_output_caption_track_fields, obs_output_delay_fields, obs_output_delay_signal, obs_output_get_name, obs_output_initialize_encoders, obs_output_interleave_active, obs_output_interleave_add_caption, obs_output_interleave_fields.

Machine: Windows 11 LTSC 2024 VM, MSVC toolchain, soldr 0.9.44, Rust 1.98.1.

Probable cause

The C ABI shims of obs-output, obs-encoder and obs-hotkey call these libobs C functions through extern "C". The test binaries define stand-ins for some of them (for example obs-hotkey/tests/hotkey/main.rs, "Cargo-test stand-ins for libobs's hidden obs_hotkeys_mutex_lock"). The bench defines none. On Linux and macOS the bench links, probably because the linker removes the unused shim functions before it reports undefined symbols; lld-link on Windows reports them first. This part is not verified.

CI does not build the benches on Windows, so nothing reports it.

Impact

Low. Only the bench binary is affected; no shipped code and no test. But record.py cannot record a Windows baseline (docs/rust-port/release-criteria.md), and the SIMD work of #3009 cannot show MSVC numbers.

Proposed fix

Stand-ins for the 18 symbols in the bench (as the tests have them), or a shared stand-in module in obs-c-oracle that the tests and the bench both use. Acceptance: soldr cargo bench -p obs-c-oracle --bench port_comparison -- --test passes on Windows; optionally a Windows CI step that builds the bench with --no-run.

Activity

  1. vpacher commented on Oct 30, 2026

    @vpacher
    MemberAuthor

    Claiming: #3025.

    Cause, now confirmed in the source: rust/obs-c-oracle/oracle/output_interleave.c keeps the libobs names of the accessors it calls (obs_output_interleave_fields(), obs_encoder_packet_release(), obs_output_get_name() and the others), and its header says that "the cargo test that links this file defines them" (rust/obs-output/tests/output/interleave_parity.rs). The port_comparison bench links the same oracle and shims but defines none of them. No bench calls them, so the Linux and macOS linkers leave them out; lld-link reports them.

    Plan (one PR, RED then GREEN):

    1. RED: a ci/ test that requires each of the 18 symbols to have a definition in the bench, and a local RED on Windows: soldr cargo bench -p obs-c-oracle --bench port_comparison --no-run fails to link.
    2. GREEN: a bench module with stand-ins for the 18 symbols, on every platform. They abort with the symbol's name if they are ever called (no bench calls them today). The Windows smoke run (-- --test) passes, and Linux and macOS stay as they are.
    3. The Windows (MSVC) baseline from record.py, next to the Linux and macOS ones of chore: perf: benchmark the SIMD candidates in record.py (format conversion, volume meter, audio mix) #3003.

    Draft PR within 48 h.

  2. added
    ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions