Skip to content

test: Extract and characterize hotkey background state query before Rust swap #5255

Closed

Description

@zackees

Phase 6 prerequisite for a later obs-hotkey Rust swap. obs_hotkeys_get_background_state remains inline in libobs/obs-hotkey.c.h:478-490, in unity group libobs/build/libobs.core+.h.c. Existing portal/press tests do not characterize the complete wrapper contract.

Add deterministic C characterization using recording lock/unlock and state/flags: non-NULL output is zeroed before locking; failed lock returns NATIVE without unlock or background reads; successful locking reads state, optionally copies flags (including unknown bits), unlocks exactly once, and returns the exact enum. NULL output is valid. Preserve the C-owned global core and mutex with no new mutex.

Then extract the wrapper verbatim into its own C implementation file, add the sorted group member, tests.d pointer and canonical test graph, keeping inventories consistent. No Rust, existing C-test edits or public-header edits. Commit characterization, extraction RED, then behavior-neutral GREEN. Validate the whole native_build module, focused dual-library Linux Tier 2 and every *_rust target, Windows/Darwin links and lint. File the separate Rust-swap issue after publication.

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: hotkey background state query characterization and behavior-neutral C extraction (pool slot obs-studio5, branch test/5255-hotkey-background-state).

    1. Add deterministic original-C characterization for output ordering, failed lock, exact enum/flag preservation and balanced unlock; commit extraction RED then verbatim GREEN.
    2. Register the new C target with tests.d and sorted test graph/group, checking matching inventories. No Rust, public-header changes or existing-C-test edits.
    3. Run the entire native_build:: module, focused Linux Tier 2 plus EVERY *_rust target, Windows and Darwin link checks and one full lint. Check open overlapping PRs with forced refs and merge-tree, publish READY subject to backpressure, and file the separate Rust swap.

    Expected first PR this session after GREEN validation.

  3. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Landed on master in #5263 (3f92f48): the hotkey background state query is extracted and characterized. The Rust swap is #5259.

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions