Skip to content

obs-output: port service weak-control release primitives (#3838) - #3883

Merged
zackees merged 3 commits into
masterfrom
port/service-weak-release
Nov 7, 2026
Merged

zackees merged 3 commits into
masterfrom
port/service-weak-release

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #3838

Ports obs_weak_service_strong_release, obs_weak_service_weak_addref, obs_weak_service_weak_release and obs_weak_service_free from libobs/obs-service.c.h to obs-output. The biased platform C-long counts keep SeqCst ordering and atomic wraparound; control destruction returns memory to bfree. The private layout, public headers, existing C tests, public export manifests and WebSocket plugin are unchanged. Tier 4 and the features ledger are inapplicable: no protocol or user-visible behavior change.

Extraction is separate in 9beaeb7 (originally 5b4dd51), with all four original signatures/bodies verified byte-identical against its parent. The original bodies remain compiled into the C reference and privately renamed Tier 3 oracle; hybrid links the thin Rust shims. The port is recorded in the libobs/obs-service.c.h row of the rust/README.md port table.

The lifecycle oracle explicitly changes weak-control ownership from calloc/free to bzalloc/bfree. Its C lifecycle keeps private traced wrappers delegating to the original primitives; Rust lifecycle uses production. The existing C free-reachability assertion remains, while lifecycle trace comparison excludes only these four now independently differential-tested primitive events. Every remaining lifecycle/plugin event is still compared exactly.

RED → GREEN

  • RED 05ade0f (originally 9a2c97b): SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core output::service_weak_release exited 101, 0 passed / 3 failed at the intended #3838 stubs. Log: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-MVn7Wx.log.
  • GREEN 185d6ab (originally 4c19533): the focused output::service run exited 0, 59 passed, including seven new cases. Final log: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-OyZwoi.log.
  • Tier 1 mirrors the characterized strong/weak ownership transitions and adds C-long extreme/wraparound cases. Existing lifecycle tests retain the surrounding NULL/acquisition/destroy assertions.
  • Tier 3 measures size, alignment and every field offset of both shared private structs against the real C header; compares returns, both counters and target preservation over fixed boundaries and proptest operation sequences; isolated allocation accounting checks both frees, including NULL. No intended behavior differences. NULL is invalid for count operations; no count values are excluded from parity. Proptest persistence is disabled.
  • Mutation: changing final-strong-release detection from old count == 0 to == 1 exited 101, 3 passed / 4 failed, including Tier 3 boundary parity. Log: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-6LVlf5.log. Restored GREEN and reran the service cases (59 after rebase) successfully.

Tier 2 / ABI

The unchanged test_service_lifecycle passed 8/8 against C reference and 8/8 against hybrid, without skips, both immediately after extraction and after the Rust swap. Each loaded library was verified with ldd. Dynamic export sets are identical: 1,767 symbols.

The focused replay uses the repository's docker_task_command, Docker image, read-only checkout mount and checkout-scoped warm build volume, with ZCCACHE_DISABLE=1: cmake --build /build/tree --target libobs libobs-c-reference test_service_lifecycle -- -k 0, then export comparison and xvfb-run -a ctest --test-dir /build/tree -R '^test_service_lifecycle$' --output-on-failure -V in both OFF and ON modes. Reproducer: uv run --no-project /tmp/run-service-tier2.py. Extraction log: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-ahgbf9.log; final GREEN log (exit 0): /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-cTprjr.log. Full Tier 2 suite not claimed.

Gates / test cost

  • GCC and Clang syntax-only checks passed for the original release oracle and lifecycle ownership/trace changes, using the repository's real private header and oracle dependency roots (Clang with -Qunused-arguments).
  • uv run ci/test_build_groups.py: 10 passed; uv run ci/test_native_b2_portability.py: 3 passed; uv run ci/test_test_graph_sorted.py --fix and its check: 2 passed. No native C tests were added, so native inventory counts and graph entries are unchanged.
  • SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none ./lint --fix: exit 1 only at the documented soldr refusal to build the Dylint driver under clud (Dylint v6.2.0 lacks the pinned nightly-2026-05-28 driver). Every earlier formatter, self-test and Clippy feature lane passed. No toolchain workaround; hosted Fast Gate must run Dylint. Log: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-YALyem.log.
  • Pre-push clud-review: one reviewer, clean, no actionable findings.
  • Test cost: seven new cases in the existing obs-tests-core executable. Over 25 debug runs at reduced parity, Tier 1 longest 0.01 s, peak 10,928 KiB RSS; Tier 3 longest 0.09 s, peak 18,360 KiB RSS. No threads of their own. Reproducer: uv run --no-project /tmp/measure-3838c.py.
  • Rebased on current origin/master before final push; obs-output: Port service module lookup accessors (#3839) #3844 merged and both ports are preserved; obs-output: Port encoder counter accessors (#3856) #3858 remains open. git range-diff confirms the three rebased commits retain their patches (only neighboring module-registration context changed). git merge-tree --write-tree --name-only origin/master HEAD exits 0, with no conflicts. No local-gate attestation claimed; hosted PR CI remains the merge gate.

Claim accepted: the fresh claim #3838 (comment) now has 🚀 and the issue is assigned to zackees. Latest comments rechecked: Ready, no refusal or competing claim. Marking ready and requesting auto-merge pinned to GREEN head; hosted CI remains the merge gate.

@zackees
zackees force-pushed the port/service-weak-release branch from 4c19533 to 185d6ab Compare November 7, 2026 11:14
@zackees
zackees marked this pull request as ready for review November 7, 2026 11:15
@zackees
zackees enabled auto-merge November 7, 2026 11:15
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 7, 2026
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit bfb5379 Nov 7, 2026
44 checks passed
@zackees
zackees deleted the port/service-weak-release branch November 7, 2026 14:42
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Nov 7, 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.

rust: Port obs-service weak-control release and allocation primitives to obs-output

1 participant