Skip to content

obs-output: Port service state accessors (#3840) - #3850

Merged
zackees merged 6 commits into
masterfrom
port/service-state-accessors
Nov 7, 2026
Merged

zackees merged 6 commits into
masterfrom
port/service-state-accessors

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Refs #3840

Ports the first state-accessor slice only: set_destroy, is_destroying, is_active, set_active, has_output, clear_output, detach_from_output and get_control. The issue stays open for its other groups.

A private C field-view seam follows the output-delay pattern, preserving the service and output storage without duplicating unrelated mutex and hash layouts. detach_from_output clears only the output's reverse link, even when it names another service; clear_output clears only the service link; get_control takes no reference. Plain bool and pointer accesses keep their C semantics, with no atomic changes. No public headers, existing C tests, workflows or obs-websocket changed. No protocol or user-visible change, so Tier 4, a real-app run and the features ledger do not apply.

Commits

  • 3ef98edd4: new C-only characterization files, tested before extraction or Rust.
  • 6098f1343: verbatim extraction. All eight signatures and bodies compare byte-identical to master, including after rebasing onto obs-output: Port service weak acquisition accessors (#3837) #3842.
  • 3d07c8085: separate C field-view seam.
  • 47e147b51: RED.
  • d466ff3c5: GREEN.
  • cc7ae60fc: explicit unsigned cast in the new oracle observation helper, which strict Clang required.

Results

  • RED: soldr cargo test -p obs-data --test obs-tests-core output::service_state exits 101, 0 passed and 2 failed at the rust: Port obs-service context, state and handler accessors to obs-output #3840 stubs (run on the pre-rebase RED commit 7ec409d15).
  • GREEN, final rebased head: SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core output::service exits 0, 46 passed and 0 failed.
  • Tier 3: independently renamed original C functions; every initial flag and link combination; bounded generated operation sequences; exact pointer identity; both reference counters independently; real-header view size, alignment, every offset and actual field addresses. A NULL service and detach without a live output are undefined in C and excluded, with no intentional difference.
  • Existing lifecycle parity keeps every assertion. Its state doubles now resolve through the real seam, and its one-byte output token became an actual C output so detach can reach the reverse link.
  • Mutation: storing false in set_destroy exits 101, 2 passed and 3 failed (Tier 1, fixed differential, generated differential). The exact GREEN file was restored and the 46 tests rerun.
  • Tier 2, focused, after rebase: exit 0. Unchanged lifecycle, getter and settings tests pass 23/23 in each of OFF and ON with no skips; the new state characterization passes 1/1 in each. Loader checks confirm the intended libraries; 1767 dynamic exports, identical.
  • Source-group inventory, after staging and after rebase: 10 passed.
  • Strict GCC and Clang real-header syntax replays pass for the original accessors, adapter and new oracle.
  • One clud-review reviewer: clean.
  • Test cost, 25 debug runs per module with reduced parity: Tier 1 longest 0.01 s, peak 10748 KiB RSS; Tier 3 longest 0.02 s, peak 18156 KiB RSS; no threads of its own and no new test executable.

Not verified locally

  • The full Tier 2 suite and full workspace tests were not run; hosted CI covers them.
  • ./lint passed its formatting, Python and Clippy lanes, then exited 1 only at the documented soldr refusal to build the Dylint driver under clud. Hosted Fast Gate must run Dylint. No local-gate stamp.

🤖 Generated with Claude Code

@zackees
zackees force-pushed the port/service-state-accessors branch from 3fe2e07 to cc7ae60 Compare November 7, 2026 08:32
@zackees
zackees marked this pull request as ready for review November 7, 2026 08:43
@zackees
zackees enabled auto-merge November 7, 2026 08:43
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit 5294577 Nov 7, 2026
46 checks passed
@zackees
zackees deleted the port/service-state-accessors branch November 7, 2026 09:16
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Nov 8, 2026
…-rust#3898)

The obs-rust#1920 live-service fixture linked its service to 0x07. Since obs-rust#3850
deactivate detaches the service through obs_service_detach_from_output(),
which writes the output's service field and aborted the bench with a
misaligned pointer dereference. Allocate a zeroed struct obs_output from
the oracle and free it with the other fixtures.

Fixes obs-rust#3886

Co-authored-by: Claude Opus 5.5 <[email protected]>
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