Skip to content

perf(bench): drop the port_comparison stand-ins obs-hotkey now exports (#3112) - #3113

Merged
zackees merged 2 commits into
masterfrom
infra/3112-bench-stand-ins
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/3112-bench-stand-ins

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

What

The port_comparison bench — the binary every number in docs/rust-port/benchmarks/ comes through, via record.py — stopped linking on master: #3075 exported obs_hotkey_binding_press() / obs_hotkey_binding_release() from obs-hotkey as real #[no_mangle] shims, and the bench still defines #3025's link stand-ins for the same two names.

rust-lld: error: duplicate symbol: obs_hotkey_binding_press
  >>> defined at port_comparison.…-cgu.14
  >>> defined at obs_hotkey.…-cgu.1 in libobs_hotkey-….rlib
rust-lld: error: duplicate symbol: obs_hotkey_binding_release

No PR CI lane builds benches, so this is green in CI and only bites whoever next runs record.py — which today is the only way to measure the format, audio_mix and volmeter categories (#3009), so it blocks the before/after numbers of #3111, #3004, #3007 and #3029.

Fixes #3112.

Commits

  • RED 831b86daa — ci/test_bench_libobs_stand_ins.py gains test_no_symbol_is_exported_by_a_workspace_crate. It fails on master:

    AssertionError: True is not false : obs_hotkey_binding_press is exported by a
    workspace crate; drop its stand-in from rust/obs-c-oracle/benches/port_comparison.rs
    and from SYMBOLS
    … obs_hotkey_binding_release …
    FAILED (failures=2)
    
  • GREEN — the two stand-ins and their SYMBOLS entries are gone; the real obs-hotkey shims satisfy the C oracle's references.

Verification

  • uv run python -m unittest ci.test_bench_libobs_stand_ins → Ran 3 tests … OK.
  • soldr cargo bench -p obs-c-oracle --bench port_comparison --no-run → links, Finished bench profile in 4.48s (the same command failed with the duplicate symbol at 06e8b43e5 before the change).
  • uv run rust/tools/benchmarks/record.py --category format --cpu 7 → Recorded 14 complete comparisons (all 14 format cases, Rust and _c_scalar), i.e. the measurement path works again. Absolute numbers from that run are only indicative: this host is a Ryzen 7 3700X running four worker checkouts, so the ratios are far noisier than the recorded 5950X baseline and I am not publishing them here.

Notes

  • docs/features.md: no line — a bench link fix is not user-visible (coordination.md §4).
  • The new test is the durable half: it fails the day any future port exports a name the bench still defines as a stand-in, instead of leaving it to a hand-run bench.

The port_comparison bench defines stand-ins for libobs functions the C
oracle objects call by name. Once a port ships the real #[no_mangle]
shim, the bench binary holds two definitions and neither rust-lld nor
lld-link will link it (#3075 did that to obs_hotkey_binding_press and
_release, and the bench has been unbuildable since). No bench build runs
in PR CI, so nothing caught it.

Red: this test fails on master for those two names.
obs_hotkey_binding_press() and obs_hotkey_binding_release() are real
#[no_mangle] shims in obs-hotkey since #3075, so the bench's stand-ins
for them are duplicate definitions and the bench binary would not link:
rust-lld reports 'duplicate symbol' on Linux/macOS and lld-link fails the
same way on Windows.

Green: the bench links again (soldr cargo bench --no-run) and the new
test passes. record.py --category format completes once more, which is
what #3111's before/after numbers need.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review: correct follow-on from #3075. Dropping the two stand-ins removes the duplicate definitions. The new guard test scans for #[unsafe(no_mangle)] exports, the only form edition 2024 allows, so it will catch the next port that collides with a bench stand-in.

@zackees
zackees added this pull request to the merge queue Oct 30, 2026
Merged via the queue into master with commit 1d07cff Oct 30, 2026
36 checks passed
@zackees
zackees deleted the infra/3112-bench-stand-ins branch October 30, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

perf(bench): port_comparison no longer links on master — duplicate obs_hotkey_binding_press/_release after #3075

1 participant