Repository navigation
obs-source: port obs_source_add_active_child and obs_source_remove_active_child to Rust (Fixes #5622) - #5633
Conversation
…ive_child verbatim (Refs #5622) Move the two bodies, with struct descendant_info and check_descendant() (used only by add), unchanged out of obs-source.c.h into obs-source-active-child.c.h, still compiled in the live core-source group. The full-tree walk with a stop source, enum_source_full_tree(), is static in obs-source.c.h. obs-source.c.h gains a hidden wrapper, obs_source_active_child_enum_full_tree() (no EXPORT), that only calls it; the extracted file declares the wrapper and maps the original name onto it with a scoped macro, so the bodies stay verbatim and the file also builds in a translation unit of its own. No Rust, no behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…active_child (Refs #5622) New cmocka test test_source_active_child (tests.d + test-graph.json) on private sources of a started core, calling the real libobs exports. A node source type lists children through enum_all_sources (the full-tree walk), counting its walks and optionally reporting another source as the edge's parent, and records its own show/activate counters each time its enum_active_sources runs (once per counter an activation raises). - NULL parent or child: one LOG_DEBUG "<function>: Null 'parent' parameter" (or 'child', parent checked first); add returns false; nothing walked or activated. - add(parent, parent): one LOG_WARNING "obs_source_add_active_child: parent == child", false, no walk. remove(parent, parent) has no such check and deactivates the source itself. - add walks the child's tree once and refuses, silently and with nothing activated, a parent listed by the child, deeper down, or reported as an edge's parent; a real cycle is refused without walking the parent (the stop source). - Accepted: show_refs(parent) activations, the first activate_refs MAIN_VIEW and the rest AUX_VIEW, in that order; more active than shown is all MAIN_VIEW, a negative show count activates nothing, a negative active count is all AUX_VIEW, adding twice activates twice, a hidden parent activates nothing. - remove mirrors add with deactivations (MAIN_VIEW first), never walks or checks for a cycle, and lowers only counters above zero. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tier 1 mirrors of test_source_active_child in the existing obs-tests-core binary (rust/obs-source/tests/source/active_child.rs), on a model of what the core reaches through obs-source::active_child's Libobs trait: nodes listing children through the full-tree walk (with the C's stop source), the two counters per node, and obs_source_activate/deactivate recording the counters each time the activation's tree walk runs. They also pin the call order: the walk of the child with the parent as stop source, then show_refs and activate_refs loaded once each, then the activations; remove loads and deactivates without a walk. They run against todo!() cores: test result: FAILED. 0 passed; 19 failed panicked at rust/obs-source/src/active_child.rs:69:5: not yet implemented: #5622 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tive_child to Rust (Fixes #5622) - Safe core obs-source::active_child::{add, remove} over a Libobs trait: NULL parent, then NULL child, logged with the function's name; add refuses parent == child with its LOG_WARNING line, walks the child's full tree once with the parent as the stop source and refuses when an edge names the parent as its child or its parent (check_descendant()); then show_refs and activate_refs are loaded once each, in that order (#2081), and the child is activated show_refs times, MAIN_VIEW for the first activate_refs, AUX_VIEW after. Remove mirrors the loop with deactivations, with no self or cycle check. - C ABI shims in ffi/source_active_child.rs: the walk through obs-source.c.h's hidden obs_source_active_child_enum_full_tree() with a Rust edge visitor, the two atomic loads through the new libobs/obs-source-active-child-fields.c.h (live core-source group, no EXPORT), obs_source_activate()/deactivate() called directly. - The extracted file moves to the reference-only group libobs.ported-source-active-child (+ ported-source-sets JSON); both names are EXPORT in obs.h, so they go into rust-exports.d/obs-source-source_active_child.txt. - Oracle: oracle.d/source-active-child.list and oracle/source_active_child.c (the original C renamed oracle_*, the production counter adapters, and a scripted stand-in walk). The test-only oracle/source_active_child_links.c, which defined both names for the obs-source-seam shims in the test binaries, is removed: the Rust exports define them there now. - Tier 3 active_child_parity.rs: every walk (root, stop), activation and deactivation in order, the result, the log lines and every other byte, with and without the parent's counters changing under the loop, over a grid, a proptest and pinned answers; ten shim mutants rejected. - obs-build registration test and a rust/README.md row. The full-tree walk and obs_source_activate()/deactivate() stay C. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795605008,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":94,"stamp":"671f5da94f6c32825242debdb4d270f6","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795605008,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":94,"stamp":"9113f36448834b8633f9d4b06ea42ec5","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795605008,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":94,"stamp":"79038e20f42121d5794a86763e89bb11","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795605008,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":94,"stamp":"e63192f5ce3e52c48740e6a8dcb1a5f5","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"general/all/client-lint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"51b83cf3161196bc34b0597fb52a4c48","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795605008,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":94,"stamp":"6b9682e054dd1b50ea96e95bd25d8cb1","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"7e9b105c099ded91ce5ece83409f4941","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"6b032967bad81389a8d6aeb9ad09d911","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"18dea2796da65f48555e5cce63294faa","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"809d1f50c2ad602065cc0550eef89bab","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"defa2d68cbb78335ffcc5be0fb4135fd","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"86fdcfe6189ed441ae1c5e5e562aebc6","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"e753b6742285ae6f0f341c749cc60849","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"9db60eb7e79ad17d132b69de513f5bb7","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"6a250a36cb7288c891b54a207a57777c","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"2425cd5f78ed09647184336944dd4f82","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"2b28ecb68a73b02fff18e37c81d24515","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795604913,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ebc330c44b70f11dcbfefc79679eb887c88f2e0d8c13f523a66d7230984093d7","lane":"client-lint","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":79,"stamp":"24fc83bc7b6ffaf049cf19048af3e4c7","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Ci-Attestation: {"at":1795605293,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"ce34c39238da534ff4b4b09df143c8655a7b02fe44f1ae2228a685b35763acc1","lane":"client-test-x86_64-unknown-linux-gnu","parents":["cbb9a3e1ca4d11654617f9f5ba0e92077a74ed59"],"secs":285,"stamp":"ee69c5798f7f4efd808289c1cd7f679e","tree":"a6a112957179976fabca922c57366617caca2e3c","v":1,"via":"run"} Client-Checks: {"checks":{"base":"1d300d1875ffcf3972e63d7fa64de00a494a16cb","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-active-child+.h.c","libobs/build/ported-source-sets/source-active-child.json","libobs/cmake/rust-exports.d/obs-source-source_active_child.txt","libobs/obs-source-active-child-fields.c.h","libobs/obs-source-active-child.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_active_child_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-active-child.list","rust/obs-c-oracle/oracle/source_active_child.c","rust/obs-c-oracle/oracle/source_active_child_links.c","rust/obs-c-oracle/oracle/source_transition_restore_links.c","rust/obs-c-oracle/oracle/source_transition_switch_links.c","rust/obs-source/src/active_child.rs","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_active_child.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/active_child.rs","rust/obs-source/tests/source/active_child_parity.rs","rust/obs-source/tests/source/main.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_active_child.c","test/cmocka/tests.d/test_source_active_child.cmake"],"head":"6b965a91ec93b02e56f7e1e19c80cb4a5d0e466a","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.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-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"7872959627029037d541ed38b1125f5df8a3fc0419a947e04ff31b3ff720670a","tree":"a6a112957179976fabca922c57366617caca2e3c"}}
) Releasing a fixture source queues its destruction on libobs's destruction thread, which logs. On macOS those lines landed inside the next test's log capture (merge queue run 45615671599: remove_parent_equals_child_deactivates_itself saw 9 messages, expected 0). Teardown now waits for the destroy queue. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795620052,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":95,"stamp":"3209fb1fff13f4ec76ee1330a2720852","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795620052,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":95,"stamp":"dff4ad514affec0f323ac8214feb0fb9","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795620052,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":95,"stamp":"37a1c0dfb953235554b2b8af1fe34d75","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795620052,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":95,"stamp":"2dde50d60ed3c344f57bf845a19a5a61","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"general/all/client-lint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"a6a14682b0b489f503a1754882a9e8c7","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795620052,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":95,"stamp":"92b86293790e303003557b22d2e2d32f","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"0f3e13ed69a642f1d401a50d20fc6c23","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"e779eaf726b43d3e8fa508d59dffecae","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"d85956ddc0bc9d08b14a5b6e4cc2e212","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"3da6e94afef82a11a95ba203ff821aac","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"3706abb63956052b188ea68d49e0a97a","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"e24bc7f24bf4c6c006144f5927ac8fd9","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"10d6fade183367f4dd9697d2cd1d1195","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"03da3812e93a86c9f8926051746e67af","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"d603eec48b39e58f52852268fac73ec6","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"b00a0c2411b4df54ab5fddbbf1c016a5","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"4059f8b4538d11c5287cc2c3860a162a","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795619956,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9cc6d00b07bc1ed65c7971028352a3472344ff939ea2df0b36651379b68e177c","lane":"client-lint","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":11,"stamp":"fca2a85bffdaf1addc592ed448cc00fb","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Ci-Attestation: {"at":1795620203,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"a977a8cb466066ac4f17b724c8d404b71b47396a3bdb781006078f2ce28942a6","lane":"client-test-x86_64-unknown-linux-gnu","parents":["e6bf0d4c114d6e31734d4bf1eb9d7b5106e24994"],"secs":150,"stamp":"1631ae4fd715cf748d7cf048fafe9172","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7","v":1,"via":"run"} Client-Checks: {"checks":{"base":"8a195424731e99fafc0b3a036fb0d93ad8353398","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-active-child+.h.c","libobs/build/ported-source-sets/source-active-child.json","libobs/cmake/rust-exports.d/obs-source-source_active_child.txt","libobs/obs-source-active-child-fields.c.h","libobs/obs-source-active-child.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_active_child_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-active-child.list","rust/obs-c-oracle/oracle/source_active_child.c","rust/obs-c-oracle/oracle/source_active_child_links.c","rust/obs-c-oracle/oracle/source_transition_restore_links.c","rust/obs-c-oracle/oracle/source_transition_switch_links.c","rust/obs-source/src/active_child.rs","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_active_child.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/active_child.rs","rust/obs-source/tests/source/active_child_parity.rs","rust/obs-source/tests/source/main.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_active_child.c","test/cmocka/tests.d/test_source_active_child.cmake"],"head":"f38c616723366b281067cad4dc2f6136abd48643","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.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-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"8295bc732040db45b84bc7e83469725dd2180806c591e59d7e2b9988fdfc59ed","tree":"3957cbc09adfae7d3df15080162c319e35a61bc7"}}
4cfb02f to
5bd09dc
Compare
|
The merge queue run failed on macOS Tier 2 (run 45615671599): Fix (ee73b6b, now 5bd09dc after rebase and stamp): the fixture teardown calls Local check after rebasing onto master 8a19542:
The RED for this one is the macOS queue log above; I can't reproduce the macOS timing on Linux, so the macOS Tier 2 lane of the next merge queue run is the proof (PR checks don't run that lane). |
Fixes #5622
What changes
obs_source_add_active_child()andobs_source_remove_active_child()move out oflibobs/obs-source.c.hinto a new obs-source module,active_child. The full-tree walk, the two counter loads andobs_source_activate()/obs_source_deactivate()stay C.Commits, in order:
c1c21dbealibobs: the two bodies, withstruct descendant_infoandcheck_descendant()(used only by add), move verbatim intolibobs/obs-source-active-child.c.h, still in the livelibobs.core-sourcegroup. The walk with a stop source,enum_source_full_tree(), isstaticinobs-source.c.h, soobs-source.c.hgains a hidden wrapper,obs_source_active_child_enum_full_tree()(noEXPORT), that only calls it; the extracted file declares the wrapper and maps the original name onto it with a scoped macro (#undefed at the end). The bodies stay verbatim and the file also builds in a translation unit of its own (the reference-only group of commit 4). No behavior change, no Rust.cbaeb0526test: new cmocka characterizationtest/cmocka/test_source_active_child.c(tests.d +test-graph.json), 17 cases on private sources of a started core, calling the exported functions of the real libobs. A node source type lists children throughenum_all_sources(what the full-tree walk uses), counts its walks, can report another source as an edge's parent, and records its ownshow_refs/activate_refseach time itsenum_active_sourcesruns (once per counter an activation or deactivation changes), which shows the view type order:LOG_DEBUGline,<function>: Null 'parent' parameter(or'child'; parent checked first); add returns false; nothing walked or activated.add(p, p): oneLOG_WARNINGobs_source_add_active_child: parent == child, false, no walk.remove(p, p)has no such check and deactivates the source itself.show_refs(parent)activations, the firstactivate_refs(parent)MAIN_VIEW, the restAUX_VIEW, in that order; more active than shown is allMAIN_VIEW; a negative show count activates nothing; a negative active count is allAUX_VIEW; adding twice activates twice; a hidden parent activates nothing (after the walk).MAIN_VIEWfirst), never walks or checks for a cycle, and lowers only counters above zero.cbb9a3e1ctest: RED. Tier 1 mirrors run againsttodo!()cores.4cfb02f96obs-source: GREEN.active_child::{add, remove}over aLibobstrait (walk with a visitor, the two loads, activate/deactivate, the two log lines), plusview_type()andnames()(check_descendant()'s rule).ffi/source_active_child.rs: the walk throughobs_source_active_child_enum_full_tree()with a Rust edge visitor as theobs_source_enum_proc_t, the loads through the newlibobs/obs-source-active-child-fields.c.hadapters (live group, noEXPORT, oneos_atomic_load_long()each),obs_source_activate()/obs_source_deactivate()called directly as obs-source: port obs_source_inc_showing, inc_active, dec_showing and dec_active to Rust (Fixes #5601) #5602 does.libobs.ported-source-active-child(+ported-source-setsJSON). Both names areEXPORTed inobs.h, so they go intorust-exports.d/obs-source-source_active_child.txt.oracle.d/source-active-child.listandoracle/source_active_child.c(the original C renamedoracle_*, the production counter adapters, defined once there, and a scripted stand-in for the walk wrapper).obs-build, plus arust/README.mdrow.Callers checked before the swap:
obs-scene.c.h,obs-scene-item-set-visibility.c.h,obs-scene-item-audio-actions.c.h,obs-source-transition-{restore,slots,stop,switch}.c.h) and plugins (stinger, both slideshows) call the exported symbol, which is Rust in hybrid libobs and the original C in the reference.obs-sceneitem visibility and audio actions,obs-source-seamtransition shims,obs-sourcetransition cores) reach libobs's symbol through theirCalls/Libobstraits; their oracles (scene_item_set_visibility.c,scene_item_audio_actions.c,source_transition_{slots,restore,stop,switch}.c) rename the two calls to their own stand-ins with#define, so they are unchanged.oracle/source_active_child_links.c, do-nothing link stand-ins for the obs-source-seam shims in the test binaries. It would clash with the new Rust exports inobs-tests-core, so it is removed (the Rust exports satisfy those references now), and the two comments insource_transition_{restore,switch}_links.cthat named it are updated. The shims' new adapter references are defined byoracle/source_active_child.candoracle/view.c;ci/windows_link_check.pylinks every test binary.test_source_full_tree_root,test_group_recursion,test_source_transition_restore(it pins theparent == childwarning text) and the transition/scene tests call the real export.test_transition_start_steps,test_transition_load_stepsandtest_scene_audio_action_stepsuse their own stand-ins or only match log text. Notest/cmockalink-support file names them.No public header, existing C test or WebSocket change. Not user-visible, so no
docs/features.mdline. No intentional differences. Tier 4 does not apply.Tests
rust/obs-source/tests/source/active_child.rs, in the existingobs-tests-corebinary): the 17 cmocka cases mirrored on a model of what the core reaches (nodes with the C walk's stop-source rule, counters, activate/deactivate recording the counters), plusview_type()andnames(). They also pin the call order: the walk of the child with the parent as the stop source, thenshow_refsandactivate_refsloaded once each, show first, then the activations; remove loads and deactivates without a walk.test_source_active_childand the existing callers' tests, on the C reference and on hybrid libobs.active_child_parity.rs): the original C and the Rust exports on noise-filled real-header sources (each node's counters distinct), both reaching the same scripted walk, the production counter adapters andoracle/view.c's tracing activate/deactivate.view_typewith<=fails Tier 1 (4 cases) and Tier 3;names()checking the child only fails Tier 1 (2 cases) and Tier 3.Test cost: the 20 new tests take 0.08 s together with reduced parity cases (debug build, the same at full cases). Peak RSS 21.6 MB with reduced parity cases. They start no threads of their own; the parity test runs in one re-exec'd child process (the view trace hook is process-global).
Evidence
RED (
cbb9a3e1c):GREEN (
4cfb02f96):The same Tier 2 run at the characterization commit (C only) passed 1107/1107 on both builds, and 22/22 for the selected tests. I also ran the new test binary directly from the build volume under
xvfb-run -a: all 17 cmocka cases ran,[ PASSED ] 17 test(s).against hybrid libobs and against the C reference, at both commits../pushran the client lint lane (clippy and Dylint on all six targets) and the host test lane; both passed (the optional Swift lane is not available on this host). The final commit is not signed, so the PR runs the ordinary selected CI.🤖 Generated with Claude Code