Skip to content

libobs: extract and characterize obs_sceneitem_get_order_position before its Rust port #5284

Closed

Description

@zackees

Phase 6 C-only prerequisite for obs_sceneitem_get_order_position in libobs/obs-scene.c.h:2277-2296, before a later Rust implementation swap in obs-scene.

Issue #2895 and merged PR #2899 ported the attached-item guard and order decisions; the getter's parent-list traversal and locking remain C. No open PR touches obs-scene.c.h at this check (2026-11-19).

Extract the function body verbatim into its own scene-item .c.h in the existing sorted core-source unity group. Register all CMake and Cargo native source manifests consistently across Linux, macOS and Windows. Add a focused cmocka characterization of zero-based sibling position counting, nested group-local counting, and NULL/detached results, using the current C implementation. Preserve the public headers, existing C assertions and behavior. No Rust implementation belongs in this prerequisite.

Acceptance: characterization passes before and after extraction; focused native source registration checks and ./lint pass. File a separate dependent Rust-swap issue carrying Tier 1 mirrors, unchanged Tier 2, original-C differential coverage and mutation testing. Network Tier 4 is inapplicable to this local query. Do not add Rust-static support or link-support files while #5246 is held.

Rust-swap follow-up: #5285. Existing #2899 difference: the reference library's legacy attached predicate always accepts, so NULL/detached public calls are undefined there. The new prerequisite fixture will document that distinction, pin the exact getter body's early return under the hybrid predicate contract, and exercise valid walks through both real libraries. Actual hybrid public NULL/detached calls will also be checked locally; the follow-up must retain real-adapter coverage.

Activity

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

    @zackees
    MemberAuthor

    Claiming: C-only characterization and extraction in branch test/5284-sceneitem-order-position (pool slot obs-studio8, g7-order-position). 1. Pin the existing getter behavior with focused cmocka assertions. 2. Extract verbatim and register the native inputs on all hosts. 3. Validate, publish the prerequisite PR this session, and file the dependent Rust swap.

  3. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Done by #5296 (merged 2026-11-20): the getter is extracted verbatim into libobs/obs-scene-item-order-position.c.h with its characterization. Closing so the Rust swap follow-up #5285 can start.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions