Skip to content

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

Open

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
    portPort a C unit to Rust (four-tier policy)
    readyMeets the definition of Ready; claimable
    P2Normal priority
    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.

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

Metadata

Metadata

Assignees

Labels

P2Normal priorityportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimablesize:SHours

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions