Skip to content

obs-source: port obs_source_add_active_child and obs_source_remove_active_child to Rust (Fixes #5622) - #5633

Merged
rdoupe merged 5 commits into
masterfrom
port/5622-active-child
Nov 25, 2026
Merged

rdoupe merged 5 commits into
masterfrom
port/5622-active-child

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #5622

What changes

obs_source_add_active_child() and obs_source_remove_active_child() move out of libobs/obs-source.c.h into a new obs-source module, active_child. The full-tree walk, the two counter loads and obs_source_activate() / obs_source_deactivate() stay C.

Commits, in order:

  1. c1c21dbea libobs: the two bodies, with struct descendant_info and check_descendant() (used only by add), move verbatim into libobs/obs-source-active-child.c.h, still in the live libobs.core-source group. The walk with a stop source, enum_source_full_tree(), is static in obs-source.c.h, so 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 (#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.
  2. cbaeb0526 test: new cmocka characterization test/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 through enum_all_sources (what the full-tree walk uses), counts its walks, can report another source as an edge's parent, and records its own show_refs/activate_refs each time its enum_active_sources runs (once per counter an activation or deactivation changes), which shows the view type order:
    • NULL parent or child: one LOG_DEBUG line, <function>: Null 'parent' parameter (or 'child'; parent checked first); add returns false; nothing walked or activated.
    • add(p, p): one LOG_WARNING obs_source_add_active_child: parent == child, false, no walk. remove(p, p) has no such check and deactivates the source itself.
    • Cycle check: add walks the child's tree once and refuses (silently, nothing activated) a parent the child lists, one deeper down (child -> c -> d -> parent), and one an edge only reports as its parent. A real cycle (parent lists child, child lists parent) is refused without walking the parent (the stop source).
    • Accepted: show_refs(parent) activations, the first activate_refs(parent) MAIN_VIEW, 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 (after the walk).
    • Remove mirrors add with deactivations (MAIN_VIEW first), never walks or checks for a cycle, and lowers only counters above zero.
  3. cbb9a3e1c test: RED. Tier 1 mirrors run against todo!() cores.
  4. 4cfb02f96 obs-source: GREEN.
    • Safe core active_child::{add, remove} over a Libobs trait (walk with a visitor, the two loads, activate/deactivate, the two log lines), plus view_type() and names() (check_descendant()'s rule).
    • C ABI shims in ffi/source_active_child.rs: the walk through obs_source_active_child_enum_full_tree() with a Rust edge visitor as the obs_source_enum_proc_t, the loads through the new libobs/obs-source-active-child-fields.c.h adapters (live group, no EXPORT, one os_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.
    • The extracted file moves to the new reference-only group libobs.ported-source-active-child (+ ported-source-sets JSON). Both names are EXPORTed 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, defined once there, and a scripted stand-in for the walk wrapper).
    • Registration test in obs-build, plus a rust/README.md row.

Callers checked before the swap:

  • libobs C callers (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.
  • Rust callers (obs-scene item visibility and audio actions, obs-source-seam transition shims, obs-source transition cores) reach libobs's symbol through their Calls/Libobs traits; 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.
  • One oracle file defined both names under their real names: 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 in obs-tests-core, so it is removed (the Rust exports satisfy those references now), and the two comments in source_transition_{restore,switch}_links.c that named it are updated. The shims' new adapter references are defined by oracle/source_active_child.c and oracle/view.c; ci/windows_link_check.py links every test binary.
  • Tests: test_source_full_tree_root, test_group_recursion, test_source_transition_restore (it pins the parent == child warning text) and the transition/scene tests call the real export. test_transition_start_steps, test_transition_load_steps and test_scene_audio_action_steps use their own stand-ins or only match log text. No test/cmocka link-support file names them.

No public header, existing C test or WebSocket change. Not user-visible, so no docs/features.md line. No intentional differences. Tier 4 does not apply.

Tests

  • Tier 1 (rust/obs-source/tests/source/active_child.rs, in the existing obs-tests-core binary): 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), plus view_type() and names(). They also pin the call order: the walk of the child with the parent as the stop source, then show_refs and activate_refs loaded once each, show first, then the activations; remove loads and deactivates without a walk.
  • Tier 2: the new test_source_active_child and the existing callers' tests, on the C reference and on hybrid libobs.
  • Tier 3 (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 and oracle/view.c's tracing activate/deactivate.
    • Compares every walk (root, stop source), activation and deactivation (source, view type) in order, the result, the log lines (count, level, text) and every other byte of the sources; checks each adapter reaches its field. A "clobber" mode zeroes the parent's counters at each activation, so a call that loads them again inside the loop shows it.
    • Grid: add and remove x NULL/real parent x NULL/parent/other child x 7 show counts x 6 active counts (negatives, zero, above and below each other) x 10 edge sets (none, unrelated, parent as child, parent as an edge's parent, deep, NULL ends, real cycles) x clobber (10,080 cases), plus a proptest over all inputs (any noise, counts -4..12, up to 8 edges between nodes and NULL) and pinned answers.
    • Ten shim mutants rejected: edge parent ignored, edge child ignored, walk stopping at the child, views swapped, activate/deactivate swapped, NULL silent, NULL naming the other parameter, show count reloaded per activation, no self check in add, remove walking the tree.
    • Mutation checks on the core, both reverted: view_type with <= 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):

soldr cargo test -p obs-data --test obs-tests-core -- source::active_child::
panicked at rust/obs-source/src/active_child.rs:69:5:
not yet implemented: #5622
test result: FAILED. 0 passed; 19 failed; 0 ignored; 0 measured; 6715 filtered out

GREEN (4cfb02f96):

soldr cargo test -p obs-data --test obs-tests-core -- source::active_child
test result: ok. 20 passed; 0 failed (19 Tier 1 + 1 Tier 3)

soldr cargo test -p obs-studio-rust --test obs-tests-app -- canonical_source_active_child
test result: ok. 1 passed; 0 failed

soldr cargo test -p obs-util --lib -- export_list
test result: ok. 4 passed; 0 failed

./lint
== lane lint: ok

OBS_CMOCKA_LINK=false uv run --no-project ci/windows_link_check.py
exit 0

OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 1 --tests '^(test_source_active_child|test_source_full_tree_root|test_group_recursion|test_source_transition_restore|test_source_transition_slots|test_source_transition_stop|test_source_transition_switch|test_transition_start_steps|test_transition_start_steps_rust|test_transition_load_steps|test_transition_load_steps_rust|test_scene_audio_action_steps|test_scene_item_set_visibility|test_scene_item_visible|test_transition_set_cycle|test_transition_swap_cycle|test_transition_recursive_destination|test_transition_set_active|test_transition_swap_active|test_visibility_transition|test_group_hide_transition_audio|test_source_show_active_counters)$'
== ported C objects excluded from production libobs: 610
== libobs exported symbols, C vs Rust: IDENTICAL (1769 symbols)
== [OFF] ctest: 100% tests passed, 0 tests failed out of 1107
== [OFF] repeat: 100% tests passed, 0 tests failed out of 22
== [ON] ctest: 100% tests passed, 0 tests failed out of 1107
== [ON] repeat: 100% tests passed, 0 tests failed out of 22

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.

./push ran 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

@rdoupe
rdoupe marked this pull request as ready for review November 25, 2026 11:15
@rdoupe
rdoupe requested a review from zackees as a code owner November 25, 2026 11:15
@rdoupe
rdoupe added this pull request to the merge queue Nov 25, 2026
rdoupe and others added 4 commits November 25, 2026 09:45
…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"}}
@rdoupe
rdoupe removed this pull request from the merge queue due to a manual request Nov 25, 2026
)

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"}}
@rdoupe
rdoupe force-pushed the port/5622-active-child branch from 4cfb02f to 5bd09dc Compare November 25, 2026 15:23
@rdoupe

rdoupe commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

The merge queue run failed on macOS Tier 2 (run 45615671599): remove_parent_equals_child_deactivates_itself expected 0 captured log lines and saw 9. They were private source 'd' destroyed and gs_texture_destroy: called while not in a graphics context lines from the previous test's teardown: releasing a fixture source queues its destruction on libobs's destruction thread, and on macOS those lines landed inside the next test's log capture.

Fix (ee73b6b, now 5bd09dc after rebase and stamp): the fixture teardown calls obs_wait_for_destroy_queue() so destruction finishes before the next test starts capturing. The test file is new in this PR; no existing C test changed.

Local check after rebasing onto master 8a19542:

  • OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 5 --tests test_source_active_child: full Tier 2 suite 1112/1112 passed, then test_source_active_child passed 5 out of 5 runs against both the C reference and the Rust-backed libobs.
  • ./lint: ok.

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).

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.

rust: port obs_source_add_active_child and obs_source_remove_active_child to obs-source

1 participant