Skip to content

libobs: Characterize and extract object reference APIs - #4669

Merged
zackees merged 2 commits into
masterfrom
test/4667-object-ref-extract
Nov 11, 2026
Merged

zackees merged 2 commits into
masterfrom
test/4667-object-ref-extract

Conversation

@zackees

@zackees zackees commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

obs_object_get_ref and obs_object_release are still inline in the large core implementation and had no focused C characterization. Add a new C cmocka characterization first, then move both complete function bodies verbatim from libobs/obs.c.h into libobs/obs-object-ref.c.h, included alphabetically in the existing core unity group. This is the behavior-neutral prerequisite required by testing-policy.md; the Rust swap is #4668 and waits for this PR to land. Refs #4667.

The four C cases call the actual exported APIs with private common-context/control fixtures. They cover source/output/encoder/service/canvas and the invalid type tag: current code uses the common control and stored destroy callback without a type switch. Assertions pin NULL with and without an initialized core; acquisition without a core; the shutdown warning guard before NULL; counts 0/1/7/1023, repeated acquisitions and balanced releases; stored identity distinct from the argument; NULL control; a live control with NULL stored identity still incrementing the strong count; expired counts -1/-2/-3; final callback identity/order; weak-owner decrement and control deallocation. Odd current behavior is characterized, not endorsed. Invalid releases without ownership/control and overflow are excluded.

Characterization commit: 4c3d5d1de. Before and after extraction, test_object_ref, unchanged test_source_module, and unchanged test_module_lists each passed three repeats against both actual hybrid and C-reference libraries (18 suite executions per phase, no skips). ldd confirmed the selected library paths; all 1,767 dynamic exports matched in each phase. Both complete definitions are byte-identical and the original core file changes only by removal of their span. All ten build-group checks, soldr cargo fmt --all --check, and git diff --check passed. Full SOLDR_PORCELAIN=0 ./lint passed exactly once, exit 0 (155.5 s, 1,800-second deadline); matching passing Rust verdicts were reused. The diagnostics wrapper classified the output as unknown; the raw log confirms lane lint: ok.

No Rust swap or Rust test executable is introduced. Rust RED/GREEN, Tier 1, and original-C differential Tier 3 belong to #4668. Tier 4 is inapplicable. Native Windows/macOS execution, sanitizer execution, and the full Tier 2 suite were not run locally. No existing C test, public header, WebSocket plugin, workflow, native test graph, or native.rs changes.

Ci-Attestation: {"at":1794374588,"gate":"rust/all/fmt","host":"linux-x86_64","key":"","lane":"lint","parents":["4c3d5d1de23b5c92435c407c7c4d012e13c31a26"],"secs":0,"stamp":"23b6171aa2468976d18385d2f6eac1a0","tree":"648147d5ff9103e9952a447b15c3423cc4b8117f","v":1,"via":"run"}
Ci-Attestation: {"at":1794374588,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"","lane":"lint","parents":["4c3d5d1de23b5c92435c407c7c4d012e13c31a26"],"secs":0,"stamp":"f3a45986095526bcf0c8fb7a997d9567","tree":"648147d5ff9103e9952a447b15c3423cc4b8117f","v":1,"via":"run"}
Ci-Attestation: {"at":1794374588,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"","lane":"dylint","parents":["4c3d5d1de23b5c92435c407c7c4d012e13c31a26"],"secs":0,"stamp":"f9f07c3c878aa1c07be9b5aa50a7691e","tree":"648147d5ff9103e9952a447b15c3423cc4b8117f","v":1,"via":"run"}
@zackees zackees changed the title refactor(libobs): extract object reference APIs verbatim (Refs #4667) libobs: Characterize and extract object reference APIs Nov 11, 2026
@zackees
zackees enabled auto-merge November 11, 2026 05:23
@zackees
zackees added this pull request to the merge queue Nov 11, 2026
Merged via the queue into master with commit 63bf6e9 Nov 11, 2026
41 checks passed
@zackees
zackees deleted the test/4667-object-ref-extract branch November 11, 2026 05:53
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