Skip to content

libobs: characterize and extract generic weak-object references - #4930

Merged
zackees merged 3 commits into
masterfrom
port/4254-weak-object-refs-extract
Nov 17, 2026
Merged

zackees merged 3 commits into
masterfrom
port/4254-weak-object-refs-extract

Conversation

@zackees

@zackees zackees commented Nov 16, 2026

Copy link
Copy Markdown
Member

Refs #4254

Characterize the four generic weak-object reference helpers against actual libobs, then move their definitions verbatim from obs.c.h into obs-weak-object-refs.c.h in the existing core unity group. The new cmocka test covers NULL handles, zero-based counters, live and expired promotion, pointer identity, and final weak-control allocation release. Register it for reference and hybrid libobs with the private-header dependencies required on supported hosts. Update the existing strong-object oracle's two source paths to follow the moved C bodies.

This prerequisite was verified on 2026-11-09 and re-verified on current master on 2026-11-16. Before extraction, its four characterization cases passed three times each against reference and hybrid. A fresh negative control against those parent binaries replaced weak addref with a no-op and failed weak_ownership and final_release in both modes (CTest exit 8). After extraction, all four cases again passed three times per mode and the dynamic-symbol lists matched.

The extraction head 20b5933 is also a concrete RED for integration: source-bound client lint reproduced the existing oracle build panic looking for obs_weak_object_release in obs.c.h. The subsequent GREEN commit changes only the two oracle input paths; the existing object-reference unit and differential cases pass with verdict replay disabled and reduced parity sampling (6 tests, 0.24 seconds execution after rebuilding). Rust formatting passes. The full ./lint run passed in 325.9 seconds before that path correction; final client-gate evidence is recorded below.

The Rust implementation follows separately in #4258 on port/4258-weak-object-refs. This prerequisite changes no implementation behavior or public API. Linux focused CTest runtime was 0.05–0.26 seconds per run, with no test-owned threads. No Rust tests were added or changed. Tier 4 does not apply to these local ownership helpers; Windows and macOS runtime validation was not run locally.

Final ./push evidence: all 19 required Ci-Attestation records are on the signed head, with GitHub verifying the signature. Client lint, including clippy and Dylint for all six targets, passed in 951.2 seconds. Python self-tests and data validators passed. The host client-test gate passed in 1411.5 seconds: 8,661 workspace tests passed (6 skipped, 5 slow), all documentation tests passed, 918 feature-matrix tests passed, and every workspace test binary linked for Windows GNU. The optional Swift proof was unavailable because swift-format is not installed; no Swift files are selected by this change. Final focused Tier 2 tests passed three times against each library after the refreshed-base rebuild, with matching exported symbols.

Refs #4254. Pin NULL handling, zero-based reference ownership, live and expired promotion, pointer identity and final allocation release against actual libobs. Four cmocka cases pass three times on each of the C reference and hybrid libraries before extraction.
Refs #4254. Move the four characterized helpers verbatim into obs-weak-object-refs.c.h within the existing core unity group. No public header, signature or behavior changes. Rust replacement follows separately under #4258.
Refs #4254. Keep the existing strong-object differential oracle extracting the same two C helper bodies from their new file. The extraction head reproduced the missing-source build failure; existing object-reference unit and differential tests pass after this registration update.

Ci-Attestation: {"at":1794871232,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":120,"stamp":"6ef87f48eb6c573ee03a885c4653e69b","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871232,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":120,"stamp":"9123ac74e3e9292e08b4425730a25af7","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871232,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":120,"stamp":"9d9c803c39ffc02985b8d6c0d1dd119f","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871232,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":120,"stamp":"77cda757057a11b6d042aba5dbc88ce1","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"general/all/client-lint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"fd0c998b0041dfa6ce16a940471bc95e","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871232,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":120,"stamp":"a8bc7669ba941137bdf84f606c160a3c","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871110,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"d0f205818d04ef6e09eef5f5f3cdf372","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871110,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"f292fce7f994239df7381ac14c2f3884","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"aa21c14b478309d051fe9a57da181073","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871110,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"6765ae77d0694e8b2087532818eb29d8","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"280b06c6c7e0a1cd6b6445567b24484b","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"9bd9fae598f22904cd352ca495c5c984","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871110,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"4ff44a2c56cc7b91d93556f333be0dcf","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871110,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"32eebe2d3b6e8c7557d2a12e0523efb0","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"fa25208d1ef61312c4246453c4a02b00","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"582507136f3787bcfa76182ae32139e0","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"22657b39708d1f3e2945686f7463b787","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794871109,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bea5bc494ae710eb64c798375ad858efeb08c48741d2145089563d7362b5e520","lane":"client-lint","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":952,"stamp":"70fbb513125dcbee2e0666f9c5892781","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}
Ci-Attestation: {"at":1794872644,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"29e5661623d70cc0c919fad28f128b29ddd1871f2fda30232b18489f12c5ab7b","lane":"client-test-x86_64-unknown-linux-gnu","parents":["20b59335a4f691ec8316e2e425e0c55d8cf15b3e"],"secs":1411,"stamp":"4d03b998fc0c52e0fabd37bb060511ef","tree":"533409a553df9570f01539cfe2ee6e3e64222d44","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"4f67d28e0ff7773d87fc0ce54a37fee1b275d63b","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-weak-object-refs.c.h","libobs/obs.c.h","rust/obs-c-oracle/build.rs","test/cmocka/build/test-graph.json","test/cmocka/test_weak_object_refs.c","test/cmocka/tests.d/test_weak_object_refs.cmake"],"head":"522e7813aaca10730f0f5e82c5873e07cd82edc7","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":"3b6df7d646e282e22b7347a59bf4a497ad5029bb33253c480f4919a4662afc24","tree":"533409a553df9570f01539cfe2ee6e3e64222d44"}}
@zackees
zackees enabled auto-merge November 16, 2026 23:45
@zackees
zackees added this pull request to the merge queue Nov 16, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In merge queue in obs-rust Multiview Nov 17, 2026
Merged via the queue into master with commit fe472db Nov 17, 2026
39 checks passed
@zackees
zackees deleted the port/4254-weak-object-refs-extract branch November 17, 2026 02:03
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In merge queue to Done in obs-rust Multiview Nov 17, 2026
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