Skip to content

obs-c-oracle: Drop timer stand-ins Rust defines - #4811

Merged
zackees merged 2 commits into
masterfrom
fix/4786-bug-obs-c-oracle-port-comparison
Nov 13, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/4786-bug-obs-c-oracle-port-comparison

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4786
Fixes #4615

What and why

soldr cargo test -p obs-c-oracle --locked --bench port_comparison stopped linking on master after the timer dispatch port (#4557) and the timer-range dispatch port (#4595): those made gs_timer_destroy, gs_timer_begin, gs_timer_end, gs_timer_get_data and the four gs_timer_range_* twins Rust entry points in obs-graphics, which the bench links, while rust/obs-c-oracle/oracle/source_profiler_host.c still defined do-nothing stand-ins under the same names for the source profiler shim. The bench is not part of PR CI, so both ports were green.

This drops those eight stand-ins and keeps gs_timer_create, gs_timer_range_create and the libobs stand-ins that are still C. Every binary that links the source profiler shim (the core test binary and the bench) also links obs-graphics, and with no graphics context the Rust entry points do nothing and return false, as the stand-ins did, so the source profiler parity is unchanged. The file's header comment says so. Test-only change: nothing in libobs or the shipped library changes.

Since PR CI does not run the bench, the RED commit adds shim_timers_are_obs_graphics_dispatch to the source profiler parity tests in obs-tests-core, which PR CI does run: it calls gs_timer_destroy and gs_timer_range_destroy with no graphics context and checks they log what obs-graphics' dispatch logs (<name>: called while not in a graphics context). While the stand-ins exist they can win the link instead, log nothing, and the test fails.

#4615 and #4786 report the same failure; this closes both. No upstream issue.

RED → GREEN

  • RED commit: a018317 (test: Pin the source profiler's timer entry points). obs_core::source_profiler_parity::shim_timers_are_obs_graphics_dispatch fails: left: Ok(""), right: Ok("gs_timer_destroy: called while not in a graphics context"); --test-diff: 8437 passed, 1 failed (that test), 6 skipped. On the same tree the bench fails to link with eight rust-lld: error: duplicate symbol: gs_timer_* errors (gs_timer_destroy, _begin, _end, _get_data, gs_timer_range_destroy, _begin, _end, _get_data), then could not compile obs-c-oracle (bench "port_comparison").
  • GREEN: the bench links and runs, every case passes, including source_profiler_frame/rust and /c, with its per-module allocation check. Source profiler tests in obs-tests-core: 37 passed. --test-diff origin/master: 8438 passed, 6 skipped. --lane lint, --lane dylint, --lane cross, Windows MSVC clippy --workspace --all-targets -D warnings and ci/windows_link_check.py (every test binary linked for MSVC) pass. Runs were on 736f08f728 (GREEN) and fe5ab04bde (RED); after the rebase, ./unittest (Rust 8438 passed, 6 skipped; Tier 2 922/922 on hybrid and on the C reference), the bench, dylint, cross and Windows clippy were rerun, and the head is stamped by the local gate.
  • Test cost: one new test, longest 0.01 s, peak RSS 13 MB (whole test binary), no own threads, no proptest.
  • Real app (UI, protocol output or logging changes): N/A, test-only change.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (N/A for docs-only; a focused CI fix may push RED and GREEN together)
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC (not applicable: no warning or flag change)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports) (not applicable: not a port)

The source profiler shim calls gs_timer_destroy, _begin, _end,
_get_data and their gs_timer_range_* twins, which obs-graphics now
defines. oracle/source_profiler_host.c still defines do-nothing
stand-ins under the same names, so a binary that links both has two
definitions: the port_comparison bench fails to link with eight
duplicate gs_timer_* symbols.

Add a test to the core test binary that calls gs_timer_destroy and
gs_timer_range_destroy with no graphics context and checks that they
log what obs-graphics' dispatch logs. With the stand-ins winning the
link, nothing is logged and the test fails.

Refs #4786.
Refs #4615.
The timer and timer-range dispatch ports made gs_timer_destroy, _begin,
_end, _get_data and the four gs_timer_range_* twins Rust entry points in
obs-graphics. oracle/source_profiler_host.c still defined do-nothing
stand-ins under the same names for the source profiler shim, so the
port_comparison bench, which links obs-graphics, failed with eight
duplicate symbols.

Drop those eight stand-ins and keep gs_timer_create,
gs_timer_range_create and the libobs stand-ins that are still C. With
no graphics context the Rust entry points do nothing and return false,
as the stand-ins did, so the source profiler parity is unchanged.

Fixes #4786.
Fixes #4615.

Local-Gate: v1 tree=4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94 secs=2494 lanes=lint:run,dylint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a,client-checks:run,client-swift:n/a,client-lint:run,client-test:run,client-test-x86_64-unknown-linux-gnu:run,client-test-aarch64-unknown-linux-gnu:n/a,client-test-x86_64-pc-windows-msvc:n/a,client-test-aarch64-pc-windows-msvc:n/a,client-test-x86_64-apple-darwin:n/a,client-test-aarch64-apple-darwin:n/a
Ci-Attestation: {"at":1794542277,"gate":"rust/all/fmt","host":"linux-x86_64","key":"06d36fb5278a539316bff66f4382fa71b018a99396b742dae475c741a7d17fa8","lane":"lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":61,"stamp":"e993232d16168d83074dbf70fd0c301c","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"06d36fb5278a539316bff66f4382fa71b018a99396b742dae475c741a7d17fa8","lane":"lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":61,"stamp":"84dd83775a5dc63336dcd0badca15c2a","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"7f7aceb3744dd33140b6929f22a7dbe223642c5b77259b393465e39337990b47","lane":"dylint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":0,"stamp":"9dcbf6763f1c794bbc457445e663b0c0","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"6bf5ba160e00a424e277fba880b50fcf8fcd6ae94847fa4beaba56cc8e196f20","lane":"rust-test","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":288,"stamp":"e15d2d170b00f43ea308e017546333c8","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"3a5c32f3a177be1de4f0e12b436f7c85e85464fe7e74a3ae444f13b4314d06a9","lane":"cross","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":567,"stamp":"3a35447c0526135864b342690aeb91ad","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"3a5c32f3a177be1de4f0e12b436f7c85e85464fe7e74a3ae444f13b4314d06a9","lane":"cross","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":567,"stamp":"6632322a9d8019409c39605ddd9a973f","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"3a5c32f3a177be1de4f0e12b436f7c85e85464fe7e74a3ae444f13b4314d06a9","lane":"cross","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":567,"stamp":"bd166fee6fa71c8ee644a64f70664ccf","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"3a5c32f3a177be1de4f0e12b436f7c85e85464fe7e74a3ae444f13b4314d06a9","lane":"cross","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":567,"stamp":"31c489b0aced21aace01b07c334b6c97","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"9777453c492b79cddc09f10405d4b57fa8d9c3e4ec9163ccfde1f620696b9f95","lane":"tier2-linux","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":2493,"stamp":"1e6552bb07c726868c8c7dbce67cdf2a","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"python/all/self-test","host":"linux-x86_64","key":"3cdc5de65765a2beb9ddfbc1fca0e2130a7cc09898055d78ea3a3a6c40529af1","lane":"client-checks","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":65,"stamp":"b9d757281c46cfebdbc09020e4b6c289","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"general/all/client-lint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"38d2e2c599c264f69d4eb1a6f4ae88d7","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"78baec8ba99938fecc1bcd54b75cb7d0","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"9159a23a3fa4195d5507051509adf181","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"4ac8373241ed23c2b058e30bf0bb6ee6","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"56eb2c7e894e9c3d70e8ff3a2f8baaf0","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"690f550516a559fdd987fbc3305480c9","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"98fa00500374a32d55785e20b2f2d673","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"27d75dd9c3f8b86fb5eecdc83a7afadc","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"f6c1ae1df121b439373657f6e03d6646","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"5c092fb854f15d7a1d45865ae793b211","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"3c2811dc5b8467e773fff7e518adc4a0","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"88e841528b58a0e589ec4376282d7893","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ab657eea7d34328929892e47d61617dbc4eb7cf65600785f2d84e82f648897b9","lane":"client-lint","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":73,"stamp":"7f2ba097977861e177fefa97ea5dc6c9","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
Ci-Attestation: {"at":1794542277,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"34b50307ba88a285cd5f747a67f882b116d79e9c18c58dd3241688c87cc3f6f3","lane":"client-test-x86_64-unknown-linux-gnu","parents":["a018317d4c87673b753419a77be0eeaece267aa0"],"secs":281,"stamp":"d5cb1c65f8da68bd85466cb18f5dea88","tree":"4d9e6e90d641da995d4e462a5ad3f0e3e60a4f94","v":1,"via":"run"}
@rdoupe
rdoupe marked this pull request as ready for review November 13, 2026 04:20
@rdoupe
rdoupe requested a review from zackees as a code owner November 13, 2026 04:20
@zackees
zackees added this pull request to the merge queue Nov 13, 2026
@rdoupe

rdoupe commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Handed off to the coordinator

Merged via the queue into master with commit 267f78e Nov 13, 2026
42 checks passed
@zackees
zackees deleted the fix/4786-bug-obs-c-oracle-port-comparison branch November 13, 2026 05:06
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.

bug: obs-c-oracle: port_comparison bench has duplicate gs_timer symbols bench: port_comparison links gs_timer stand-ins twice

2 participants