Repository navigation
obs-output: Port the output weak-handle lifetime (Refs #4778) - #4942
Merged
Merged
Conversation
Refs #4778. Mirror unchanged C weak-output ownership, promotion, identity and lifetime assertions in obs-tests-core. Safe core intentionally panics until the Rust swap.
Refs #4778. Replace only the extracted five helpers. Keep control access and shared atomic operations in a private C adapter, preserve bfree ownership, and link the real adapter into standalone Rust-static consumers. Add real-header layout and original-C differential coverage; identity inversion is detected by the differential edge test. Tier 4 does not apply to this local lifetime unit. Ci-Attestation: {"at":1794880386,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":53,"stamp":"f00718fa01ab5006b3fd24ea384c180a","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880386,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":53,"stamp":"39a3ac5643786884021b110472093104","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880386,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":53,"stamp":"6d975d94a080badc6abfd4d4d2d08c08","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880386,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":53,"stamp":"eebb4f65bac38fdd3342594ec4290d89","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"general/all/client-lint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"fe760d2be7562e50715f4e781ecd5e26","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880386,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":53,"stamp":"074c8f214c9450c38ca11ccd46c5afdc","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"9864efb1224cec57c7a86cf9d78240d4","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"4d5756248fb17dd587068582fb9a3d7f","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"d50bec4599de18f405797841cb94ac0a","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"b90521183914d2bd317e05f3d84ec7a1","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"a1ce80d720803e4cde25cf535b990a57","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"47134cd70c28d67454d9ba584fce8682","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"b6d85e95b20839f726cd18ca0c376256","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"a366b08237635e30647d46c7a069a281","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"7c76f02ff4e903254e998e1dd3eedbed","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"b05c8ff17e90541d8a34c9dfd949a429","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"44a50ec2573a3e86544c9fad09a14b52","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880332,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"88af175cf8413a93a1529eef888e8dfc5e571b51ba75e888bc81fc13087ad1df","lane":"client-lint","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":96,"stamp":"2583e65d7b0b7bf7a556e8fd88368268","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Ci-Attestation: {"at":1794880516,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"9c55c23e40c48d83176eab123b93a8280cd1402d9ce11cd43929fbdaecd1ea38","lane":"client-test-x86_64-unknown-linux-gnu","parents":["d9b32ff3163ca62522153382ce5911699cec1e76"],"secs":129,"stamp":"e2b12776fb1d26da4a64372356a095a3","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2","v":1,"via":"run"} Client-Checks: {"checks":{"base":"aace99f022e7df01735d4fc3d8072e89b557631b","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-output-weak-lifetime+.h.c","libobs/build/libobs.ported-output-weak-lifetime+.h.c","libobs/build/ported-source-sets/output-weak-lifetime.json","libobs/cmake/rust-exports.d/obs-output-output_weak_lifetime.txt","libobs/obs-internal.h","libobs/obs-output-weak-lifetime-fields.c.h","rust/README.md","rust/obs-c-oracle/oracle/output_weak_lifetime.c","rust/obs-output/src/ffi/mod.rs","rust/obs-output/src/ffi/output_weak_lifetime.rs","rust/obs-output/src/lib.rs","rust/obs-output/src/output_weak_lifetime.rs","rust/obs-output/tests/output/main.rs","rust/obs-output/tests/output/output_weak_lifetime.rs","rust/obs-output/tests/output/output_weak_lifetime_parity.rs","test/cmocka/output-weak-lifetime-link-support.c","test/cmocka/tests.d/output_weak_lifetime_link_support.cmake"],"head":"3a28c6a75588d943346ee2ba6087e2e2ef9f8002","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":"2750b52865161a6004fdbc56940a76fba3a6e3f665e5b1f7c9821828d4265430","tree":"fe4fbbdb1d759b3df2fba91ba477cc06b93bb9c2"}}
rdoupe
marked this pull request as ready for review
November 17, 2026 03:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4778
Swaps the five output weak-handle functions extracted in #4824 (
obs_weak_output_addref,obs_weak_output_release,obs_output_get_weak_output,obs_weak_output_get_output,obs_weak_output_references_output) toobs-output. The two commits are @zackees's fromport/4778-weak-output-rust, rebased onto master with his authorship kept; the extraction half of that branch is already on master.What changes
libobs/obs-output-weak-lifetime.c.hnow builds only into the C reference (libobs.ported-output-weak-lifetime+.h.c); hybrid libobs takes the five symbols fromobs-output.libobs/obs-output-weak-lifetime-fields.c.h), so allocation (bfree) and the atomic counters are the ones libobs already uses.test/cmocka/output-weak-lifetime-link-support.clinks that adapter into standalone consumers of the Rust archive.test/cmocka/test_output_weak_lifetime.cplus edge cases, and Tier 3 parity against the retained C (real-header layout, helper parity, characterized edges and final free).No C test or public header is changed. Tier 4 does not apply (no protocol surface).
Evidence
RED (
d9b32ff31, tests against panicking stubs):GREEN (
655ea8f4e):Mutation checks on the GREEN head:
&& !host.release(weak)):test_output_weak_lifetime_weak_ownershipand..._real_output_lifetime_policyfail, then the binary aborts withdouble free or corruption.references:output_weak_lifetime_parity::helpers_match_candcharacterized_edges_and_final_freefail.Local
./lint: ok. Local./unitteston the head:rust-testok;tier2-linux949/949 passed on both hybrid libobs and the C reference,test_output_weak_lifetimepassing on both.🤖 Generated with Claude Code