Skip to content

rust: Port encoder group started-count accessor to obs-output #5319

Closed

Description

@zackees

Phase 6 follow-up to the C-only characterization/extraction in #5316: port libobs/obs-encoder-group-num-started.c.h to obs-output after the prerequisite merges.

Preserve the hidden obs_encoder_group_num_started(struct obs_encoder_group *) -> uint32_t contract, including one group mutex lock/read/unlock, the read inside the lock and snapshot before unlock, full uint32_t counts, and the existing non-NULL group precondition. Keep private layout owned by C through the smallest real field/mutex adapter; do not copy pthread mutex layout into Rust. Retain all assertions from test_encoder_group_num_started unchanged and relink it to the actual replacement.

Before RED/GREEN, inventory the production calls in output interleaving and encoder set-group, the Rust extern import in rust/obs-output/src/ffi/output_interleave.rs, and exact-name fakes in rust/obs-output/tests/output/interleave_parity.rs, test/cmocka/output_interleave_fields_stub.c, and the benchmark stand-in in rust/obs-c-oracle/benches/port_comparison.rs / ci/test_bench_libobs_stand_ins.py. Their pre-existing definitions must not collide with or accidentally interpose on the real swap. History: #1599 (hidden accessor), #1603 (interleaver port), #2934 (started-group move ordering).

Required coverage: safe Rust mirrors in the existing core category binary, original-C differential/layout and deliberate-mutation evidence, unchanged C-source characterization linked to both C and Rust implementations, unchanged grouped-encoder and interleave compatibility tests against hybrid and C-reference libobs, export parity, and native Windows/macOS link/runtime obligations where applicable. Tier 4 is inapplicable to this non-protocol accessor. Address real adapter support for standalone Rust-static consumers under the shared support mechanism from #5246 once available; never add aborting placeholders. Prove Darwin fixture binding explicitly for same-name fakes (the #5226 lesson).

Dependency: wait for #5316 to merge. No implementation claim is made by this follow-up.

Activity

  1. added
    port
    P2
    size:S
    on Nov 20, 2026
  2. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Claiming: investigation

    The prerequisite (#5316) merged in #5322, so libobs/obs-encoder-group-num-started.c.h is on master as its own unit and still C. The scope, contract and coverage are already spelled out above, so this meets Ready.

  3. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    /ready

  4. github-actions commented on Nov 21, 2026

    @github-actions

    Claim bot: @rdoupe, this can't be claimed yet: it is blocked by 1 open issue(s) (see "Blocked by" on the issue); claim it once they close.

  5. added
    ready
    on Nov 21, 2026
  6. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    /ready

  7. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Claiming: Rust swap of obs_encoder_group_num_started into obs-output, branch port/5319-encoder-group-num-started.

    1. Inventory the callers and the same-name fakes (interleave production import, interleave_parity.rs, output_interleave_fields_stub.c, the bench stand-in) so the swap never collides with or interposes on them.
    2. RED: Tier 1 mirrors of test_encoder_group_num_started against a todo!() core, and Tier 3 against the extracted original with mutants (read outside the lock, no unlock, clamped count).
    3. GREEN: safe Rust decision behind a thin hidden shim; the mutex and the count stay in C behind a small private adapter. The original moves to its own ported group for the C reference. The unchanged C test gets a _rust twin linked to the swap; the interleave and set-group tests run against both libraries.

    First PR expected within a few hours.

  8. moved this from Blocked to In progress in obs-rust Multiviewon Nov 21, 2026
  9. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Done in #5375 (merged 2026-11-21): obs_encoder_group_num_started now runs through safe Rust in obs-output; master push run is green.

  10. 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