Skip to content

rust: Port libobs/obs-service-find.c.h to obs-output #5273

Done

Description

@zackees

Phase 6 follow-up to prerequisite #5267 (PR #5272): port only the hidden find_service unit extracted into libobs/obs-service-find.c.h to obs-output. Keep this explicitly disjoint from #3840's service context/state/handler accessors and from the already ported service module/lifecycle APIs.

The prerequisite C-source fixture test/cmocka/test_service_find.c pins empty tables, misses, byte-exact C-string IDs including non-UTF-8, first duplicate selection, exact borrowed registry pointer, no callbacks, no allocation/ownership changes, and immediate observation of registry changes. Keep those assertions unchanged and connect their SERVICE_FIND_EXTERNAL mode through real private C registry adapters to the Rust implementation. The current default fixture compiles the C source and alone cannot prove the swap.

Implement the actual table walk and first-match decision in a safe Rust core over a real private C-owned registry seam; do not leave lookup/strcmp selection in a C helper. Native layouts and storage lifetimes stay behind the FFI boundary. Compare C-string bytes, without UTF-8 conversion, caching, sorting, eager copies or synchronization changes. Return the exact borrowed pointer into the existing registry. Keep the original initialized-core/valid-C-string preconditions and hidden symbol visibility.

After #5267 lands: Tier 1 RED then GREEN in the existing obs-tests-core category, real-C-header layout coverage for any exposed ABI view, Tier 3 differential properties against the unchanged extracted C oracle, and a killed mutation. Run unchanged service settings/getters/lifecycle and the new characterization against C reference and hybrid libobs with identical exports. Ensure the source-only C fixture also exercises the external Rust/real-adapter path. No public header, existing C test, obs-websocket or workflow edits.

Every new private C adapter referenced by Rust-static consumers must be linked as its real source, never a stub. Validate EVERY configured Linux *_rust target with -k 0, ci/windows_link_check.py, and a separate ci/cmocka_link_check.py --alias mac-arm64 if Windows fails. Test the new external characterization link explicitly on both cross targets and account for Darwin's two-level binding if interception is introduced. Run whole native_build:: and lint once.

Decisions: ready / P2 / port / size:S, blocked by prerequisite #5267. Tier 4 network coverage is not applicable to this private lookup. Preserve the immutable C characterization and borrow semantics.

Activity

  1. added
    port
    ready
    P2
    size:S
    on Nov 19, 2026
  2. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Claiming: find_service Rust swap in pool slot obs-studio4, branch port/5273-service-find. 1. Mirror the immutable C characterization in the existing Core category and commit/run RED. 2. Implement safe byte-exact first-match lookup in obs-output with real C registry adapters, unchanged external Tier 2 coverage and C-oracle differential checks. 3. Validate all Linux Rust-static targets, canonical Windows/macOS manifests, cross links and full lint; publish this session. Register native support using #5246; hold enqueue until it merges, then rebase and re-verify. Scope excludes #3840.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 21, 2026
  4. zackees commented on Nov 21, 2026

    @zackees
    MemberAuthor

    Claiming: continuing the existing service-find swap in PR #5280 as its assigned pool landing worker in obs-studio8. 1. Rebase only the commits after the recorded #5246 stack base and preserve the merged #5367 accessors. 2. Re-verify focused Rust, standalone Windows/Darwin links, Linux Tier 2 and full lint. 3. Publish the verified head through ./push with an exact old-head lease, then ready and arm #5280 when backpressure permits. The existing draft PR is the deliverable; no duplicate PR will be opened.

  5. moved this from Ready to In progress in obs-rust Multiviewon Nov 21, 2026
  6. moved this from In progress to Ready in obs-rust Multiviewon Nov 22, 2026
  7. rdoupe commented on Nov 25, 2026

    @rdoupe
    Collaborator

    Done by #5280 (merged 2026-11-25): find_service runs in Rust; the C is reference-only in libobs.ported-service-find. It said Refs, so the issue stayed open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2portreadysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions