Repository navigation
perf(bench): drop the port_comparison stand-ins obs-hotkey now exports (#3112) - #3113
Merged
Merged
Conversation
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
commented
Oct 30, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
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.
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.
What
The
port_comparisonbench — the binary every number indocs/rust-port/benchmarks/comes through, viarecord.py— stopped linking on master: #3075 exportedobs_hotkey_binding_press()/obs_hotkey_binding_release()fromobs-hotkeyas real#[no_mangle]shims, and the bench still defines #3025's link stand-ins for the same two names.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 theformat,audio_mixandvolmetercategories (#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.pygainstest_no_symbol_is_exported_by_a_workspace_crate. It fails on master:GREEN — the two stand-ins and their
SYMBOLSentries are gone; the realobs-hotkeyshims 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 at06e8b43e5before the change).uv run rust/tools/benchmarks/record.py --category format --cpu 7→Recorded 14 complete comparisons(all 14formatcases, 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).