Skip to content

libobs: characterize and extract source audio-capture callback registration (Refs #5236) - #5242

Merged
zackees merged 4 commits into
masterfrom
test/5236-source-audio-capture
Nov 19, 2026
Merged

zackees merged 4 commits into
masterfrom
test/5236-source-audio-capture

Conversation

@zackees

@zackees zackees commented Nov 19, 2026

Copy link
Copy Markdown
Member

Refs #5236

Add a deterministic C-source characterization for obs_source_add_audio_capture_callback and obs_source_remove_audio_capture_callback using the real private source and audio_cb_info layouts, including native pointer alignment and padding. It covers NULL-source diagnostics, append order, duplicate pairs, first exact matching removal, absent/repeated removal, exact callback/parameter identity including NULL values, one balanced lock/unlock on the source's audio_cb_mutex, mutation inside the lock, unchanged unrelated source bytes, and zero callback invocation. The fixture uses libobs's real darray allocator and frees its list the same way as source teardown; it needs no device, OBS startup or own threads. SOURCE_AUDIO_CAPTURE_EXTERNAL leaves the assertions ready for a later separately linked Rust swap with real list/lock adapters.

Extract only the two original wrappers verbatim into libobs/obs-source-audio-capture-callbacks.c.h, registered in the sorted core-source unity group. C retains mutex/list/allocator ownership, and audio delivery and teardown stay unchanged. Add the tests.d pointer and sorted canonical graph entry; the existing source-set/module inventories discover the new group member. No Rust, public-header, existing-C-test, WebSocket, workflow or user-visible behavior changes.

Characterization commit 81572e2 passed all three cases against both libraries using the original C bodies. RED 9373719 requires an extracted unit absent from its committed tree: a compile replay of that tree fails at the missing include in the new C test. GREEN supplies the byte-identical bodies and removes the originals. Build-group/module, graph-sort and port-metadata checks pass. The whole native_build:: module passes all 320 tests (zero failures/ignored, 49.48 seconds test execution).

The source footprint is distinct from rdoupe's accepted #5228 weak-handle swap. Refreshed claim/PR searches found no competing callback-registration claim and no competing callback-registration PR. Forced fetched PR heads and merge-tree checks combine cleanly with independent graph changes, rdoupe's #5225 and his new S-group #5238 (head d5cc057). The combined S group stays sorted and retains this extraction alongside the weak-control adapter; the units touch separate source files. Pre-existing conflicts in unrelated, unqueued work are recorded in the worker evidence.

This C-only prerequisite leaves new Rust Tier 1/Tier 3 implementation and differential/mutation tests to a separate obs-source swap. Network Tier 4 does not apply. Native Windows/macOS runtime and hosted PR/merge-group results are not claimed.

Final Linux Tier 2 rebuilt the extracted core-source group and both libraries, built the new target plus EVERY one of the 64 configured *_rust targets with keep-going enabled, and passed the new recorder and unchanged test_audio_controls, test_source_audio_input, test_source_audio_output and test_source_audio_ranges three repetitions against each library. Export sets remain identical at 1,769 symbols. All 17 focused inventory/metadata/sort checks pass. The first Windows attempt was refused by soldr's no-cache preflight while the native test build held the local target lock; it was retried sequentially after that build finished, with no lock override.

The two sentinel callbacks have observably different counter effects so release-linker identical-code folding cannot collapse the callback-identity matrix. Neither callback may execute during registration/removal; every operation and teardown assert the counter remains zero.

ci/windows_link_check.py passed all eight Windows MSVC Rust test-category links, hybrid libobs, and all 55 selected standalone Rust fixtures for each of Windows MSVC x86_64 and Darwin arm64 (455.49 and 515.05 seconds for those fixture legs). The separately invoked ci/cmocka_link_check.py --alias mac-arm64 also passed (121.14 seconds). The final new C characterization, including distinct sentinel callbacks, was explicitly compiled and linked for both cross targets. These checks prove linkage, not native Windows/macOS runtime behavior.

The single full SOLDR_PORCELAIN=0 ./lint run passed in 177.3 seconds, including formatting, repository validators/self-tests, inventories and configured analysis. Unchanged Rust inputs reused matching soldr passing verdicts where reported. No source files changed after validation.

The ./push client proof also passed six-target Clippy/Dylint (168.9 seconds), repository validators/self-tests, all 9,184 host tests with six additional skips, all 920 feature-set tests, documentation checks and Windows GNU workspace linking (client-test 493.2 seconds). Optional Swift evidence was unavailable because swift-format is absent; no Swift files changed. The signed published head is 094e4aa; ./push verified its signature, and the remote head matches exactly.

…Refs #5236)

Ci-Attestation: {"at":1795095260,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":144,"stamp":"5992ee767ed7ef5ea56a0c51c1425150","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095260,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":144,"stamp":"a9f7955141a3332495db35989ca8013c","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095260,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":144,"stamp":"62807f6fe52f2ff22d1bdacaaf4439c6","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095260,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":144,"stamp":"dc6fa7461c4317f4ea8075bbf049dfe5","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"general/all/client-lint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"070535231fbed9906ad4540dd91a7086","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095260,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":144,"stamp":"863095f9d6030bea74eff72ecf6f97b9","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095116,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"747b7026fa3c76462ce15bcffe5e0cee","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095116,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"07ec4f3da63f7ba589a55c3aff95b46e","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"a7f18f32962e6ceb10288cc927a1e7f2","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"d6f7bfbd4da8dc57e03cd103701497fd","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"ba4294a8646d8bab248ebf37d814aadf","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"7a4a25e063c755b22b5f2d4ab322a581","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"de238a1dea1d3c5cad9f5998ae893640","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"e06895d9c551909ba04ce384b7ac1a79","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"9453d5deb0e271e1e9d758d8153dfc77","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"1adc8741eb29c0a9285f6c0ac3d196d1","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"5409e06111bb0c39c029113df6bec636","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095115,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"97079e9e3cf903d5e1b27a91f5653304ff868f8a0444752920a972718b976533","lane":"client-lint","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":169,"stamp":"2bf393164841fccdfd6307c6ac4b619e","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}
Ci-Attestation: {"at":1795095755,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"d07fcedc16ea0fabf990c91e173f238dd533403d36d00bba4785f1c67c047829","lane":"client-test-x86_64-unknown-linux-gnu","parents":["5fc0ddb11e3269b36d11ec842aab35dee545d0fe"],"secs":493,"stamp":"2e92342925095250c51b05b6f83c749c","tree":"81cb3e2e877e38828fc4bca354822880906e4c55","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"e6942badc9ef36cd7b63a6f4fced41d4aa090e55","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/obs-source-audio-capture-callbacks.c.h","libobs/obs-source.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_source_audio_capture_callbacks.c","test/cmocka/tests.d/test_source_audio_capture_callbacks.cmake"],"head":"6492ac8653edf114b4140a1854bae8e6b59bcddc","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"76c6fe2451e85ba1a2c508cdf97e8582a89ec2d43ffc340474276fe31acea41a","tree":"81cb3e2e877e38828fc4bca354822880906e4c55"}}
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees enabled auto-merge November 19, 2026 13:43
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit 2ab5188 Nov 19, 2026
41 checks passed
@zackees
zackees deleted the test/5236-source-audio-capture branch November 19, 2026 14:33
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.

1 participant