Repository navigation
bench: Link stand-ins so port_comparison builds on Windows; record the Windows baseline (#3025) - #3039
Merged
Conversation
…ons its oracles name (#3025) The C ABI shims of obs-output and obs-hotkey and the output interleave oracle call 28 libobs functions by their libobs names; the cargo tests define stand-ins, the bench does not. lld-link reports them as undefined (26 on this base with /ERRORLIMIT:0, plus the two first-encoder-index helpers it reports once the others resolve), so the bench does not build on Windows. The test requires an exported definition of each in the bench (28 failures on the current port_comparison.rs) and that every name is still declared by a shim in some src/ffi module, so the list cannot go stale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s name (#3025) port_comparison.rs defines the 28 libobs functions that the obs-output and obs-hotkey shims and the output interleave oracle call by name. The cargo tests define recording stand-ins; the bench calls none of them, so these take no parameters and abort with the function's name if a bench ever does. lld-link on Windows can now resolve them; Linux and macOS linked before and are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows, platform.processor() is "AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD", so the Windows baseline of #3025 did not name its CPU. The test asks record.py's cpu_name() for ProcessorNameString from the registry on Windows (winreg is faked, so it runs on every host). Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows cpu_name() reads ProcessorNameString from HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0 (winreg) instead of platform.processor()'s CPU family string. Checked on the Windows VM: "AMD Ryzen 9 5950X 16-Core Processor". Co-Authored-By: Claude Opus 5.5 <[email protected]>
…3025) The Windows baseline shows equal times for format/<case> and format/<case>_c_scalar: oracle/format_conversion_scalar.c notes that MSVC's sse-intrin.h always takes <emmintrin.h>. Say so in format.rs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
record.py, 5 complete runs, 302 pairs, of 30e598af4 on a Windows 11 VM (12 vCPUs) on the Proxmox host of the Linux baseline: AMD Ryzen 9 5950X, MSVC 14.51 (VS 18 Build Tools, cl 14.51.36260), not pinned. This run came before the Windows cpu_name() fix and wrote "cpu": "AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD"; the chip name was filled in from the registry (ProcessorNameString). "cc" says "[WinError 2]": cl.exe is not on PATH, cc-rs finds MSVC through vswhere. Every other field is as recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=09ba5776f4617be4e48192ed9718432687281e4d secs=322 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793353475,"gate":"rust/all/fmt","host":"linux-x86_64","key":"93d9de7033ffb1ff95a204ed3508b387269f8f33e688233741a69f7b2c45aaf2","lane":"lint","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":72,"stamp":"adf83c071d44d332718947504458e3a2","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"93d9de7033ffb1ff95a204ed3508b387269f8f33e688233741a69f7b2c45aaf2","lane":"lint","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":72,"stamp":"ef77923d218568c5d79db425e6c968cf","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"38660475572433ac741eb54cce25d4dbaa31341ab1b98c13d369f849d491946d","lane":"rust-test","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":156,"stamp":"719691af07f17a8fede9869a2f1e68cd","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"3c6f5314cee6054d8981438876171aad0e6c1262bc4ed240ada2794ac952645f","lane":"cross","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":94,"stamp":"589428ddf4dc1d20f2aecbd99ff28d7d","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"3c6f5314cee6054d8981438876171aad0e6c1262bc4ed240ada2794ac952645f","lane":"cross","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":94,"stamp":"d000b00075a435d2310a5cb89c5115ad","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"3c6f5314cee6054d8981438876171aad0e6c1262bc4ed240ada2794ac952645f","lane":"cross","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":94,"stamp":"aa01393c47e5af642bf896b01dddd3d6","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"3c6f5314cee6054d8981438876171aad0e6c1262bc4ed240ada2794ac952645f","lane":"cross","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":94,"stamp":"a942095841fd1dafa0ff7933fcf72cd9","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"} Ci-Attestation: {"at":1793353475,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"0a532e0b52a020706d8883b9b376855a22a46551a0be9d86916f936516ac20d4","lane":"tier2-linux","parents":["5ba7e6deca25d2325486c1eddadd4e52eb4996d9"],"secs":309,"stamp":"fa8a3e53097fa06e033ebf29c5da1b21","tree":"09ba5776f4617be4e48192ed9718432687281e4d","v":1,"via":"run"}
vpacher
marked this pull request as ready for review
October 30, 2026 10:04
Member
Author
|
Ready for review. CI is green ( Auto-merge is off on purpose: please comment before it merges. The Windows numbers are also summarized on #3009 (comment of 2026-10-30) next to the x86-64-v3 info run. |
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.
Fixes #3025
What and why
The
port_comparisonbench ofobs-c-oracledid not link on Windows (MSVC,rust-lld), sorecord.pycould record no Windows baseline for #3009. The C ABI shims ofobs-outputandobs-hotkeyand the output interleave oracle (oracle/output_interleave.c) call libobs functions by their libobs names; the cargo tests define stand-ins for them, the bench did not. No bench calls them, so the Linux and macOS linkers leave the unused callers out;lld-linkreports every name.lld-linkstops at 20 errors; with/ERRORLIMIT:0the list is 26 on master, plus the two first-encoder-index helpers that appear once the others resolve. bench: port_comparison does not link on Windows (18 undefined libobs symbols) #3025 listed only the first 18.port_comparison.rsgets an inline modulelibobs_stand_inswith the 28 functions: no parameters,-> !, they abort with the function's name if a bench ever calls one. Inline, because every file inport_comparison/is a bench unit and a new file directly inbenches/would become a bench target of its own.ci/test_bench_libobs_stand_ins.pyrequires an exported definition of each name, and that each name is still declared by a shim in somerust/*/src/ffi/module, so the list cannot go stale. Linux CI cannot link for Windows, so the Windows build below is the check that counts.record.py'scpu_name()reads the registry on Windows:platform.processor()gives only "AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD".format.rsnotes that on MSVC the_c_scalaroracle is native SSE2 too (oracle/format_conversion_scalar.c: MSVC'ssse-intrin.halways takes<emmintrin.h>).Windows evidence (Windows 11 VM, MSVC 14.51, soldr 0.9.44)
soldr cargo bench -p obs-c-oracle --bench port_comparison --no-run(/ERRORLIMIT:0)-- --testmacOS smoke on GREEN: passes, 604 benches. Linux: the local gate below.
Windows baseline
docs/rust-port/benchmarks/baseline-2026-10-30-windows-x86_64.json:record.py, 5 complete runs, 302 pairs, measured on the GREEN head before the rebase onto 5fe22f0 (no.rs,.c,.hor.tomlfile changed in between). Windows 11 VM (12 vCPUs) on the Proxmox host of the Linux baseline of #3029: AMD Ryzen 9 5950X, MSVC 14.51 (VS 18 Build Tools, cl 14.51.36260), not pinned.The run came before the Windows
cpu_name()fix and wrote the CPU family string; the chip name was filled in from the registry (ProcessorNameString).ccsays[WinError 2]:cl.exeis not onPATH, cc-rs finds MSVC through vswhere. Every other field is as recorded.Rust/C medians next to the Linux baseline of #3029 (same CPU; below 1: Rust is faster):
format/uyvx_to_i420format/uyvx_to_nv12format/uyvx_to_i444format/i420_to_uyvxformat/nv12_to_uyvxformat/uyvy_to_uyvxformat/yuy2_to_uyvxvolmeter/sample_peak/1024volmeter/true_peak/1024audio_mix/mix_whole_tickaudio_mix/output_tick/stereo_6_mixesThe compress gap of #3004 is the same with MSVC. The scalar decompress C is slower with MSVC than with GCC, so there the Rust is equal or faster; the
sample_peakgap of #3005 is half as large.RED → GREEN
ci/test_bench_libobs_stand_ins.py: 28 failures; Windows build: 28 undefined symbols). 6c0ad36 (Windows CPU name: 1 failure).ci/test_bench_libobs_stand_ins.py2/2,ci/test_benchmark_record.py8/8; Windows build and smoke as above (the CPU name also checked on the Windows VM).ci/test files, 10 cases, under 1 s; no Rust test added.Checklist
master🤖 Generated with Claude Code